:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --line: #d9deea;
    --text: #1f2937;
    --muted: #64748b;
    --primary: #2457c5;
    --primary-dark: #183d89;
    --accent: #0f9f8f;
    --danger: #b42318;
    --shadow: 0 10px 28px rgba(15, 23, 42, .08);
    --radius: 8px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }

.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.app-sidebar { width: 280px; flex: 0 0 280px; min-height: 100vh; background: #111827; color: #eef2ff; padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; overflow-x: hidden; transition: flex-basis .2s ease, width .2s ease, padding .2s ease, transform .2s ease; }
body.sidebar-collapsed .app-sidebar { width: 72px; flex-basis: 72px; padding-left: 12px; padding-right: 12px; }
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .brand > span:not(.brand-mark), body.sidebar-collapsed .side-nav__link span, body.sidebar-collapsed .side-nav__children, body.sidebar-collapsed .sidebar-footer { display: none; }
body.sidebar-collapsed .side-nav__link { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-overlay { display: none; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-mark { width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center; background: #0f9f8f; font-size: 1.35rem; }
.brand-mark--logo { background: transparent; border: 1px solid rgba(255,255,255,.14); overflow: hidden; }
.brand-logo { display: block; width: 36px; height: 36px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand small { color: #cbd5e1; font-size: .82rem; margin-top: 2px; }
.side-nav { display: grid; gap: 6px; }
.side-nav__link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius); color: #dbe4f0; }
.side-nav__link.active, .side-nav__link:hover { background: #25324a; color: #fff; }
.side-nav__link--group { cursor: default; }
.side-nav__children { display: grid; gap: 4px; margin-left: 10px; }
.side-nav__link--child { padding-left: 24px; font-size: .94rem; color: #cbd5e1; }
.sidebar-footer { margin-top: auto; color: #94a3b8; font-size: .86rem; }

.app-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.app-topbar { height: 60px; max-height: 64px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 20px; }
.app-content { flex: 1 0 auto; padding: 16px 22px 22px; min-width: 0; }
.app-route-dashboard .app-content { background: #f4efe3; }
.sidebar-toggle { width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); color: var(--text); display: inline-grid; place-items: center; flex: 0 0 auto; }
.sidebar-toggle:hover { border-color: var(--primary); color: var(--primary); }
.topbar-page { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.topbar-page h1 { font-size: 1rem; line-height: 1.2; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .76rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumbs a:hover { color: var(--primary); }
.top-search { flex: 1; max-width: 680px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; align-items: center; gap: 10px; padding: 0 12px; box-shadow: var(--shadow); }
.top-search input, .hero-search input, .filter-main input { border: 0; outline: 0; flex: 1; min-width: 0; padding: 13px 0; background: transparent; }
.topbar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.page-action-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(15, 23, 42, .05); }
.page-action-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; color: var(--text); padding: 6px 10px; font-size: .88rem; font-weight: 800; white-space: nowrap; }
.page-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-action-btn--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.page-action-btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); display: inline-grid; place-items: center; color: var(--text); }
button.icon-btn { cursor: pointer; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.danger { border-color: #fecaca; background: #fff7f7; color: var(--danger); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:disabled, .admin-action-btn:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.35); }
.icon-btn:disabled:hover, .admin-action-btn:disabled:hover { border-color: #d7dee8; color: #94a3b8; }
.profile-btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 8px 10px; display: flex; gap: 8px; align-items: center; }
.profile-btn--admin { border-color: var(--danger); background: #fee2e2; color: var(--danger); font-weight: 800; }
.profile-btn--admin:hover, .profile-btn--admin:focus { background: #fecaca; color: #7f1d1d; }
.admin-menu { border-color: #fecaca; }
.admin-menu .dropdown-item-text { color: var(--danger); font-weight: 800; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 2rem; margin: 0 0 6px; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); max-width: 760px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-panel { background: #102033; color: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); align-items: center; }
.hero-panel p { color: #dbeafe; }
.hero-search { margin-top: 18px; display: flex; align-items: center; gap: 12px; background: #fff; color: var(--text); border-radius: var(--radius); padding: 0 8px 0 14px; max-width: 720px; }
.top-search-spacer { flex: 1; }
.topbar-dashboard-search { flex: 0 1 460px; max-width: 460px; min-width: 240px; display: flex; align-items: center; gap: 8px; margin-left: 8px; border: 1px solid #dbe3ed; border-radius: 999px; background: #f8fafc; color: #64748b; padding: 4px 5px 4px 13px; }
.topbar-dashboard-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #111827; font-size: .9rem; font-weight: 400; }
.topbar-dashboard-search button { border: 0; border-radius: 999px; background: #900202; color: #fff; padding: 6px 13px; font-size: .82rem; font-weight: 500; }
.topbar-dashboard-search button:hover { background: #740101; }
.topbar-quick-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.topbar-quick-action { min-height: 32px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dbe3ed; border-radius: 8px; background: #fff; color: #334155; padding: 5px 8px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.topbar-quick-action:hover { border-color: #1f5f8b; color: #1f5f8b; background: #f8fafc; }
.dashboard-library-section { margin-bottom: 22px; }
.dashboard-library-home { background: rgba(255, 255, 255, .86); border: 1px solid #e4dccd; border-radius: 18px; box-shadow: 0 10px 26px rgba(72, 54, 36, .06); padding: 16px; }
.dashboard-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dashboard-section-head h2 { margin: 0 0 3px; font-size: 1.12rem; line-height: 1.25; font-weight: 600; color: #111827; }
.dashboard-section-head p { margin: 0; color: #6b7280; font-size: .9rem; font-weight: 400; }
.dashboard-category-tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.dashboard-category-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; max-width: 260px; border: 1px solid #d8d1c6; border-radius: 999px; background: #fff; color: #334155; padding: 7px 12px 7px 8px; font-size: .88rem; font-weight: 500; white-space: nowrap; box-shadow: 0 4px 12px rgba(72, 54, 36, .035); transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease; }
.dashboard-category-tab:hover { transform: translateY(-2px); border-color: #b8aa99; color: #900202; box-shadow: 0 10px 20px rgba(72, 54, 36, .08); }
.dashboard-category-tab.is-active { border-color: #900202; background: #900202; color: #fff; box-shadow: 0 10px 22px rgba(144, 2, 2, .18); }
.dashboard-category-tab__icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: #f1f5f9; color: #475569; flex: 0 0 auto; }
.dashboard-category-tab.is-active .dashboard-category-tab__icon { background: rgba(255, 255, 255, .18); color: #fff; }
.dashboard-category-tab span:not(.dashboard-category-tab__icon) { overflow: hidden; text-overflow: ellipsis; }
.dashboard-category-tab small { display: inline-grid; min-width: 22px; min-height: 22px; place-items: center; border-radius: 999px; background: #f8fafc; color: #64748b; padding: 0 6px; font-size: .75rem; font-weight: 500; }
.dashboard-category-tab.is-active small { background: rgba(255, 255, 255, .2); color: #fff; }
.dashboard-documents-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 12px; padding-top: 4px; border-top: 1px solid #edf2f7; }
.dashboard-documents-head h3 { margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 600; color: #111827; }
.dashboard-documents-head p { margin: 0; color: #6b7280; font-size: .85rem; font-weight: 400; }
.dashboard-show-more { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #900202; border-radius: 999px; background: #900202; color: #fff; padding: 6px 11px; font-size: .82rem; font-weight: 500; white-space: nowrap; }
.dashboard-show-more:hover { background: #740101; border-color: #740101; color: #fff; }
.dashboard-document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 270px)); justify-content: start; gap: 15px; margin-top: 10px; }
.dashboard-document-card { width: 100%; max-width: 270px; min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 10px 24px rgba(15, 23, 42, .055); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dashboard-document-card:hover { transform: translateY(-3px); border-color: #cbd5e1; box-shadow: 0 18px 34px rgba(15, 23, 42, .1); }
.dashboard-document-card__media { position: relative; height: 235px; display: grid; place-items: center; background: #f8fafc; border-bottom: 1px solid #e5e7eb; overflow: hidden; padding: 8px; }
.dashboard-document-card__media img { width: 100%; height: 100%; object-fit: contain; object-position: center top; border-radius: 10px; display: block; transition: transform .22s ease; }
.dashboard-document-card:hover .dashboard-document-card__media img { transform: scale(1.025); }
.dashboard-document-category-badge { position: absolute; top: 10px; left: 10px; z-index: 2; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; background: rgba(144, 2, 2, .92); color: #fff; padding: 4px 9px; font-size: .72rem; font-weight: 500; box-shadow: 0 8px 18px rgba(15, 23, 42, .14); }
.dashboard-document-placeholder { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: #fff; color: #1f5f8b; box-shadow: 0 10px 22px rgba(15, 23, 42, .08); }
.dashboard-document-placeholder i { font-size: 1.55rem; }
.dashboard-document-card__body { padding: 11px 12px 5px; min-width: 0; }
.dashboard-document-card__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; color: #64748b; font-size: .74rem; font-weight: 400; }
.dashboard-document-card__meta span { display: inline-flex; align-items: center; border: 1px solid #e5e7eb; border-radius: 999px; background: #f8fafc; padding: 2px 7px; }
.dashboard-document-card h3 { margin: 0 0 5px; font-size: .97rem; line-height: 1.25; font-weight: 600; color: #111827; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dashboard-document-card h3 a:hover { color: #1f5f8b; }
.dashboard-document-card p { margin: 0; color: #64748b; font-size: .82rem; line-height: 1.35; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dashboard-document-card__footer { padding: 8px 12px 12px; display: flex; justify-content: flex-end; }
.dashboard-document-card__footer .btn { font-weight: 500; }
.dashboard-document-card__action { border-color: #900202; background: #900202; color: #fff; }
.dashboard-document-card__action:hover, .dashboard-document-card__action:focus { border-color: #740101; background: #740101; color: #fff; }

.section-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.section-title p { font-weight: 400; }
.branding-settings-card .section-title h2 { font-weight: 600; }
.branding-settings-form { display: grid; gap: 14px; }
.branding-logo-panel { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 18px; align-items: start; }
.branding-logo-preview { width: 132px; min-height: 92px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; padding: 12px; }
.branding-logo-preview img { display: block; max-width: 108px; max-height: 68px; object-fit: contain; }
.branding-logo-preview .brand-mark { color: #fff; }
.branding-logo-fields { min-width: 0; }
.branding-settings-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.branding-remove-form { margin-top: 12px; }
.footer-settings-card { max-width: 880px; }
.footer-settings-form { display: grid; gap: 14px; }
.footer-settings-form .form-label, .footer-settings-form .form-check-label { font-weight: 500; }
.footer-settings-actions { display: flex; justify-content: flex-end; }
.app-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e5e7eb; background: #fff; color: #64748b; padding: 10px 22px; font-size: .78rem; line-height: 1.35; }
.app-footer p { margin: 0; }
.app-footer__main { display: grid; gap: 2px; min-width: 0; }
.app-footer__credit { flex: 0 0 auto; color: #475569; white-space: nowrap; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.category-tile { border: 1px solid var(--line); border-left: 5px solid var(--tile-color); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; background: #fff; min-height: 128px; }
.category-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tile-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); background: color-mix(in srgb, var(--tile-color), white 84%); color: var(--tile-color); font-size: 1.25rem; }
.category-tile small, .doc-card small, .table-title + small { color: var(--muted); display: block; }
.category-admin-header { margin-bottom: 14px; }
.category-admin-header h1 { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.25; font-weight: 600; color: #111827; }
.category-admin-header p { margin: 0; color: #6b7280; font-size: .94rem; font-weight: 400; }
.category-admin-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr); gap: 18px; align-items: start; }
.category-admin-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); overflow: hidden; }
.category-admin-card--form { position: sticky; top: 74px; }
.category-admin-card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e5e7eb; padding: 11px 14px; background: #fff; }
.category-admin-card__header h2 { margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 600; color: #111827; }
.category-admin-table-wrap { overflow-x: auto; }
.category-admin-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; }
.category-admin-table th { border-bottom: 1px solid #dbe3ed; border-right: 1px solid #e7edf5; background: #f1f5f9; color: #475569; padding: 8px 9px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.category-admin-table th:last-child, .category-admin-table td:last-child { border-right: 0; }
.category-admin-table td { border-top: 1px solid #e7edf5; border-right: 1px solid #eef2f7; padding: 8px 9px; vertical-align: middle; color: #374151; font-size: .88rem; font-weight: 400; }
.category-admin-table tbody tr:hover { background: #f8fbff; }
.category-admin-table tr.is-muted { opacity: .72; }
.category-order-cell { width: 70px; color: #64748b; white-space: nowrap; }
.category-name-cell { min-width: 260px; }
.category-tree-label { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding-left: var(--level-indent, 0); }
.category-tree-label > i { color: #64748b; flex: 0 0 auto; }
.category-tree-label > span { min-width: 0; }
.category-admin-thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; border: 1px solid #e5e7eb; background: #f8fafc; flex: 0 0 auto; }
.category-name-text { display: block; color: #111827; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-name-cell small { display: block; max-width: 360px; margin-top: 2px; color: #6b7280; font-size: .78rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-status-pill { display: inline-flex; align-items: center; border: 1px solid #bbf7d0; border-radius: 999px; background: #f0fdf4; color: #166534; padding: 3px 8px; font-size: .76rem; font-weight: 500; white-space: nowrap; }
.category-status-pill--off { border-color: #e5e7eb; background: #f8fafc; color: #64748b; }
.category-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.category-actions .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.category-admin-form { display: grid; gap: 12px; padding: 14px; }
.category-form-field { display: grid; gap: 5px; margin: 0; min-width: 0; }
.category-form-field span, .category-check-line span { color: #374151; font-size: .88rem; font-weight: 500; }
.category-form-field .form-control, .category-form-field .form-select { min-height: 38px; border-color: #d7dee8; border-radius: 10px; font-size: .92rem; font-weight: 400; }
.category-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .45fr); gap: 12px; align-items: end; }
.category-check-line { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.category-check-line--compact { min-height: auto; margin-top: 6px; }
.category-thumbnail-preview { width: 100%; max-width: 220px; aspect-ratio: 16 / 9; display: block; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 10px; background: #f8fafc; }
.category-thumbnail-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.category-advanced { border: 1px solid #e5e7eb; border-radius: 10px; background: #f8fafc; padding: 9px 10px; }
.category-advanced summary { cursor: pointer; color: #31506f; font-size: .88rem; font-weight: 500; }
.category-translation-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.category-form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.category-form-actions .btn { min-height: 36px; font-weight: 500; }
.category-empty { margin: 0; color: #6b7280; font-weight: 400; }

.admin-split-header { margin-bottom: 14px; }
.admin-split-header h1 { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.25; font-weight: 600; color: #111827; }
.admin-split-header p { margin: 0; color: #6b7280; font-size: .94rem; font-weight: 400; }
.admin-split-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(340px, 1.35fr); gap: 18px; align-items: start; }
.admin-split-layout--roles { grid-template-columns: minmax(300px, 35fr) minmax(0, 65fr); }
.admin-list-panel, .admin-form-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); overflow: hidden; }
.admin-list-panel--full { width: 100%; }
.admin-form-panel { position: sticky; top: 74px; }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e5e7eb; padding: 11px 14px; background: #fff; }
.admin-panel-header h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 600; color: #111827; }
.admin-panel-header span { color: #64748b; font-size: .84rem; font-weight: 500; }
.admin-panel-header__actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.admin-panel-header__actions .btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.admin-table-wrap { overflow-x: auto; }
.admin-compact-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; }
.admin-compact-table--houses { min-width: 980px; }
.admin-compact-table--users { min-width: 980px; }
.admin-compact-table th { border-bottom: 1px solid #dbe3ed; border-right: 1px solid #e7edf5; background: #f1f5f9; color: #475569; padding: 8px 9px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.admin-compact-table th:last-child, .admin-compact-table td:last-child { border-right: 0; }
.admin-compact-table td { border-top: 1px solid #e7edf5; border-right: 1px solid #eef2f7; padding: 8px 9px; vertical-align: middle; color: #374151; font-size: .88rem; font-weight: 400; }
.admin-compact-table tbody tr:hover { background: #f8fbff; }
.admin-compact-table tr.is-muted { opacity: .72; }
.admin-code-cell { width: 86px; color: #475569; white-space: nowrap; }
.admin-name-cell { min-width: 180px; color: #111827; font-weight: 500; }
.admin-name-cell small { display: block; margin-top: 2px; color: #6b7280; font-size: .78rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-description-cell { max-width: 300px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-email-cell { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-owner-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.admin-owner-badge { display: inline-flex; align-items: center; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; padding: 2px 7px; font-size: .72rem; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.admin-owner-badge--protected { border-color: #e5e7eb; background: #f8fafc; color: #475569; }
.admin-role-cell { min-width: 130px; }
.admin-role-badge { display: inline-flex; align-items: center; border: 1px solid #dbe3ed; border-radius: 999px; background: #f8fafc; color: #475569; padding: 3px 8px; font-size: .76rem; font-weight: 500; white-space: nowrap; margin: 1px 3px 1px 0; }
.admin-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 24px; border: 1px solid #dbe3ed; border-radius: 999px; background: #f8fafc; color: #475569; padding: 3px 9px; font-size: .76rem; font-weight: 500; line-height: 1; }
.admin-status-pill { display: inline-flex; align-items: center; border: 1px solid #bbf7d0; border-radius: 999px; background: #f0fdf4; color: #166534; padding: 3px 8px; font-size: .76rem; font-weight: 500; white-space: nowrap; }
.admin-status-pill--off { border-color: #e5e7eb; background: #f8fafc; color: #64748b; }
.admin-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.admin-action-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid #d7dee8; border-radius: 8px; background: #fff; color: #334155; line-height: 1; cursor: pointer; }
.admin-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.admin-action-btn--danger { border-color: #fecaca; background: #fff7f7; color: var(--danger); }
.admin-action-btn--danger:hover { border-color: var(--danger); color: var(--danger); }
.admin-filter-bar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid #e5e7eb; background: #f8fafc; padding: 10px 14px; }
.admin-filter-field { display: grid; gap: 5px; margin: 0; min-width: 150px; }
.admin-filter-field--grow { flex: 1 1 220px; }
.admin-filter-field span { color: #475569; font-size: .8rem; font-weight: 500; }
.admin-filter-field .form-control, .admin-filter-field .form-select { min-height: 34px; border-color: #d7dee8; border-radius: 8px; font-size: .86rem; font-weight: 400; }
.admin-filter-actions { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.admin-filter-actions .btn { min-height: 34px; font-weight: 500; }
.admin-entity-form { display: grid; gap: 12px; padding: 14px; }
.admin-form-field { display: grid; gap: 5px; margin: 0; min-width: 0; }
.admin-form-field span, .admin-check-line span { color: #374151; font-size: .88rem; font-weight: 500; }
.admin-form-field .form-control, .admin-form-field .form-select { min-height: 38px; border-color: #d7dee8; border-radius: 10px; font-size: .92rem; font-weight: 400; }
.admin-form-field textarea.form-control { resize: vertical; }
.admin-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-check-line { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.admin-form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.admin-form-actions .btn { min-height: 36px; font-weight: 500; }
.admin-help-text { margin: -2px 0 0; color: #6b7280; font-size: .82rem; line-height: 1.45; font-weight: 400; }
.admin-help-text--warning { color: #9a3412; }
.admin-required-marker { color: #b91c1c; font-weight: 600; }
.admin-empty-cell, .admin-empty-state { margin: 0; color: #6b7280; font-weight: 400; }
.admin-empty-cell { text-align: center; padding: 18px !important; }
.admin-empty-state { padding: 14px; }
.admin-user-modal .modal-dialog { max-width: 820px; }
.admin-user-modal .modal-title { font-size: 1.05rem; font-weight: 600; color: #111827; }
.admin-user-modal .modal-header, .admin-user-modal .modal-footer { border-color: #e5e7eb; }
.admin-user-modal-body { display: grid; gap: 14px; padding: 18px; }
.admin-user-modal .admin-form-row { column-gap: 14px; row-gap: 12px; align-items: start; }
.admin-user-modal .admin-form-field { grid-template-rows: auto minmax(38px, auto) auto; align-content: start; gap: 6px; }
.admin-user-modal .admin-field-label { min-height: 18px; display: inline-flex; align-items: center; gap: 4px; color: #374151; font-size: .88rem; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.admin-user-modal .admin-required-marker { display: inline-flex; align-items: center; line-height: 1; flex: 0 0 auto; }
.admin-user-modal .admin-help-text { margin: 0; font-size: .78rem; line-height: 1.3; }
.admin-modal-alert { margin: 0; font-size: .9rem; }

.role-list { display: grid; gap: 8px; padding: 12px; }
.role-list-item { display: grid; gap: 10px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; color: inherit; padding: 11px; text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.role-list-item:hover, .role-list-item.active { border-color: #bfd0e3; box-shadow: 0 8px 18px rgba(15, 23, 42, .06); transform: translateY(-1px); }
.role-list-item.active { background: #f8fbff; }
.role-list-item__main { display: grid; gap: 3px; min-width: 0; }
.role-list-item__title { color: #111827; font-size: .95rem; font-weight: 600; line-height: 1.25; }
.role-list-item__description { color: #6b7280; font-size: .82rem; font-weight: 400; line-height: 1.35; }
.role-list-item__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-count-badge, .role-lock-badge, .role-system-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: .75rem; line-height: 1.2; font-weight: 500; white-space: nowrap; }
.role-count-badge { border: 1px solid #dbe3ed; background: #f8fafc; color: #475569; }
.role-system-badge { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; }
.role-lock-badge { border: 1px solid #e5e7eb; background: #f3f4f6; color: #4b5563; }
.role-editor-panel .admin-panel-header p { margin: 3px 0 0; color: #6b7280; font-size: .84rem; font-weight: 400; }
.role-permission-form { display: grid; gap: 14px; padding: 14px; }
.role-editor-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #f8fafc; padding: 12px; }
.role-editor-label { display: block; color: #64748b; font-size: .78rem; font-weight: 500; margin-bottom: 3px; }
.role-editor-summary h3 { margin: 0 0 3px; color: #111827; font-size: 1.05rem; line-height: 1.25; font-weight: 600; }
.role-editor-summary p { margin: 0; color: #6b7280; font-size: .88rem; font-weight: 400; }
.role-editor-badges { display: inline-flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.role-safety-note { margin: 0; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; color: #1e3a8a; padding: 9px 10px; font-size: .86rem; font-weight: 400; }
.role-safety-note--warning { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.role-permission-groups { display: grid; gap: 10px; }
.role-permission-group { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; overflow: hidden; }
.role-permission-group summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; padding: 10px 12px; background: #f8fafc; color: #111827; font-size: .95rem; font-weight: 600; }
.role-permission-group summary span { display: inline-flex; align-items: center; gap: 8px; }
.role-permission-group summary small { color: #64748b; font-size: .78rem; font-weight: 500; }
.role-group-tools { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1px solid #edf2f7; padding: 10px 12px 0; }
.role-group-tools .btn { font-weight: 500; }
.role-permission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 12px 12px; }
.role-permission-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; margin: 0; color: #374151; font-size: .88rem; font-weight: 400; }
.role-permission-check input { margin-top: 3px; }
.role-permission-check span { margin: 0; font-weight: 400; }
.role-permission-check small { display: block; margin-top: 1px; color: #94a3b8; font-size: .74rem; font-weight: 400; word-break: break-word; }
.role-permission-check.is-disabled { opacity: .68; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.doc-list { display: grid; gap: 10px; }
.doc-card, .file-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: #fff; }
.doc-card:hover, .file-row:hover { border-color: var(--primary); }
.doc-icon { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: #eef6ff; color: var(--primary); flex: 0 0 auto; }
.empty-state { color: var(--muted); margin: 0; }

.filter-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 22px; }
.filter-main { display: flex; align-items: center; gap: 10px; }
.filter-panel summary { cursor: pointer; margin-top: 10px; color: var(--primary); font-weight: 700; }
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; }
.documents-filter { margin-bottom: 16px; }
.documents-filter-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
label span { display: block; font-weight: 700; margin-bottom: 6px; }
.wide { grid-column: 1 / -1; }
.table-title { font-weight: 600; color: var(--primary-dark); }
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.documents-results-block { padding: 14px; }
.documents-results-title span { color: var(--muted); font-size: .9rem; font-weight: 400; }
.documents-table-wrap { overflow-x: auto; }
.document-table--wide { min-width: 1120px; margin-bottom: 0; }
.document-table--wide th { white-space: nowrap; font-size: .82rem; color: var(--muted); }
.document-table--wide td { padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.document-title-cell { min-width: 220px; max-width: 320px; }
.document-title-cell small, .document-table--wide td small { color: var(--muted); display: block; margin-top: 3px; line-height: 1.25; }
.sort-link { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; }
.sort-link:hover { color: var(--primary); }
.file-type-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 24px; border-radius: 999px; padding: 3px 8px; background: #eef6ff; color: var(--primary-dark); font-size: .76rem; font-weight: 500; }
.document-actions { min-width: 188px; }
.document-actions .icon-btn { width: 34px; height: 34px; }
.documents-list-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 26px rgba(15, 23, 42, .06); overflow: hidden; }
.documents-card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.documents-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.documents-card-icon { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--radius); background: #eef6ff; color: var(--primary); flex: 0 0 auto; }
.documents-card-title h2 { margin: 0; font-size: .98rem; line-height: 1.2; font-weight: 600; }
.documents-card-title span:not(.documents-card-icon) { color: var(--muted); font-size: .84rem; font-weight: 400; }
.documents-upload-btn { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #900202; border-radius: var(--radius); padding: 7px 11px; background: #900202; color: #fff; font-size: .88rem; font-weight: 500; white-space: nowrap; }
.documents-upload-btn:hover { background: #6f0101; border-color: #6f0101; color: #fff; }
.documents-toolbar { display: grid; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.documents-toolbar-row { min-width: 0; }
.documents-toolbar-row--controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.documents-toolbar-row--chips { width: 100%; }
.documents-toolbar-main { display: flex; align-items: center; gap: 10px; flex: 1 1 560px; min-width: 0; }
.documents-toolbar-buttons { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.documents-tool-btn { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d7dee8; border-radius: var(--radius); background: #fff; color: var(--text); padding: 6px 9px; font-size: .82rem; font-weight: 500; line-height: 1; cursor: pointer; }
.documents-tool-btn:hover { border-color: var(--primary); color: var(--primary); }
.documents-bulk-btn { border-color: #900202; background: #fff5f5; color: #900202; }
.documents-bulk-btn:hover { border-color: #6f0101; background: #6f0101; color: #fff; }
.documents-column-menu { position: relative; }
.documents-column-popover { position: fixed; top: 0; left: 0; z-index: 3000; width: min(340px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 18px 48px rgba(15, 23, 42, .18); padding: 12px; }
.documents-column-popover[hidden] { display: none; }
.documents-column-popover__header { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid #edf1f7; margin-bottom: 8px; }
.documents-column-popover__header span { font-size: .9rem; font-weight: 600; }
.documents-column-popover__header small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.documents-column-group { display: grid; gap: 6px; margin-top: 8px; }
.documents-column-group-title { color: var(--muted); font-size: .78rem; font-weight: 500; }
.documents-column-option { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: .84rem; font-weight: 400; cursor: pointer; }
.documents-column-option.is-mandatory { color: var(--muted); cursor: default; }
.documents-column-option input { margin: 0; cursor: pointer; }
.documents-column-option input:disabled { cursor: default; }
.documents-column-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf1f7; }
.documents-category-chips { width: 100%; display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0 5px; scrollbar-width: thin; }
.documents-category-chip { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid #d7dee8; border-radius: 999px; background: #fff; color: #475569; padding: 5px 10px; font-size: .82rem; font-weight: 400; white-space: nowrap; }
.documents-category-chip:hover { border-color: #900202; color: #900202; }
.documents-category-chip.is-active { border-color: #900202; background: #900202; color: #fff; }
.documents-global-search { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .84rem; font-weight: 500; }
.documents-global-search__input { min-width: 280px; display: flex; align-items: center; gap: 8px; border: 1px solid #d7dee8; border-radius: var(--radius); background: #fff; padding: 3px 4px 3px 10px; color: var(--muted); }
.documents-global-search__input input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; padding: 7px 2px; color: var(--text); }
.documents-global-search__input button { border: 0; border-radius: calc(var(--radius) - 2px); background: #900202; color: #fff; padding: 7px 10px; font-size: .8rem; font-weight: 500; }
.documents-global-search__input button:hover { background: #6f0101; }
.documents-table-scroll { overflow-x: auto; }
.document-table--adminlte { min-width: 980px; margin: 0; border-collapse: separate; border-spacing: 0; }
.document-table--adminlte thead th { border-bottom: 1px solid #dbe3ed; border-right: 1px solid #e7edf5; background: #c2c5c9; color: #475569; font-size: .82rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; vertical-align: middle; padding: 8px 9px; }
.document-table--adminlte thead th:last-child, .document-table--adminlte tbody td:last-child { border-right: 0; }
.document-table--adminlte tbody td { border-top: 1px solid #e7edf5; border-right: 1px solid #eef2f7; padding: 7px 9px; vertical-align: middle; font-size: .88rem; font-weight: 400; line-height: 1.25; }
.document-table--adminlte tbody tr:hover { background: #f8fbff; }
.document-table--adminlte .documents-filter-row th { padding: 6px 7px; background: #f8fafc; border-bottom: 1px solid var(--line); font-weight: 400; }
.documents-filter-control { width: 100%; min-height: 30px; border: 1px solid #d7dee8; border-radius: calc(var(--radius) - 2px); background: #fff; color: var(--text); padding: 5px 7px; font-size: 13px; font-weight: 400; outline: 0; }
.documents-filter-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 92, 141, .1); }
.documents-filter-control--short { max-width: 92px; }
.documents-filter-submit { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #900202; border-radius: calc(var(--radius) - 2px); background: #fff; color: #900202; padding: 5px 8px; font-size: .78rem; font-weight: 500; white-space: nowrap; }
.documents-filter-submit:hover { background: #900202; color: #fff; }
.actions-heading { text-align: right; }
.document-select-cell { width: 42px; text-align: center; }
.document-date-cell { width: 105px; white-space: nowrap; color: #475569; font-weight: 400; }
.document-table--adminlte .document-title-cell { min-width: 260px; max-width: 360px; }
.document-table--adminlte .table-title { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-table--adminlte .document-title-cell small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); margin-top: 2px; }
.document-table--adminlte td small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.document-table--adminlte .document-title-cell small { max-width: 100%; }
.document-table--adminlte .document-actions { min-width: 180px; justify-content: flex-end; flex-wrap: nowrap; }
.document-table--adminlte .document-actions .icon-btn { width: 30px; height: 30px; border-radius: calc(var(--radius) - 2px); }
.document-table--adminlte .document-actions .document-library-action { border-color: #900202; background: #fff5f5; color: #900202; }
.document-table--adminlte .document-actions .document-library-action:hover { border-color: #6f0101; background: #6f0101; color: #fff; }
.document-language-cell { white-space: nowrap; min-width: 104px; }
.language-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 22px; margin-right: 4px; border-radius: 999px; border: 1px solid #c8d7e8; background: #f8fbff; color: #31506f; font-size: .72rem; font-weight: 500; line-height: 1; text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease; }
.language-badge:hover { transform: translateY(-1px); box-shadow: 0 6px 12px rgba(15, 23, 42, .08); }
.language-badge--it { border-color: #bbf7d0; background: #ecfdf5; color: #166534; }
.language-badge--it:hover { border-color: #166534; background: #dcfce7; color: #14532d; }
.language-badge--en { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.language-badge--en:hover { border-color: #1d4ed8; background: #dbeafe; color: #1e3a8a; }
.language-badge--es { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.language-badge--es:hover { border-color: #b45309; background: #fef3c7; color: #78350f; }
.language-badge--fr { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.language-badge--fr:hover { border-color: #4338ca; background: #e0e7ff; color: #312e81; }
.language-badge--pt { border-color: #99f6e4; background: #f0fdfa; color: #0f766e; }
.language-badge--pt:hover { border-color: #0f766e; background: #ccfbf1; color: #134e4a; }
.document-table--adminlte .is-column-hidden { display: none; }
.documents-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 12px 16px; background: #fff; }
.documents-length-control { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 400; }
.documents-filter-control--per-page { width: auto; min-width: 76px; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.pagination-summary { color: var(--muted); font-size: .9rem; font-weight: 400; }
.pagination-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination-links a, .pagination-links span { min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 9px; background: #fff; color: var(--text); font-weight: 400; font-size: .9rem; }
.pagination-links a.active { border-color: #900202; background: #900202; color: #fff; }
.pagination-links a.disabled { pointer-events: none; opacity: .45; }
.status-pill { border-radius: 999px; padding: 4px 9px; font-size: .82rem; font-weight: 800; background: #e2e8f0; }
.status-pill.published { background: #dcfce7; color: #166534; }
.status-pill.draft { background: #fef3c7; color: #92400e; }
.status-pill.archived { background: #e5e7eb; color: #374151; }

.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 16px; }
.detail-title-block { min-width: 0; }
.detail-title-block h1 { margin: 0 0 5px; font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.18; font-weight: 700; letter-spacing: 0; }
.detail-title-block p { margin: 0; color: var(--muted); max-width: 860px; line-height: 1.45; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .72fr); gap: 18px; align-items: start; }
.detail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.detail-actions .btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.detail-actions--top { flex: 0 0 auto; padding-top: 2px; }
.detail-tabs-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 22px rgba(15, 23, 42, .05); overflow: hidden; }
.detail-tabs { gap: 2px; padding: 8px 10px 0; background: #f8fafc; border-bottom: 1px solid var(--line); }
.detail-tabs .nav-link { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; color: #526174; font-weight: 600; padding: 9px 12px; }
.detail-tabs .nav-link.active { background: #fff; color: var(--primary-dark); border: 1px solid var(--line); border-bottom-color: #fff; margin-bottom: -1px; }
.detail-tab-content { padding: 14px; }
.file-list { display: grid; gap: 9px; }
.detail-file-row { min-height: 62px; padding: 10px 12px; }
.detail-file-row .doc-icon { width: 34px; height: 34px; }
.detail-file-row:hover { border-color: #c7d8ea; }
.detail-file-info { min-width: 0; flex: 1; }
.detail-file-name { display: block; max-width: 100%; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-file-info small { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.detail-file-actions { margin-left: auto; flex-wrap: nowrap; }
.detail-file-actions .icon-btn { width: 32px; height: 32px; }
.detail-image-grid { margin: 0; }
.detail-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-history-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.detail-history-head span { color: var(--muted); font-size: .84rem; }
.detail-history-table { margin-bottom: 12px; }
.detail-history-table th { color: #526174; font-size: .78rem; font-weight: 600; background: #f8fafc; white-space: nowrap; }
.detail-history-table td { font-size: .88rem; vertical-align: middle; }
.detail-history-pagination { justify-content: flex-end; }
.detail-side { display: grid; gap: 12px; }
.detail-metadata-card { background: #f8fafc; border: 1px solid #e1e7ef; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(15, 23, 42, .04); padding: 14px; }
.detail-metadata-card h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 600; color: var(--text); }
.detail-meta-list { margin: 0; }
.detail-meta-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #e2e8f0; }
.detail-meta-row:last-child { border-bottom: 0; }
.detail-meta-row dt { color: var(--muted); font-weight: 500; min-width: 120px; }
.detail-meta-row dd { margin: 0; color: var(--text); font-weight: 400; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.detail-note-card { background: #fff; border: 1px solid #e1e7ef; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(15, 23, 42, .04); padding: 14px; }
.detail-note-card h2 { margin: 0 0 8px; font-size: 1rem; font-weight: 600; color: var(--text); }
.detail-note-card p { margin: 0; color: #334155; line-height: 1.5; white-space: normal; }
.meta-empty { color: #94a3b8; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.image-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }

.wizard-form { display: grid; gap: 18px; }
.document-form-header { margin-bottom: 14px; }
.document-form-header h1 { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.25; font-weight: 600; color: #111827; }
.document-form-header p { margin: 0; color: #6b7280; font-size: .94rem; font-weight: 400; }
.document-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr); gap: 18px; align-items: start; }
.document-form-column { display: grid; gap: 16px; min-width: 0; }
.form-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); }
.form-card__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.form-section-title { margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 600; color: #111827; }
.compact-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compact-form-grid--single { grid-template-columns: 1fr; }
.auth-settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .42fr); gap: 18px; align-items: start; }
.auth-settings-main { display: grid; gap: 14px; min-width: 0; }
.auth-settings-side { position: sticky; top: 74px; min-width: 0; }
.auth-settings-card { padding: 14px; }
.auth-settings-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.auth-settings-card__head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #111827; font-size: 1rem; font-weight: 600; }
.form-switch-line { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #374151; font-size: .9rem; font-weight: 500; }
.form-switch-line input { width: 16px; height: 16px; }
.auth-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: center; }
.auth-url-list { display: grid; gap: 10px; }
.auth-url-list .form-control { font-size: .8rem; color: #475569; background: #f8fafc; }
.auth-settings-actions { margin-top: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; }
.document-form-field { display: grid; gap: 5px; margin: 0; min-width: 0; }
.document-form-field--wide { grid-column: 1 / -1; }
.document-form .form-label, .document-form label span { margin: 0; color: #374151; font-size: .88rem; font-weight: 500; }
.document-form .section-label { font-weight: 600; color: #374151; }
.document-form .form-control, .document-form .form-select { min-height: 38px; border-color: #d7dee8; border-radius: 10px; font-size: .92rem; font-weight: 400; }
.document-form textarea.form-control { min-height: 76px; resize: vertical; }
.document-form-help { margin: 9px 0 0; font-size: .84rem; }
.document-form-actions { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border: 1px solid #e5e7eb; border-radius: 12px; background: rgba(255, 255, 255, .96); padding: 10px 12px; box-shadow: 0 -8px 22px rgba(15, 23, 42, .08); }
.document-form-actions .btn { min-height: 36px; font-weight: 500; }
.wizard-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wizard-steps span { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.translation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.translation-grid.small { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 12px 0; }
.translation-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.translation-box h3 { font-size: 1rem; margin: 0; }
.drop-zone { border: 1px dashed #9fb0ca; border-radius: 12px; min-height: 130px; display: grid; place-items: center; gap: 8px; text-align: center; background: #f8fafc; padding: 16px; }
.drop-zone.dragover { border-color: var(--accent); background: #ecfdf5; }
.drop-zone i { font-size: 1.8rem; color: var(--primary); }
.drop-zone span { font-weight: 500; color: #374151; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 6px; }
.stat-card i { color: var(--accent); font-size: 1.35rem; }
.stat-card span { color: var(--muted); }
.stat-card strong { font-size: 2rem; }
.compact-form { display: grid; gap: 12px; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 32px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.permission-grid label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.language-list { display: flex; gap: 8px; flex-wrap: wrap; }
.language-list span { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: #fff; }
.language-check-grid { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.language-check-grid label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d7dee8; border-radius: 10px; background: #fff; padding: 6px 8px; font-size: .82rem; font-weight: 500; }
.file-language-panel { margin-top: 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #f8fafc; padding: 10px; }
.file-language-list, .existing-file-language-list { display: grid; gap: 8px; margin-top: 10px; }
.file-language-row, .existing-file-language-list label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 190px); align-items: center; gap: 10px; border: 1px solid #d7dee8; border-radius: 10px; background: #fff; padding: 7px 9px; }
.file-language-row span, .existing-file-language-list label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.auth-body { min-height: 100vh; display: grid; place-items: center; background: #eef2f7; padding: 18px; }
.auth-wrap { width: min(620px, 100%); }
.auth-flash-stack { position: relative; z-index: 5; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.auth-card.wide { width: min(900px, 100%); }
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.auth-brand span { width: 52px; height: 52px; border-radius: var(--radius); display: grid; place-items: center; background: #e0f2fe; color: var(--primary); font-size: 1.5rem; }
.auth-brand h1 { margin: 0 0 4px; font-size: 1.55rem; font-weight: 700; }
.auth-brand p, .muted { margin: 0; color: var(--muted); }
.section-label { font-weight: 600; }

.auth-body.login-screen { display: block; place-items: initial; padding: 0; background: #f6f8fb; }
.login-screen .auth-wrap { width: 100%; min-height: 100vh; }
.login-screen .auth-flash-stack { position: fixed; top: 18px; left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); z-index: 20; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 55fr 45fr; overflow: hidden; background: #f8fafc; color: #111827; }
.login-visual { position: relative; isolation: isolate; display: flex; align-items: flex-end; padding: clamp(36px, 6vw, 72px); overflow: hidden; background: linear-gradient(140deg, #0f2d46 0%, #174b71 48%, #eef7fb 100%); color: #fff; }
.login-visual::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 44px 44px; opacity: .24; }
.login-visual__line { position: absolute; left: 12%; top: 22%; width: 72%; height: 42%; border: 1px solid rgba(190, 224, 241, .32); border-left: 0; border-bottom: 0; border-radius: 0 80px 0 0; transform: rotate(-4deg); animation: loginLine 9s ease-in-out infinite; }
.login-visual__orb { position: absolute; width: 220px; height: 82px; border-radius: 26px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); box-shadow: 0 20px 70px rgba(125, 211, 252, .12); animation: loginDrift 10s ease-in-out infinite; }
.login-visual__orb--one { top: 12%; left: 8%; }
.login-visual__orb--two { right: 10%; bottom: 18%; animation-delay: -4s; }
.login-floating-doc { position: absolute; z-index: 1; width: 132px; height: 164px; padding: 22px 18px; border: 1px solid rgba(255,255,255,.42); border-radius: 16px; background: rgba(255,255,255,.82); box-shadow: 0 18px 46px rgba(15,23,42,.18); animation: loginFloat 7s ease-in-out infinite; }
.login-floating-doc span { display: block; height: 8px; margin-bottom: 12px; border-radius: 999px; background: #bfd3df; }
.login-floating-doc span:nth-child(1) { width: 72%; background: #1f5f8b; }
.login-floating-doc span:nth-child(2) { width: 90%; }
.login-floating-doc span:nth-child(3) { width: 62%; }
.login-floating-doc--one { top: 17%; right: 18%; transform: rotate(7deg); }
.login-floating-doc--two { top: 42%; left: 17%; width: 118px; height: 146px; transform: rotate(-8deg); animation-delay: -2.5s; }
.login-floating-doc--three { right: 26%; bottom: 18%; width: 108px; height: 136px; transform: rotate(3deg); animation-delay: -4s; }
.login-visual__content { position: relative; z-index: 2; max-width: 520px; animation: loginFadeUp .7s ease both; }
.login-visual__mark { width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); font-size: 1.75rem; }
.login-visual__content h2 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 600; letter-spacing: 0; }
.login-visual__content p { margin: 0; max-width: 440px; color: rgba(255,255,255,.82); font-size: 1.02rem; line-height: 1.65; font-weight: 400; }
.login-panel { display: grid; place-items: center; padding: clamp(24px, 5vw, 60px); background: radial-gradient(circle at 50% 12%, rgba(37, 99, 235, .18), transparent 34%), linear-gradient(180deg, #07111f 0%, #0b1729 100%); }
.login-card { width: min(390px, 100%); padding: 34px 30px 24px; border: 1px solid rgba(96,165,250,.28); border-radius: 26px; background: linear-gradient(180deg, rgba(13,25,43,.9), rgba(8,16,30,.86)); box-shadow: 0 26px 72px rgba(0,0,0,.36), 0 0 0 1px rgba(255,255,255,.04) inset, 0 0 44px rgba(37,99,235,.16); backdrop-filter: blur(18px); animation: loginFadeUp .55s ease both; }
.login-brand { display: grid; justify-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.login-brand__icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; color: #dbeafe; background: linear-gradient(145deg, #1d4ed8, #38bdf8); font-size: 1.38rem; box-shadow: 0 0 0 5px rgba(59,130,246,.13), 0 12px 28px rgba(37,99,235,.38); animation: loginPulse 3.8s ease-in-out infinite; }
.login-brand h1 { margin: 4px 0 0; color: #f8fafc; font-size: 1.62rem; font-weight: 700; }
.login-brand p { margin: 0; color: #a9b8cf; font-size: .93rem; font-weight: 400; line-height: 1.45; }
.login-actions { display: grid; gap: 10px; }
.login-local-form { display: grid; gap: 12px; }
.login-local-form label { display: grid; gap: 7px; color: #dbeafe; font-size: .86rem; font-weight: 500; }
.login-local-form .form-control { min-height: 44px; border: 1px solid rgba(148,163,184,.22); border-radius: 12px; background: rgba(2,6,23,.52); color: #f8fafc; font-size: .94rem; box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset; }
.login-local-form .form-control:focus { border-color: rgba(96,165,250,.72); background: rgba(2,6,23,.68); color: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.login-submit-button, .login-rcj-button { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; border: 0; border-radius: 13px; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; font-weight: 600; }
.login-submit-button { color: #fff; background: linear-gradient(135deg, #1d4ed8, #2563eb); box-shadow: 0 14px 26px rgba(37,99,235,.28); }
.login-submit-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.login-rcj-button { color: #ecfdf5; background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 14px 28px rgba(34,197,94,.26); }
.login-rcj-button::after { content: ""; position: absolute; top: -40%; bottom: -40%; left: -35%; width: 26%; transform: rotate(18deg); background: rgba(255,255,255,.25); transition: left .55s ease; }
.login-rcj-button:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 34px rgba(34,197,94,.32); }
.login-rcj-button:hover::after { left: 120%; }
.login-rcj-button--disabled { cursor: not-allowed; opacity: .62; box-shadow: none; }
.login-rcj-button--disabled:hover { transform: none; }
.login-rcj-button__icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.16); }
.login-separator { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; color: #7f8ea6; font-size: .78rem; font-weight: 500; }
.login-separator::before, .login-separator::after { content: ""; flex: 1; height: 1px; background: rgba(148,163,184,.22); }
.login-method-empty { margin: 10px 0 0; padding: 10px 12px; border: 1px solid rgba(250,204,21,.24); border-radius: 12px; background: rgba(250,204,21,.08); color: #fde68a; font-size: .84rem; font-weight: 400; text-align: center; }
.login-language { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.login-language a { padding: 5px 8px; border-radius: 999px; color: #94a3b8; text-decoration: none; font-size: .76rem; font-weight: 500; }
.login-language a:hover, .login-language a.is-active { background: rgba(59,130,246,.17); color: #dbeafe; }
.login-footer { margin-top: 16px; color: #78869d; font-size: .76rem; text-align: center; }

@keyframes loginFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes loginDrift { 0%, 100% { translate: 0 0; opacity: .72; } 50% { translate: 18px -10px; opacity: .95; } }
@keyframes loginLine { 0%, 100% { opacity: .32; transform: rotate(-4deg) translateY(0); } 50% { opacity: .58; transform: rotate(-4deg) translateY(12px); } }
@keyframes loginFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,95,139,.16); } 50% { box-shadow: 0 0 0 10px rgba(31,95,139,0); } }

@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; min-height: 100vh; }
    .login-visual { min-height: 260px; align-items: center; padding: 28px; }
    .login-visual__content h2 { font-size: 2rem; }
    .login-floating-doc--three, .login-visual__line { display: none; }
    .login-panel { padding: 22px; }
}

@media (max-width: 576px) {
    .login-visual { min-height: 190px; padding: 22px; }
    .login-floating-doc { opacity: .38; transform: scale(.8); }
    .login-floating-doc--two { display: none; }
    .login-card { padding: 22px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-visual__line, .login-visual__orb, .login-floating-doc, .login-visual__content, .login-card, .login-brand__icon, .login-submit-button, .login-rcj-button { animation: none !important; transition: none !important; }
    .login-submit-button:hover, .login-rcj-button:hover { transform: none; }
}
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 16px 0; }
.check-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 4px; }
.check-item.ok i { color: #15803d; }
.check-item.bad i { color: #b45309; }
.install-actions { display: grid; gap: 10px; }

.reader-body { background: #0b1020; color: #fff; min-height: 100vh; overflow: hidden; }
.reader-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100vh; }
.reader-side { background: #111827; padding: 18px; overflow: auto; border-right: 1px solid #334155; }
.reader-back { display: inline-flex; align-items: center; gap: 8px; color: #dbeafe; margin-bottom: 18px; }
.reader-back--toolbar { margin-bottom: 0; padding: 7px 10px; border: 1px solid #475569; border-radius: var(--radius); background: #1f2937; color: #eef6ff; font-size: .88rem; white-space: nowrap; }
.reader-back--toolbar:hover { color: #fff; border-color: #64748b; background: #243044; }
.reader-side h1 { font-size: 1.15rem; margin: 0 0 16px; }
.reader-list { display: grid; gap: 8px; }
.reader-list a { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--radius); color: #dbe4f0; border: 1px solid transparent; }
.reader-list a.active, .reader-list a:hover { background: #243044; border-color: #475569; }
.reader-main { position: relative; display: grid; grid-template-rows: 58px minmax(0, 1fr); height: 100vh; min-width: 0; min-height: 0; overflow: hidden; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #151d2e; border-bottom: 1px solid #334155; }
.reader-toolbar-title { min-width: 0; display: flex; align-items: center; gap: 12px; }
.reader-toolbar-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-canvas { min-height: 0; height: calc(100vh - 58px); overflow-y: auto; overflow-x: auto; display: grid; place-items: start center; padding: 16px 16px 120px; box-sizing: border-box; overscroll-behavior: contain; }
.reader-image { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; }
.pdf-reader { position: relative; width: 100%; min-height: 100%; display: grid; grid-template-rows: auto max-content; gap: 10px; place-items: start center; }
.pdf-controls { display: flex; gap: 8px; align-items: center; }
.pdf-reader canvas { background: #fff; max-width: 100%; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.reader-page-nav { position: absolute; top: 58px; bottom: 0; z-index: 18; display: flex; align-items: center; pointer-events: none; }
.reader-page-nav--prev { left: 18px; }
.reader-page-nav--next { right: 18px; }
.reader-page-nav__button { width: 46px; height: 46px; display: inline-grid; place-items: center; border: 1px solid #475569; border-radius: 999px; background: rgba(21, 29, 46, .82); color: #dbeafe; box-shadow: 0 12px 26px rgba(0,0,0,.26); opacity: .74; pointer-events: auto; transition: opacity .16s ease, background .16s ease, border-color .16s ease; }
.reader-page-nav__button:hover { opacity: 1; background: #243044; border-color: #64748b; color: #fff; }
.reader-page-nav__button:disabled { opacity: .22; cursor: default; pointer-events: none; }
.pdf-scroll-controls { position: sticky; right: 12px; bottom: 12px; justify-self: end; align-self: end; z-index: 5; display: grid; gap: 6px; margin: -170px 10px 10px 0; pointer-events: none; }
.pdf-scroll-controls .icon-btn { width: 34px; height: 34px; border-color: #475569; background: rgba(21, 29, 46, .88); color: #dbeafe; pointer-events: auto; }
.pdf-scroll-controls .icon-btn:hover { background: #243044; color: #fff; border-color: #64748b; }
.docx-preview { background: #fff; color: var(--text); width: min(900px, 100%); min-height: 80vh; padding: 32px; border-radius: var(--radius); overflow: auto; }
.reader-empty { display: grid; place-items: center; gap: 12px; color: #dbeafe; text-align: center; }

@media (max-width: 992px) {
    .app-shell { display: block; min-height: 100vh; }
    .app-main { width: 100%; min-width: 0; }
    .app-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1050; width: 260px; max-width: calc(100vw - 44px); flex-basis: auto; min-height: 0; overflow-y: auto; transform: translateX(-100%); box-shadow: 20px 0 50px rgba(15, 23, 42, .24); }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-collapsed .app-sidebar { width: 260px; flex-basis: auto; padding: 22px 16px; }
    body.sidebar-collapsed .brand { justify-content: flex-start; }
    body.sidebar-collapsed .brand > span:not(.brand-mark), body.sidebar-collapsed .side-nav__link span, body.sidebar-collapsed .sidebar-footer { display: block; }
    body.sidebar-collapsed .side-nav__children { display: grid; }
    body.sidebar-collapsed .side-nav__link { justify-content: flex-start; padding: 11px 12px; }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(15, 23, 42, .42); }
    .app-topbar { height: 58px; padding: 0 12px; gap: 10px; }
    .app-content { padding: 14px 14px 20px; }
    .topbar-page h1 { font-size: .95rem; }
    .topbar-crumbs { display: none; }
    .profile-btn span { display: none; }
    .page-head { align-items: stretch; flex-direction: column; }
    .detail-hero { align-items: stretch; flex-direction: column; gap: 12px; }
    .detail-actions--top { justify-content: flex-start; padding-top: 0; }
    .detail-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .detail-tabs .nav-link { white-space: nowrap; }
    .detail-history-head { align-items: stretch; flex-direction: column; }
    .detail-meta-row { display: grid; grid-template-columns: 1fr; gap: 3px; }
    .detail-meta-row dd { text-align: left; }
    .page-action-row { justify-content: flex-start; }
    .two-col, .detail-grid, .reader-shell { grid-template-columns: 1fr; }
    .app-topbar { flex-wrap: wrap; height: auto; min-height: 60px; max-height: none; row-gap: 8px; }
    .topbar-dashboard-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    .topbar-quick-actions { order: 4; width: 100%; overflow-x: auto; padding-bottom: 2px; }
    .topbar-quick-action span { display: inline; }
    .topbar-quick-action { width: auto; justify-content: center; padding: 5px 8px; }
    .dashboard-document-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 270px)); }
    .documents-card-header, .documents-toolbar-main, .documents-card-footer { align-items: stretch; flex-direction: column; }
    .documents-toolbar-row--controls { align-items: stretch; flex-direction: column; }
    .documents-toolbar-buttons { align-items: stretch; }
    .documents-tool-btn { flex: 1 1 auto; }
    .documents-category-chips { flex-wrap: nowrap; overflow-x: auto; }
    .documents-column-popover { left: 0; right: auto; width: min(280px, calc(100vw - 48px)); }
    .documents-global-search { align-items: stretch; flex-direction: column; }
    .documents-global-search__input { min-width: 0; width: 100%; }
    .document-table--adminlte { min-width: 980px; }
    .role-permission-list { grid-template-columns: 1fr; }
    .role-editor-summary { flex-direction: column; }
    .category-admin-layout { grid-template-columns: 1fr; }
    .category-admin-card--form { position: static; }
    .admin-split-layout { grid-template-columns: 1fr; }
    .admin-form-panel { position: static; }
    .file-language-row, .existing-file-language-list label { grid-template-columns: 1fr; }
    .reader-shell { height: auto; min-height: 100vh; }
    .reader-side { max-height: 280px; }
    .wizard-steps { grid-template-columns: 1fr; }
}

@media (min-width: 993px) and (max-width: 1400px) {
    .topbar-dashboard-search { flex-basis: 380px; max-width: 380px; }
    .topbar-quick-action span { display: none; }
    .topbar-quick-action { width: 34px; justify-content: center; padding-left: 0; padding-right: 0; }
    .dashboard-document-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 270px)); }
}

@media (max-width: 992px) {
    .dashboard-document-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 270px)); }
    .document-form-grid { grid-template-columns: 1fr; }
    .auth-settings-layout { grid-template-columns: 1fr; }
    .auth-settings-side { position: static; }
    .branding-logo-panel { grid-template-columns: 1fr; }
    .app-footer { align-items: flex-start; flex-direction: column; gap: 6px; padding: 10px 14px; }
    .app-footer__credit { white-space: normal; }
}

@media (max-width: 576px) {
    .dashboard-section-head { align-items: stretch; flex-direction: column; }
    .dashboard-documents-head { align-items: stretch; flex-direction: column; }
    .dashboard-category-tab { max-width: none; }
    .dashboard-document-grid { grid-template-columns: 1fr; }
    .dashboard-document-card { max-width: none; }
    .dashboard-document-card__media { height: 230px; }
    .category-form-row { grid-template-columns: 1fr; }
    .category-form-actions { justify-content: stretch; }
    .category-form-actions .btn { flex: 1 1 auto; }
    .admin-form-row { grid-template-columns: 1fr; }
    .admin-form-actions { justify-content: stretch; }
    .admin-form-actions .btn { flex: 1 1 auto; }
    .admin-filter-actions, .admin-filter-actions .btn, .admin-filter-field { width: 100%; }
    .compact-form-grid { grid-template-columns: 1fr; }
    .auth-rule-grid { grid-template-columns: 1fr; }
    .auth-settings-card__head { align-items: flex-start; flex-direction: column; }
    .document-form-actions { justify-content: stretch; }
    .document-form-actions .btn { flex: 1 1 auto; }
    .documents-card-header, .documents-toolbar, .documents-card-footer { padding-left: 12px; padding-right: 12px; }
    .documents-upload-btn { justify-content: center; width: 100%; }
    .documents-filter-submit span, .documents-tool-btn span { display: none; }
}

@media print {
    .app-sidebar, .app-topbar, .documents-toolbar, .documents-card-footer, .document-actions, .actions-heading { display: none !important; }
    .app-shell { display: block; }
    .app-content { padding: 0; }
    .documents-list-card { border: 0; box-shadow: none; }
    .document-table--adminlte { min-width: 0; width: 100%; }
}
