:root,
[data-theme="dark"] {
    --bg: #0f1419;
    --bg-gradient: #1e293b;
    --surface: #1a2332;
    --surface-hover: #243044;
    --border: #2d3a4f;
    --text: #e8edf4;
    --text-muted: #8b9cb3;
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.15);
    --success: #22c55e;
    --success-text: #052e16;
    --danger: #ef4444;
    --tr-color: #fbbf24;
    --de-color: #60a5fa;
    --radius: 16px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --topbar-bg: rgba(15, 20, 25, 0.85);
    --selection-bg: rgba(59, 130, 246, 0.35);
}

[data-theme="light"] {
    --bg: #f0f4f8;
    --bg-gradient: #dbeafe;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --border: #cbd5e1;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.12);
    --success: #16a34a;
    --success-text: #ffffff;
    --tr-color: #b45309;
    --de-color: #1d4ed8;
    --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    --topbar-bg: rgba(255, 255, 255, 0.92);
    --selection-bg: rgba(37, 99, 235, 0.25);
}

* {
    box-sizing: border-box;
}

::selection {
    background: var(--selection-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(ellipse at top, var(--bg-gradient) 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.topbar {
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    min-width: 0;
}

.brand-link {
    color: inherit;
    text-decoration: none;
}

.brand-link:hover {
    color: var(--accent);
}

.topbar-nav {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-slot {
    width: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-slot-home {
    width: 72px;
}

.nav-slot.nav-dropdown {
    width: auto;
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

.nav-dropdown-toggle.is-open {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 30;
}

.nav-dropdown-item {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-dropdown-item.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-slot.nav-user {
    width: auto;
    gap: 6px;
    padding: 0 6px;
}

.nav-user-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link-muted {
    font-size: 0.85rem;
    padding: 4px 8px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.btn-theme {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-theme:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.home-layout {
    display: flex;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 57px);
    align-items: stretch;
}

.home-main {
    flex: 1;
    min-width: 0;
    padding: 40px 32px 48px;
}

.home-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.home-desc {
    color: var(--text-muted);
    margin: 0;
}

.home-aside {
    width: 168px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 8px 28px 0;
    margin-right: 12px;
    border-left: 1px solid var(--border);
}

.admin-aside {
    margin-right: 20px;
    min-height: calc(100vh - 57px);
}

.admin-side-nav-bottom {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.list-panel {
    width: 100%;
}

.list-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0 2px;
}

.list-sidebar-title {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.list-menu-compact .list-menu-item {
    padding: 6px 8px;
    border-radius: 8px;
}

.list-menu-compact .list-menu-name {
    font-size: 0.8rem;
}

.list-menu-compact .list-menu-count {
    font-size: 0.68rem;
    padding: 1px 6px;
}

.list-sidebar-hint {
    margin: 10px 2px 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-icon:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.list-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.list-menu-item:hover {
    background: var(--surface-hover);
}

.list-menu-item.is-active {
    background: var(--accent-soft);
    border-color: rgba(59, 130, 246, 0.35);
}

.list-menu-name {
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-menu-name.is-editing {
    outline: 1px solid var(--accent);
    border-radius: 4px;
    padding: 0 4px;
    background: var(--bg);
    white-space: normal;
}

.list-menu-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.admin-layout {
    display: flex;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 57px);
    align-items: stretch;
}

.admin-center {
    flex: 1;
    min-width: 0;
    padding: 28px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.admin-placeholder {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 80px;
}

.admin-panel {
    width: 100%;
    max-width: 640px;
}

.admin-list-label {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.admin-side-nav {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-side-link {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.admin-side-link + .admin-side-link {
    margin-top: 4px;
}

.admin-side-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.admin-side-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.admin-list-panel {
    margin-top: 4px;
}

.admin-table-panel {
    max-width: 100%;
}

.admin-table-title {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.sentence-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.sentence-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.sentence-table th,
.sentence-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    line-height: 1.45;
}

.sentence-table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sentence-table tbody tr:nth-child(even) {
    background: rgba(128, 128, 128, 0.04);
}

.sentence-table tbody tr.is-learned td {
    opacity: 0.55;
}

.sentence-table td {
    white-space: pre-line;
}

.sentence-table td:first-child {
    width: 50%;
    color: var(--tr-color);
}

.sentence-table td:last-child {
    width: 50%;
    color: var(--de-color);
}

.cell-empty {
    color: var(--text-muted);
    font-style: italic;
}

.sentence-table-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
}

.admin-table-empty {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stats,
.admin-stats {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.stats-row .stats {
    margin-bottom: 0;
}

.stats-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-reset.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.btn-reset.is-active:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-reset:disabled {
    opacity: 0.5;
    cursor: wait;
}

.card-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: sticky;
    top: 57px;
    z-index: 5;
}

.card-toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.card-toolbar-btn {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 10px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    user-select: none;
}

.card-toolbar-btn:hover:not(:disabled) {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: rgba(59, 130, 246, 0.25);
}

.card-toolbar-btn:disabled,
.card-toolbar-btn.is-disabled {
    opacity: 0.35;
    cursor: default;
}

.card-toolbar-center {
    position: relative;
    display: flex;
    justify-content: center;
    min-width: 72px;
}

.card-num-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.card-num-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.22);
    border-color: var(--accent);
}

.card-num-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.card-num-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.card-jump-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 20;
}

.card-jump-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.card-jump-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-jump-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.card-jump-hint {
    margin: 8px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.card-area {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 220px;
    margin-bottom: 20px;
    padding: 36px 28px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, background 0.2s;
    outline: none;
}

.card-area:hover,
.card-area:focus-visible {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.card-area:active {
    transform: scale(0.995);
}

.card-area.is-empty {
    cursor: default;
    border-style: dashed;
}

.card-area.is-empty:hover {
    border-color: var(--border);
    background: var(--surface);
    transform: none;
}

.btn-copy {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-copy:hover,
.btn-copy.is-copied {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.card-content {
    text-align: left;
}

.sentence-tr,
.sentence-de {
    font-size: clamp(1.25rem, 4vw, 1.65rem);
    font-weight: 600;
    margin: 0 0 16px;
    line-height: 1.45;
    white-space: pre-line;
    text-align: left;
}

.sentence-tr {
    color: var(--tr-color);
}

.sentence-de {
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    color: var(--de-color);
    margin-bottom: 0;
    animation: fadeIn 0.25s ease;
}

.sentence-de.is-placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-size: 1rem;
    font-weight: 400;
}

.selectable {
    user-select: text;
    cursor: text;
}

.hint,
.footer-hint,
.empty-msg {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.footer-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
}

.action-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.move-dropdown {
    position: relative;
}

.btn-move {
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-move:hover,
.btn-move.is-open {
    border-color: var(--text);
    color: var(--text);
    background: var(--surface-hover);
}

.btn-move:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.move-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 20;
}

.move-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;
}

.move-menu-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.btn-edit,
.btn-learned {
    padding: 10px 28px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-learned {
    background: transparent;
    border: 1px solid var(--success);
    color: var(--success);
}

.btn-learned:hover {
    background: var(--success);
    color: var(--success-text);
}

.btn-edit {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-edit:hover {
    background: var(--accent);
    color: #fff;
}

.btn-new {
    padding: 10px 28px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-new:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.modal-tools {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    z-index: 2;
    min-width: 88px;
}

.btn-tool {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-tool:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-tool-translate {
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.35);
}

.btn-tool-unlearn {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.35);
    font-size: 0.7rem;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
}

.btn-tool:disabled {
    opacity: 0.6;
    cursor: wait;
}

.modal-box .modal-title {
    padding-right: 110px;
}

.modal-tools {
    min-width: 108px;
}

.sentence-table-row {
    cursor: pointer;
}

.sentence-table-row:hover td {
    background: var(--accent-soft);
}

.modal-title {
    margin: 0 0 20px;
    font-size: 1.25rem;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edit-textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
}

.edit-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.admin-page h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.admin-desc {
    color: var(--text-muted);
    margin: 0 0 20px;
}

.settings-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.settings-subtitle {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--accent);
}

.settings-form {
    margin-bottom: 28px;
}

.settings-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.password-show-btn {
    align-self: flex-start;
    margin-top: -4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.password-show-btn:hover {
    color: var(--text);
}

.password-show-btn:focus-visible {
    outline: none;
    border-radius: 4px;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-center-wide {
    align-items: stretch;
}

.admin-panel-wide {
    max-width: 900px;
}

.users-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.users-table td,
.users-table th {
    font-size: 0.9rem;
}

.inline-form {
    margin: 0;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.users-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.form-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn-danger {
    color: #c0392b;
    border-color: #e8b4b0;
}

.btn-danger:hover {
    background: #fdecea;
    border-color: #c0392b;
}

.cell-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-check input {
    accent-color: var(--accent);
}

.admin-file-input {
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-select {
    max-width: 280px;
    border-radius: 10px;
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.import-textarea {
    width: 100%;
    min-height: 360px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
}

.import-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-primary {
    align-self: flex-start;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

[data-theme="light"] .alert-success {
    color: #15803d;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

[data-theme="light"] .alert-error {
    color: #b91c1c;
}

.alert-info {
    background: var(--accent-soft);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

[data-theme="light"] .alert-info {
    color: #1d4ed8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .home-layout,
    .admin-layout {
        flex-direction: column;
    }

    .home-aside,
    .admin-aside {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        margin-right: 0;
        padding: 16px 20px 20px;
    }

    .home-main {
        padding: 28px 20px 16px;
    }

    .admin-center {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .nav-slot {
        width: 56px;
    }

    .nav-slot-home {
        width: 56px;
    }

    .card-area {
        padding: 28px 18px;
        min-height: 180px;
    }

    .action-wrap {
        flex-direction: column;
    }

    .move-dropdown {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .move-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* Kart yorumları */
.card-comments-bar {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-comments-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-comments-open:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-comments-open:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-comments-icon {
    font-size: 1rem;
    line-height: 1;
}

.btn-comments-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-comments-badge[hidden] {
    display: none;
}

.modal-box-comments {
    max-width: 680px;
    max-height: min(92vh, 800px);
    display: flex;
    flex-direction: column;
    padding-bottom: 16px;
}

.modal-box-comments .modal-title {
    padding-right: 0;
    margin: 0;
}

.comments-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.comments-card-preview {
    flex-shrink: 0;
    margin-bottom: 14px;
    padding: 20px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    text-align: left;
}

.comments-card-preview .sentence-tr,
.comments-card-preview .sentence-de {
    font-size: 1rem;
    margin: 0 0 12px;
    white-space: pre-line;
}

.comments-card-preview .sentence-de {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.comments-card-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.comments-list {
    flex: 1;
    min-height: 100px;
    max-height: 36vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding-right: 4px;
}

.comments-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.comments-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 24px 12px;
}

.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.comment-item.is-mine {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.04);
}

.comment-mine-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--accent-soft);
}

.comment-vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    width: 32px;
    padding: 4px 0;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-left: auto;
}

.comment-vote-readonly {
    cursor: default;
    opacity: 0.85;
}

.comment-mine-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comment-vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

.comment-vote svg {
    width: 14px;
    height: 14px;
}

.comment-vote:hover {
    background: var(--accent-soft);
}

.comment-vote-up.is-active {
    color: #d93900;
}

.comment-vote-down.is-active {
    color: #7193ff;
}

.comment-score {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    min-height: 1.1rem;
}

.comment-body-col {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.comment-author {
    font-weight: 700;
    color: var(--text);
}

.comment-sep {
    opacity: 0.6;
}

.comment-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.comment-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--accent);
}

.comments-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comments-link-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
}

.comments-link-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.comments-form-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.85rem;
}
