:root { color-scheme: light; }
.content-wrapper { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px; box-sizing: border-box; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ag-pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.ag-pagination .pagination { display: flex; gap: 4px; }
.ag-pagination a { min-width: 34px; padding: 7px 10px; border: 1px solid var(--border-color); border-radius: 6px; text-align: center; text-decoration: none; color: inherit; }
.ag-pagination a.active { background: var(--primary, #111827); color: #fff; border-color: transparent; }
.ag-pagination-summary { color: var(--text-muted); font-size: .875rem; }
.dt-page-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.dt-page-ellipsis { display: inline-flex; align-items: center; padding: 0 5px; color: var(--text-muted); }
.ag-list-header { gap: 12px; flex-wrap: nowrap; align-items: center; }
.ag-table-header-main { flex: 0 1 auto; min-width: 0; }
.ag-table-header-tools { flex: 1 1 auto; min-width: 0; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.ag-table-filter-form { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.ag-table-search { position: relative; min-width: 190px; }
.ag-table-search > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.ag-table-search .form-control { padding-left: 28px; }
.ag-table-filter-form > .form-control { flex: 0 0 120px; width: 120px; min-width: 0; }
.ag-table-filter-form > select.form-control { flex: 0 1 auto; width: auto; min-width: 120px; max-width: 220px; } /* L-15: a filter shows its whole label ("Semua departemen") */
.ag-table-filter-form > .ag-table-search { flex: 1 1 220px; min-width: 160px; max-width: 260px; }
.ag-table-filter-form > button { flex: 0 0 auto; }
.ag-table-actions { flex: 0 0 auto; display: flex; gap: 6px; white-space: nowrap; }
.sidebar-close-btn { display:none; margin-left:auto; width:34px; height:34px; border:0; border-radius:7px; background:transparent; color:var(--text-muted); font-size:1.5rem; line-height:1; cursor:pointer; }
[data-theme="dark"] { color-scheme:dark; }
[data-theme="dark"] .sidebar-rail { background:var(--bg-surface); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { background:var(--bg-surface-alt); color:var(--text-main); border-color:var(--border-color); }
[data-theme="dark"] .card, [data-theme="dark"] .ag-drawer-panel { background:var(--bg-surface); }
[data-theme="dark"] .table thead th, [data-theme="dark"] .table-header { background:var(--bg-surface-alt); }
[data-theme="dark"] .status-pill:not(.status-active):not(.status-warning):not(.status-inactive) { background:var(--bg-surface-alt); color:var(--text-main); }
.ag-list-footer .ag-pagination { margin-top: 0; }
.ag-empty-state { padding: 40px !important; text-align: center; color: var(--text-muted); }

.channel-page { display: grid; gap: 20px; }
.channel-page-header { margin-bottom: 0; gap: 16px; }
.channel-page-actions, .channel-publications { display: flex; flex-wrap: wrap; gap: 8px; }
.channel-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--bg-surface, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 16px; overflow: hidden; }
.channel-summary > div { padding: 20px 24px; display: grid; gap: 4px; border-right: 1px solid var(--border-color, #e5e7eb); }
.channel-summary > div:last-child { border-right: 0; }
.channel-summary strong { font-size: 28px; line-height: 1; }
.channel-summary span { color: var(--text-muted); font-size: 13px; }
.channel-tree-card { background: var(--bg-surface, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 16px; overflow: hidden; }
.channel-tree-card > header { padding: 20px 24px; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.channel-tree-card h2, .channel-tree-card p { margin: 0; }
.channel-tree-card p { margin-top: 4px; color: var(--text-muted); }
.channel-tree-item { border-bottom: 1px solid var(--border-color, #e5e7eb); }
.channel-tree-item:last-child { border-bottom: 0; }
.channel-tree-item > summary { list-style: none; min-height: 68px; padding: 12px 20px; display: grid; grid-template-columns: 4px minmax(180px, 1fr) auto auto; gap: 14px; align-items: center; cursor: pointer; }
.channel-tree-item > summary::-webkit-details-marker { display: none; }
.channel-tree-item > summary:hover { background: var(--bg-surface-alt, #f8fafc); }
.channel-tree-item.depth-1 > summary { padding-left: 44px; }
.channel-tree-item.depth-2 > summary { padding-left: 68px; }
.channel-tree-guide { align-self: stretch; border-radius: 99px; background: #111827; opacity: .15; }
.channel-tree-item.depth-1 .channel-tree-guide { background: #6b7280; opacity: .3; }
.channel-tree-item.depth-2 .channel-tree-guide { background: #9ca3af; opacity: .5; }
.channel-tree-label { min-width: 0; display: grid; gap: 3px; }
.channel-tree-label small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.channel-edit-label { color: var(--text-muted); font-size: 13px; }
.channel-tree-item[open] .channel-edit-label { color: var(--text-main, #111827); }
.channel-edit-panel { padding: 20px 24px 24px; background: var(--bg-surface-alt, #f8fafc); border-top: 1px solid var(--border-color, #e5e7eb); }
.channel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-form-wide { grid-column: 1 / -1; }
.channel-checks { display: flex; gap: 18px; align-items: center; }
.channel-edit-panel > form + form { margin-top: 12px; }

@media (max-width: 720px) {
    .channel-page-header { align-items: flex-start; }
    .channel-page-actions { width: 100%; }
    .channel-page-actions .btn { flex: 1; }
    .channel-summary > div { padding: 16px; }
    .channel-tree-item > summary { grid-template-columns: 4px minmax(0, 1fr) auto; padding-left: 14px !important; }
    .channel-badges { display: none; }
    .channel-edit-label { grid-column: 3; }
    .channel-edit-panel { padding: 16px; }
    .channel-form-grid { grid-template-columns: 1fr; }
    .channel-form-wide { grid-column: auto; }
}
.status-pill { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cms-form { max-width: 820px; }
.cms-form .form-group { margin-bottom: 16px; }
.cms-form label { display: block; margin-bottom: 6px; font-weight: 600; }
.cms-form textarea { min-height: 180px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.media-card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px 8px 0 0; }
.media-card-body { padding: 12px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.alert ul { margin: 0; }
.ag-drawer { position: fixed; inset: 0; z-index: 1100; display: flex; justify-content: flex-end; visibility: hidden; pointer-events: none; }
.ag-drawer:target, .ag-drawer.is-open { visibility: visible; pointer-events: auto; }
.ag-drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); opacity: 0; transition: opacity .2s ease; }
.ag-drawer:target .ag-drawer-backdrop, .ag-drawer.is-open .ag-drawer-backdrop { opacity: 1; }
.ag-drawer-panel { position: relative; width: min(460px, 100%); height: 100%; overflow-y: auto; background: var(--surface, #fff); box-shadow: -12px 0 32px rgba(15, 23, 42, .18); transform: translateX(100%); transition: transform .22s ease; }
.ag-drawer:target .ag-drawer-panel, .ag-drawer.is-open .ag-drawer-panel { transform: translateX(0); }
.ag-drawer-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border-color); background: var(--surface, #fff); }
.ag-drawer-header h2 { margin: 0; font-size: 1.125rem; }
.ag-drawer-header p { margin: 5px 0 0; color: var(--text-muted); font-size: .875rem; }
.ag-drawer-close { display: inline-grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: inherit; font-size: 1.5rem; line-height: 1; text-decoration: none; }
.ag-drawer-close:hover { background: var(--background, #f3f4f6); }
.ag-drawer-body { padding: 24px; }
.ag-drawer-body .form-group { margin-bottom: 18px; }
.ag-drawer-body .form-label { display: block; margin-bottom: 6px; font-weight: 600; }
.ag-drawer-body .form-actions { position: sticky; bottom: -24px; display: flex; justify-content: flex-end; gap: 8px; margin: 24px -24px -24px; padding: 16px 24px; border-top: 1px solid var(--border-color); background: var(--surface, #fff); }
.drawer-section-title { margin: 0 0 10px; font-size: .9375rem; }
.drawer-list { display: grid; gap: 8px; }
.drawer-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.drawer-list-row small { color: var(--text-muted); }
body.ag-drawer-visible { overflow: hidden; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.recovery-code-grid code, .mfa-secret { display: inline-block; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--background, #f3f4f6); letter-spacing: .08em; }
.text-break { overflow-wrap: anywhere; }
.dashboard-overview { padding:2rem 0; }
.dashboard-overview h1 { margin:0; font-size:2.75rem; line-height:1.1; letter-spacing:-.035em; }
.dashboard-overview > p { margin:1.5rem 0 3.25rem; font-size:1.25rem; color:var(--text-muted); }
.page-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.page-heading h1 { margin:0 0 .25rem; }
.page-heading p { margin:0; color:var(--text-muted); }
.user-edit-grid { display:grid; grid-template-columns:minmax(0, 2fr) minmax(19rem, 1fr); gap:1.25rem; align-items:start; }
.user-edit-grid.single { grid-template-columns:1fr; }
.stack-lg, .stack-md { display:flex; flex-direction:column; }
.stack-lg { gap:1.25rem; } .stack-md { gap:.8rem; }
.form-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:1rem; }
.form-grid-full { grid-column:1 / -1; }
.workspace-assignment { display:grid; grid-template-columns:minmax(12rem, 1fr) minmax(12rem, 1fr) auto; gap:.75rem; align-items:center; padding:.8rem; border:1px solid var(--border-color); border-radius:8px; }
.check-row { display:flex; align-items:center; gap:.5rem; }
.check-row span { color:var(--text-muted); font-size:.85rem; }
.security-options { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:1rem; }
.security-options .form-hint { grid-column:1 / -1; }
.permission-panel { position:sticky; top:1rem; max-height:calc(100vh - 2rem); overflow:hidden; }
.permission-list { overflow:auto; max-height:calc(100vh - 9rem); padding:0; }
.permission-item { display:grid; grid-template-columns:minmax(0, 1fr) 7rem; gap:.75rem; align-items:center; padding:.8rem 1rem; border-bottom:1px solid var(--border-color); }
.access-role-list { display:grid; gap:.6rem; }
.access-role-item { border:1px solid var(--border-color); border-radius:8px; overflow:hidden; }
.access-role-item summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.9rem 1rem; cursor:pointer; }
.access-role-item summary small { color:var(--text-muted); }
.access-role-item > :not(summary) { margin-left:1rem; margin-right:1rem; }
.access-role-item > .access-permission-form { display:grid; grid-template-columns:repeat(auto-fit, minmax(15rem, 1fr)); gap:.55rem 1rem; padding-bottom:1rem; }
.access-permission-form > button { justify-self:start; grid-column:1 / -1; }
.access-role-assignment { display:flex; align-items:center; justify-content:flex-end; gap:.5rem; }
.access-role-assignment .form-control { min-width:12rem; }
.sticky-actions { position:sticky; bottom:0; background:var(--surface, #fff); border-top:1px solid var(--border-color); padding:1rem; margin-top:1.25rem; z-index:5; }
.navigation-manager { overflow: visible; }
.navigation-manager .form-hint { display:block; margin-top:.2rem; }
.navigation-tree-list { list-style:none; margin:0; padding:0; min-height:8px; }
.navigation-tree-children { margin-left:2.1rem; border-left:1px solid var(--border-color); padding-left:.75rem; }
.navigation-tree-row { display:flex; align-items:center; gap:.75rem; min-height:58px; padding:.65rem 1rem; border-bottom:1px solid var(--border-color); background:var(--surface, #fff); }
.navigation-tree-item.is-dragging { opacity:.45; }
.navigation-tree-item.navigation-drop-target > .navigation-tree-row, .navigation-tree-list.navigation-drop-target { box-shadow:inset 0 2px 0 var(--primary, #111827); }
.navigation-drag-handle { color:var(--text-muted); font-size:1.2rem; cursor:grab; user-select:none; }
.navigation-tree-copy { min-width:0; flex:1; display:grid; gap:2px; }
.navigation-tree-copy small { overflow:hidden; color:var(--text-muted); text-overflow:ellipsis; white-space:nowrap; }
.sidebar-account { position:relative; }
.sidebar-account summary, .topbar-account summary { list-style:none; cursor:pointer; }
.sidebar-account summary::-webkit-details-marker, .topbar-account summary::-webkit-details-marker { display:none; }
.sidebar-account-summary { display:flex; align-items:center; gap:.7rem; width:100%; padding:.75rem 0 0; border-top:1px solid var(--border-color); }
.sidebar-avatar { display:inline-grid; width:2.5rem; height:2.5rem; flex:0 0 2.5rem; place-items:center; border-radius:50%; background:#161616; color:#fff; font-weight:700; }
.sidebar-account-copy { display:grid; min-width:0; flex:1; gap:2px; }
.sidebar-account-copy strong, .sidebar-account-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-account-copy small { color:var(--text-muted); }
.sidebar-account-chevron { color:var(--text-muted); }
.sidebar-account[open] .sidebar-account-chevron { transform:rotate(180deg); }
.sidebar-account-menu { display:grid; gap:.2rem; margin-top:.75rem; padding:.65rem; border:1px solid var(--border-color); border-radius:9px; background:var(--surface, #fff); box-shadow:0 10px 24px rgba(15,23,42,.12); }
.workspace-menu-label { padding:.2rem .35rem .35rem; color:var(--text-muted); font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.workspace-switch-item, .account-menu-link { display:flex; width:100%; align-items:center; justify-content:space-between; gap:.5rem; padding:.5rem .55rem; border:0; border-radius:6px; background:transparent; color:inherit; font:inherit; text-align:left; text-decoration:none; cursor:pointer; }
.workspace-switch-item:hover, .account-menu-link:hover { background:var(--background, #f3f4f6); }
.workspace-switch-item.is-current { font-weight:700; }
.workspace-more { margin:.15rem 0; }
.workspace-more summary { padding:.45rem .55rem; color:var(--text-muted); cursor:pointer; }
.account-menu-divider { height:1px; margin:.3rem 0; background:var(--border-color); }
.account-menu-signout { color:#b42318; }
.topbar-account { position:relative; }
.topbar-account > summary { display:flex; align-items:center; gap:.3rem; padding:.25rem .35rem; border-radius:8px; }
.topbar-account > summary:hover { background:var(--background, #f3f4f6); }
.topbar-account-menu { position:absolute; right:0; top:calc(100% + .6rem); z-index:40; display:grid; min-width:12rem; padding:.45rem; border:1px solid var(--border-color); border-radius:12px; background:var(--surface, #fff); box-shadow:0 14px 32px rgba(15,23,42,.16); }
.topbar-account-menu a, .topbar-account-menu button { display:block; width:100%; padding:.6rem .7rem; border:0; border-radius:7px; background:transparent; color:inherit; font:inherit; text-align:left; text-decoration:none; cursor:pointer; }
.topbar-account-menu a:hover, .topbar-account-menu button:hover { background:var(--background, #f3f4f6); }
.topbar-account-menu button { color:#b42318; }
.topbar-notifications { position:relative; }
.topbar-notifications summary { position:relative; display:grid; width:2.5rem; height:2.5rem; place-items:center; list-style:none; cursor:pointer; border-radius:8px; font-size:1.1rem; }
.ui-icon { width:1.2rem; height:1.2rem; color:#111; } [data-theme="dark"] .ui-icon { color:#f5f5f5; }
.mfa-enroll-wrap { max-width:48rem; }.mfa-enroll-grid { display:grid; grid-template-columns:220px minmax(0,1fr); gap:2rem; align-items:start; margin-top:1.5rem; }.mfa-qr { display:grid; place-items:center; padding:.75rem; background:#fff; border:1px solid var(--border-color); border-radius:12px; }.mfa-qr img { display:block; max-width:100%; height:auto; } @media (max-width:640px) { .mfa-enroll-grid { grid-template-columns:1fr; }.mfa-qr { width:max-content; } }
.topbar-notifications summary::-webkit-details-marker { display:none; }
.topbar-notifications summary:hover { background:var(--background, #f3f4f6); }
.notification-badge { position:absolute; top:.1rem; right:.05rem; min-width:1.05rem; padding:0 .2rem; border-radius:99px; background:#b42318; color:#fff; font-size:.65rem; font-weight:700; text-align:center; }
.notification-dropdown { position:absolute; top:calc(100% + .6rem); right:0; z-index:45; width:min(23rem, calc(100vw - 2rem)); border:1px solid var(--border-color); border-radius:12px; background:var(--surface, #fff); box-shadow:0 14px 32px rgba(15,23,42,.16); overflow:hidden; }
.notification-dropdown-header { display:flex; align-items:center; justify-content:space-between; padding:.75rem .9rem; border-bottom:1px solid var(--border-color); }
.notification-dropdown-header button { border:0; background:transparent; color:var(--primary, #111827); font:inherit; font-size:.8rem; cursor:pointer; }
.notification-dropdown-item { display:grid; width:100%; gap:.2rem; padding:.7rem .9rem; border:0; border-bottom:1px solid var(--border-color); background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.notification-dropdown-item:hover, .notification-dropdown-item.is-unread { background:var(--background, #f3f4f6); }
.notification-dropdown-item span, .notification-dropdown-item small, .notification-empty { color:var(--text-muted); font-size:.8rem; }
.notification-empty { padding:.9rem; margin:0; }.notification-view-all { display:block; padding:.7rem .9rem; color:inherit; font-size:.85rem; text-align:center; text-decoration:none; }
.notification-list-row { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:1rem; border-bottom:1px solid var(--border-color); }.notification-list-row p { margin:.3rem 0; }.notification-list-row small { color:var(--text-muted); }.notification-list-row.is-unread { background:var(--background, #f3f4f6); }
.audit-detail-grid { display:grid; gap:0; margin-bottom:1.5rem; }.audit-detail-row { display:grid; grid-template-columns:9rem minmax(0,1fr); gap:1rem; padding:.8rem 0; border-bottom:1px solid var(--border-color); }.audit-detail-row > span { color:var(--text-muted); font-weight:600; }.audit-detail-row code { overflow-wrap:anywhere; }.audit-change-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin-bottom:1.5rem; }.audit-change-grid h4 { margin:.2rem 0 .5rem; color:var(--text-muted); font-size:.9rem; }.audit-json { max-height:24rem; overflow:auto; margin:0; padding:1rem; border-radius:8px; background:var(--background,#f3f4f6); color:var(--text-main); font:500 .78rem/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; overflow-wrap:anywhere; } @media (max-width:640px) { .audit-detail-row { grid-template-columns:1fr; gap:.25rem; }.audit-change-grid { grid-template-columns:1fr; } }
.announcement-banner { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; padding:1rem 1.1rem; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-surface-alt); }.announcement-banner p { margin:.35rem 0 0; }.announcement-actions { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }.announcement-modal { position:fixed; inset:0; z-index:1200; display:grid; place-items:center; padding:1rem; background:rgba(15,23,42,.5); }.announcement-modal-panel { width:min(34rem,100%); padding:1.5rem; border-radius:14px; background:var(--surface,#fff); box-shadow:0 20px 45px rgba(15,23,42,.28); }.announcement-modal-panel h2 { margin:0 0 .8rem; }.announcement-modal-panel p { white-space:pre-wrap; }.announcement-modal-panel .announcement-actions { justify-content:flex-end; margin-top:1.5rem; } @media(max-width:640px){.announcement-banner{display:block}.announcement-banner .announcement-actions{margin-top:1rem}}
.nav-group { margin:0; }
.nav-group > summary { list-style:none; }
.nav-group > summary::-webkit-details-marker { display:none; }
.nav-group-chevron { margin-left:auto; color:var(--text-muted); transition:transform .15s ease; }
.nav-group[open] .nav-group-chevron { transform:rotate(180deg); }
.nav-group-children { margin-left:1.35rem; border-left:1px solid var(--border-color); }
.nav-group[open] > .nav-group-children { max-height:1000px; overflow:visible; }
.nav-group-children .nav-item { padding-left:1rem; }
.auth-recovery-actions { display:flex; flex-wrap:wrap; gap:.65rem; }
.error-page { display:grid; min-height:100vh; place-items:center; margin:0; padding:1.5rem; background:var(--bg-page,#f8fafc); color:var(--text-primary,#111827); }
.error-card { width:min(32rem,100%); padding:2rem; border:1px solid var(--border-color,#e5e7eb); border-radius:16px; background:var(--surface,#fff); box-shadow:0 16px 40px rgba(15,23,42,.12); text-align:center; }
.error-code { display:inline-block; padding:.32rem .65rem; border-radius:999px; background:#fef2f2; color:#b42318; font-size:.78rem; font-weight:800; letter-spacing:.08em; }
.error-card h1 { margin:.9rem 0 .55rem; font-size:1.65rem; }.error-card p { margin:0; color:var(--text-muted,#667085); line-height:1.6; }.error-actions { display:flex; justify-content:center; gap:.7rem; margin-top:1.5rem; }
@media (max-width: 960px) { .user-edit-grid { grid-template-columns:1fr; } .permission-panel { position:static; max-height:none; } .permission-list { max-height:32rem; } }
@media (max-width: 1180px) { .ag-list-header { flex-wrap:wrap; } .ag-table-header-tools { width:100%; margin-left:0; } }
@media (max-width: 640px) { .page-heading, .workspace-assignment { display:flex; flex-direction:column; } .form-grid, .security-options { grid-template-columns:1fr; } .form-grid-full, .security-options .form-hint { grid-column:auto; } .navigation-tree-row { gap:.45rem; padding:.55rem .65rem; } .navigation-tree-row .status-pill, .navigation-tree-row .table-actions .btn-danger { display:none; } .navigation-tree-children { margin-left:1.1rem; padding-left:.45rem; } }
@media (max-width: 640px) { .dashboard-overview { padding:1rem 0; } }
@media (max-width: 760px) { .content-wrapper { padding: 16px; } .sidebar-close-btn { display:grid; place-items:center; } .sidebar.open, .sidebar.is-open { transform:translateX(0); } .sidebar-backdrop { display:none; } body.sidebar-visible .sidebar-backdrop { display:block; } .ag-table-header-tools, .ag-table-filter-form { width: 100%; margin-left: 0; justify-content: stretch; } .ag-table-search, .ag-table-filter-form > .ag-table-search { flex: 1 1 100%; } }

@media (max-width: 1180px) {
    .ag-table-filter-form { flex-wrap: wrap; justify-content: flex-start; }
    .ag-table-actions { flex-wrap: wrap; }
}

@media (max-width: 760px) {
    .news-list-page { min-width: 0; overflow-x: clip; }
    .news-list-page .dt-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-list-page .dt-stat-item { min-width: 0; margin: 0; padding: 14px; border-bottom: 1px solid var(--border-color); }
    .news-list-page .dt-stat-item:nth-child(even) { border-right: 0; }
    .news-list-page .dt-stat-item:last-child { grid-column: 1 / -1; border-bottom: 0; }
    .news-list-table .ag-list-header { display: grid; grid-template-columns: 1fr; align-items: stretch; }
    .news-list-table .ag-table-header-main,
    .news-list-table .ag-table-header-tools { width: 100%; min-width: 0; }
    .news-list-table .tabs { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
    .news-list-table .tab-item { flex: 0 0 auto; padding-inline: 14px; }
    .news-list-table .ag-table-header-tools { display: grid; gap: 10px; }
    .news-list-table .ag-table-filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .news-list-table .ag-table-filter-form > .ag-table-search { grid-column: 1 / -1; width: 100%; min-width: 0; max-width: none; }
    .news-list-table .ag-table-filter-form > .form-control { width: 100%; min-width: 0; }
    .news-list-table .ag-table-filter-form > button { width: 100%; min-height: 40px; }
    .news-list-table .ag-table-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; overscroll-behavior-inline: contain; scrollbar-width: thin; }
    .news-list-table .ag-table-actions > * { flex: 0 0 auto; }
    .news-list-table .table-responsive { overflow: visible; }
    .news-list-table #newsTable,
    .news-list-table #newsTable tbody { display: block; width: 100% !important; }
    .news-list-table #newsTable thead { display: none; }
    .news-list-table #newsTable tbody { padding: 10px; background: var(--bg-surface-alt); }
    .news-list-table #newsTable tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; margin-bottom: 10px; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-surface); }
    .news-list-table #newsTable tr:last-child { margin-bottom: 0; }
    .news-list-table #newsTable td { display: grid; min-width: 0; gap: 4px; padding: 0; border: 0; overflow-wrap: anywhere; }
    .news-list-table #newsTable td::before { content: attr(data-label); color: var(--text-muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
    .news-list-table #newsTable td:first-child,
    .news-list-table #newsTable td:last-child { grid-column: 1 / -1; }
    .news-list-table #newsTable td.ag-empty-state { grid-column: 1 / -1; padding: 20px; }
    .news-list-table #newsTable td.ag-empty-state::before { content: none; }
    .news-list-table #newsTable .table-actions { justify-content: flex-start; }
    .news-list-table .ag-list-footer { padding: 12px 14px; }
}

@media (max-width: 420px) {
    .content-wrapper { padding: 10px; }
    .news-list-page .dt-stat-sub { display: none; }
    .news-list-table .ag-table-filter-form { grid-template-columns: 1fr; }
    .news-list-table .ag-table-filter-form > .ag-table-search { grid-column: auto; }
    .news-list-table #newsTable tr { grid-template-columns: 1fr; }
    .news-list-table #newsTable td:first-child,
    .news-list-table #newsTable td:last-child { grid-column: auto; }
}
@media (min-width: 769px) { .sidebar.collapsed .nav-item { position:relative; overflow:visible; } .sidebar.collapsed .nav-item .nav-icon { display:inline-flex !important; align-items:center; justify-content:center; width:100%; } .sidebar.collapsed .nav-item .nav-label-text { display:none !important; } .sidebar.collapsed .nav-item[data-nav-label]::after { content:attr(data-nav-label); position:absolute; left:calc(100% + .65rem); top:50%; z-index:80; width:max-content; max-width:14rem; transform:translateY(-50%); padding:.55rem .8rem; border-radius:.6rem; background:#111; color:#fff; box-shadow:0 .45rem 1.2rem rgba(0,0,0,.18); font-size:.85rem; font-weight:600; opacity:0; pointer-events:none; transition:opacity .12s ease; } .sidebar.collapsed .nav-item[data-nav-label]:hover::after { opacity:1; } .sidebar.collapsed .sidebar-account-summary { justify-content:center; padding-top:.75rem; } .sidebar.collapsed .sidebar-account-summary > :not(.sidebar-avatar) { display:none; } .sidebar.collapsed .sidebar-account-menu { display:none; } }

/* Shared list toolbar: only keyword/date are primary; publication actions stay separate. */
.ag-data-table-card .ag-list-header { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; }
.ag-data-table-card .ag-table-header-main,
.ag-data-table-card .ag-table-header-tools { width:100%; min-width:0; margin:0; }
.ag-data-table-card .ag-table-header-tools { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; }
.ag-data-table-card .tabs { width:100%; min-width:0; overflow-x:auto; scrollbar-width:thin; }
.ag-data-table-card .tab-item { flex:0 0 auto; }
.ag-data-table-card .ag-table-filter-form { display:flex; flex:1 1 480px; flex-wrap:wrap; align-items:flex-start; justify-content:flex-start; min-width:0; }
.ag-data-table-card .ag-table-filter-form > .ag-table-search { flex:1 1 210px; width:auto; max-width:360px; min-width:170px; }
.ag-data-table-card .ag-date-range { flex:0 1 220px; min-width:170px; }
.ag-data-table-card .ag-date-range .form-control { width:100%; min-height:36px; cursor:pointer; }
.ag-data-table-card .ag-filter-submit { flex:0 0 auto; }
.ag-data-table-card .ag-advanced-filters { flex:0 0 auto; position:relative; }
.ag-data-table-card .ag-advanced-filters > summary { display:inline-flex; align-items:center; min-height:36px; cursor:pointer; list-style:none; }
.ag-data-table-card .ag-advanced-filters > summary::-webkit-details-marker { display:none; }
.ag-data-table-card .ag-advanced-filters[open] > summary { border-color:var(--primary); color:var(--primary); }
.ag-data-table-card .ag-advanced-filter-fields { position:absolute; top:calc(100% + 8px); left:0; z-index:30; display:grid; grid-template-columns:repeat(2,minmax(140px,1fr)); gap:8px; width:min(420px,calc(100vw - 32px)); padding:14px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-surface); box-shadow:0 12px 32px rgba(15,23,42,.14); }
.ag-data-table-card .ag-advanced-filter-fields > .form-control { width:100%; min-width:0; }
.ag-data-table-card .ag-advanced-filter-fields > button { grid-column:1 / -1; }
.ag-data-table-card .ag-table-actions { max-width:100%; overflow-x:auto; scrollbar-width:thin; }
.ag-date-preset-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; padding:10px; border-top:1px solid var(--border-color); }
.ag-date-preset-list button { padding:7px 8px; border:0; border-radius:6px; background:transparent; color:var(--text-main); font:inherit; font-size:12px; cursor:pointer; text-align:left; }
.ag-date-preset-list button:hover { background:var(--bg-surface-alt); }
.flatpickr-calendar.ag-range-calendar { box-shadow:0 12px 32px rgba(15,23,42,.18); }
@media (max-width:760px) {
    .ag-data-table-card .ag-table-filter-form { display:grid; grid-template-columns:minmax(0,1fr) auto; width:100%; flex-basis:100%; }
    .ag-data-table-card .ag-table-filter-form > .ag-table-search { grid-column:1 / -1; width:100%; max-width:none; }
    .ag-data-table-card .ag-date-range { grid-column:1 / -1; width:100%; }
    .ag-data-table-card .ag-filter-submit { grid-column:1; }
    .ag-data-table-card .ag-advanced-filters { grid-column:2; }
    .ag-data-table-card .ag-advanced-filter-fields { left:auto; right:0; }
    .ag-data-table-card .ag-table-actions { width:100%; }
}
@media (max-width:420px) {
    .ag-data-table-card .ag-advanced-filter-fields { grid-template-columns:1fr; }
    .ag-date-preset-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* ═══ Accent + standard list table (matches the reference HR directory) ═══ */
:root { --accent:#0f6b4e; --accent-hover:#0b563f; --accent-soft:#e7f2ed; --accent-ink:#0f6b4e; }
[data-theme="dark"] { --accent:#4ade80; --accent-hover:#86efac; --accent-soft:rgba(74,222,128,.14); --accent-ink:#86efac; }
.ag-dt { border-radius:16px; overflow:hidden; padding:0; }
.ag-dt-top { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 20px; border-bottom:1px solid var(--border-color); min-height:62px; }
.ag-dt-top-main { min-width:0; align-self:stretch; display:flex; align-items:center; }
.ag-dt-top .card-title { margin:0; font-size:1rem; }
.ag-dt .tabs { display:flex; gap:4px; border:0; margin:0; align-self:stretch; }
.ag-dt .tab-item { position:relative; display:flex; align-items:center; padding:0 16px; border:0; border-radius:0; background:transparent; color:var(--text-muted); font-weight:600; font-size:.9rem; text-decoration:none; }
.ag-dt .tab-item:hover { color:var(--text-main); background:transparent; }
.ag-dt .tab-item.active { color:var(--accent-ink); background:transparent; }
.ag-dt .tab-item.active::after { content:''; position:absolute; left:12px; right:12px; bottom:-1px; height:3px; border-radius:3px 3px 0 0; background:var(--accent); }
.ag-dt .ag-table-actions .btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; border-radius:10px; padding:.6rem 1.05rem; font-weight:600; }
.ag-dt .ag-table-actions .btn-primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.ag-dt-toolbar { display:flex; align-items:center; gap:10px; padding:14px 20px; border-bottom:1px solid var(--border-color); flex-wrap:wrap; }
.ag-dt-toolbar .form-control { height:42px; border-radius:10px; font-size:.9rem; }
.ag-dt-toolbar .ag-table-search { position:relative; flex:0 1 330px; min-width:200px; max-width:none; }
.ag-dt-toolbar .ag-table-search > svg { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.ag-dt-toolbar .ag-table-search .form-control { width:100%; padding-left:38px; }
.ag-dt-toolbar .ag-dt-filter { flex:0 0 auto; width:auto; min-width:150px; }
.ag-dt-toolbar .ag-date-range .form-control { width:190px; }
.ag-dt-csv { display:inline-flex; align-items:center; gap:7px; height:42px; padding:0 14px; border-radius:10px; font-weight:600; }
.ag-dt-rows { display:flex; align-items:center; gap:8px; margin-left:auto; color:var(--text-muted); font-size:.85rem; }
.ag-dt-rows .form-control { width:auto; min-width:76px; }
.ag-dt .table thead th { padding:14px 20px; background:var(--bg-surface-alt); font-size:.72rem; letter-spacing:.08em; }
.ag-dt .table tbody td { padding:15px 20px; font-size:.88rem; }
.ag-dt .table tbody tr:hover td { background:var(--bg-surface-alt); }
.ag-dt .table .text-right { text-align:right; }
.ag-sort { display:inline-flex; align-items:center; gap:6px; color:inherit; text-decoration:none; }
.ag-sort:hover, .ag-sort.is-active { color:var(--text-main); }
.ag-sort-icon { font-size:.8rem; opacity:.55; }
.ag-sort.is-active .ag-sort-icon { opacity:1; color:var(--accent-ink); }
.ag-dt .ag-list-footer { padding:14px 20px; border-top:1px solid var(--border-color); }
.ag-dt .ag-pagination { margin-top:0; }
.ag-dt .ag-pagination-summary { font-size:.88rem; }
.dt-pagination { display:flex; align-items:center; gap:8px; }
.ag-pagination a.dt-page-btn { min-width:38px; height:38px; display:inline-grid; place-items:center; padding:0; border-radius:10px; font-size:1.1rem; background:var(--bg-surface); }
.ag-pagination a.dt-page-btn:hover { background:var(--bg-surface-alt); }
.dt-page-status { min-width:46px; text-align:center; font-weight:600; font-size:.88rem; color:var(--text-main); }
/* row building blocks for the first column and the trailing action */
.ag-cell-primary { display:flex; align-items:center; gap:12px; min-width:0; }
.ag-cell-avatar { display:inline-grid; place-items:center; width:40px; height:40px; flex:0 0 40px; border-radius:12px; background:var(--accent-soft); color:var(--accent-ink); font-weight:700; font-size:.85rem; }
.ag-cell-title { display:block; font-weight:650; color:var(--text-main); text-decoration:none; }
a.ag-cell-title:hover { color:var(--accent-ink); }
.ag-cell-sub { display:block; margin-top:2px; font-size:.78rem; color:var(--text-muted); }
.ag-row-link { display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-surface); color:var(--text-main); font-weight:600; font-size:.85rem; text-decoration:none; white-space:nowrap; }
.ag-row-link:hover { background:var(--bg-surface-alt); }
.ag-row-actions { display:inline-block; position:relative; }
.ag-row-actions > summary { display:flex; align-items:center; justify-content:center; width:40px; height:40px; border:1px solid var(--border-color); border-radius:9px; background:var(--bg-surface, #fff); color:var(--text-main); font-size:1.35rem; line-height:1; cursor:pointer; list-style:none; }
.ag-row-actions > summary::-webkit-details-marker { display:none; }
.ag-row-actions > summary:hover, .ag-row-actions > summary:focus-visible { background:var(--bg-surface-alt, #f3f4f6); outline-offset:2px; }
.ag-row-actions-menu { position:fixed; z-index:110; min-width:190px; padding:6px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-surface, #fff); box-shadow:0 12px 28px rgba(15,23,42,.18); }
.ag-row-actions-menu button, .ag-row-actions-menu a { display:block; width:100%; padding:9px 11px; border:0; border-radius:6px; background:transparent; color:var(--text-main); text-align:left; font:inherit; cursor:pointer; text-decoration:none; }
.ag-row-actions-menu button:hover, .ag-row-actions-menu a:hover, .ag-row-actions-menu button:focus-visible { background:var(--bg-surface-alt, #f3f4f6); }
.ag-row-actions-menu form { margin:0; }
.ag-row-actions-menu .ag-danger-action { color:#9f2d24; }
.ag-credit-action { margin-top:4px; padding:3px 0; border:0; background:none; color:var(--primary, #007a72); text-align:left; font:inherit; font-size:.82rem; font-weight:600; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.ag-tax-policy { margin-bottom:1rem; }
.ag-tax-policy > summary { cursor:pointer; list-style:none; }
.ag-tax-policy > summary::-webkit-details-marker { display:none; }
.erp-group-shortcut { margin-left:1.75rem; padding-left:.75rem; font-size:.85rem; opacity:.9; }
.erp-header-context { display:flex; flex-direction:column; align-items:flex-start; gap:0; line-height:1.25; min-width:0; }
.erp-header-title { font-size:1.05rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.erp-header-workspace { font-size:.78rem; font-weight:500; color:var(--text-muted,#6b7280); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.erp-header-workspace-switch { font-size:.78rem; white-space:nowrap; text-decoration:underline; text-underline-offset:2px; }
@media (max-width:640px) {
  .ag-customer-list .table-responsive { overflow:visible; }
  .ag-customer-list .table, .ag-customer-list tbody { display:block; width:100%; min-width:0; }
  .ag-customer-list thead { display:none; }
  .ag-customer-list tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 12px; padding:14px; border-bottom:1px solid var(--border-color); }
  .ag-customer-list .table tbody td { display:block; padding:0; border:0; min-width:0; overflow-wrap:anywhere; }
  .ag-customer-list tbody td:nth-child(1) { grid-column:1; font-size:.78rem; color:var(--text-muted); }
  .ag-customer-list tbody td:nth-child(2) { grid-column:1 / -1; font-weight:650; }
  .ag-customer-list tbody td:nth-child(3), .ag-customer-list tbody td:nth-child(4) { display:none; }
  .ag-customer-list tbody td:nth-child(5) { grid-column:1; grid-row:3; }
  .ag-customer-list tbody td:nth-child(6) { grid-column:2; grid-row:3; align-self:start; }
}
@media (max-width:1024px) {
  .ag-bank-table .table th:nth-child(2), .ag-bank-table .table td:nth-child(2) { display:none; }
  .ag-tax-table .table th:nth-child(3), .ag-tax-table .table td:nth-child(3),
  .ag-tax-table .table th:nth-child(5), .ag-tax-table .table td:nth-child(5),
  .ag-tax-table .table th:nth-child(6), .ag-tax-table .table td:nth-child(6),
  .ag-tax-table .table th:nth-child(7), .ag-tax-table .table td:nth-child(7) { display:none; }
}
@media (max-width:640px) {
  .ag-bank-table .table-responsive { overflow:visible; }
  .ag-bank-table .table, .ag-bank-table tbody { display:block; width:100%; min-width:0; }
  .ag-bank-table thead { display:none; }
  .ag-bank-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 12px; padding:14px; border-bottom:1px solid var(--border-color); }
  .ag-bank-table .table tbody td { display:block; padding:0; border:0; min-width:0; overflow-wrap:anywhere; }
  .ag-bank-table tbody td:nth-child(1) { grid-column:1 / -1; }
  .ag-bank-table tbody td:nth-child(3) { grid-column:1; }
  .ag-bank-table tbody td:nth-child(4) { grid-column:1; font-size:.83rem; color:var(--text-muted); }
  .ag-bank-table tbody td:nth-child(5) { grid-column:2; grid-row:2; }
  .ag-bank-table tbody td:nth-child(6) { grid-column:2; grid-row:3; }
}
@media (max-width:640px) {
  .ag-tax-table .table-responsive { overflow:visible; }
  .ag-tax-table .table, .ag-tax-table tbody { display:block; width:100%; min-width:0; }
  .ag-tax-table thead { display:none; }
  .ag-tax-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 12px; padding:14px; border-bottom:1px solid var(--border-color); }
  .ag-tax-table .table tbody td { display:block; padding:0; border:0; min-width:0; overflow-wrap:anywhere; }
  .ag-tax-table tbody td:nth-child(1) { grid-column:1; font-weight:650; }
  .ag-tax-table tbody td:nth-child(2) { grid-column:1 / -1; }
  .ag-tax-table tbody td:nth-child(4) { grid-column:1; }
  .ag-tax-table tbody td:nth-child(8) { grid-column:2; grid-row:3; }
  .ag-tax-table tbody td:nth-child(9) { grid-column:1; }
  .ag-tax-table tbody td:nth-child(10) { grid-column:2; grid-row:4; }
}
.ag-dt .status-pill.status-active { background:var(--accent-soft); color:var(--accent-ink); }
@media (max-width:760px) { .ag-dt-top { padding:0 12px; overflow-x:auto; } .ag-dt-toolbar { padding:12px; } .ag-dt-toolbar .ag-table-search { flex:1 1 100%; max-width:none; } .ag-dt-rows { margin-left:0; } .ag-dt .table thead th, .ag-dt .table tbody td { padding:12px; } }

/* ═══ Sidebar: grouped sections, icon rows, soft-green active state ═══ */
.sidebar-panel-nav { padding:14px 12px; }
.sidebar-panel-nav .nav-group { margin:0 0 6px; }
.sidebar-panel-nav .nav-group > summary.nav-group-label { display:flex; align-items:center; gap:8px; padding:14px 12px 8px; margin:0; background:transparent; border-radius:8px; color:var(--text-muted); font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; cursor:pointer; user-select:none; }
.sidebar-panel-nav .nav-group > summary.nav-group-label:hover { color:var(--text-main); }
.sidebar-panel-nav .nav-group > summary.nav-group-label .nav-icon { display:none; }
.sidebar-panel-nav .nav-group > summary.nav-group-label .nav-group-chevron { margin-left:auto; display:grid; place-items:center; transform:rotate(-90deg); transition:transform .15s ease; opacity:.7; }
.sidebar-panel-nav .nav-group[open] > summary.nav-group-label .nav-group-chevron { transform:rotate(0); }
.sidebar-panel-nav .nav-group-children { margin:0; padding:0; border:0; max-height:none; overflow:visible; }
.sidebar-panel-nav .nav-item, .sidebar-panel-nav .nav-group-children .nav-item { display:flex; align-items:center; gap:12px; margin:0 0 2px; padding:11px 12px; border:0; border-radius:12px; background:transparent; color:var(--text-main); font-size:.92rem; font-weight:500; }
.sidebar-panel-nav .nav-group-children .nav-item::before, .sidebar-panel-nav .nav-group-children .nav-item::after { display:none; }
.sidebar-panel-nav .nav-item .nav-icon { display:inline-grid; place-items:center; width:22px; flex:0 0 22px; color:var(--text-muted); }
.sidebar-panel-nav .nav-item:hover { background:var(--bg-surface-alt); }
.sidebar-panel-nav .nav-item:hover .nav-icon { color:var(--text-main); }
.sidebar-panel-nav .nav-item.active, .sidebar-panel-nav .nav-group-children .nav-item.active { background:var(--accent-soft); color:var(--accent-ink); font-weight:650; border:0; }
.sidebar-panel-nav .nav-item.active .nav-icon { color:var(--accent-ink); }
.nav-badge { margin-left:auto; min-width:22px; padding:2px 8px; border-radius:999px; background:#fdf1d8; color:#8a5a00; font-size:.72rem; font-weight:700; text-align:center; }
.sidebar.collapsed .nav-group > summary.nav-group-label .nav-label-text, .sidebar.collapsed .nav-group > summary.nav-group-label .nav-group-chevron { display:none; }
.sidebar.collapsed .nav-group > summary.nav-group-label { padding:6px 0; border-top:1px solid var(--border-color); margin-top:6px; }
.sidebar.collapsed .nav-group-children { display:block !important; position:static; width:auto; box-shadow:none; background:transparent; border:0; }

.ag-dt .ag-list-footer { display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.ag-dt .ag-list-footer .ag-dt-rows { margin-left:0; }
.ag-dt .ag-list-footer .ag-pagination { flex:1; }
.ag-drawer-body .form-row { display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:16px; }
.ag-drawer-body .form-label { display:grid; gap:6px; font-weight:600; font-size:.88rem; margin-bottom:16px; }
.ag-drawer-body .form-row .form-label { margin-bottom:0; }
.ag-drawer-body .form-actions { bottom:-24px; }
.ag-drawer-panel { width:min(480px,100vw); max-width:100vw; min-width:0; box-sizing:border-box; }
.ag-drawer-body { min-width:0; overflow-x:auto; }
.ag-drawer-body .form-row, .ag-drawer-body .form-label { min-width:0; }
.ag-drawer-body .form-control { max-width:100%; min-width:0; box-sizing:border-box; }
.ag-drawer-header { background:var(--bg-surface,#fff); }

/* Embedded (iframe) pages inside the wide detail drawer */
.ag-embed .sidebar, .ag-embed .topbar, .ag-embed .sidebar-backdrop { display:none !important; }
.ag-embed .main-content { margin-left:0 !important; padding-left:0 !important; width:100% !important; }
.ag-embed .content-wrapper { padding:20px 24px; }
.ag-drawer-wide .ag-drawer-panel { width:min(980px,100%); overflow:hidden; display:flex; flex-direction:column; }
.ag-drawer-wide .ag-drawer-header { position:static; }
.ag-drawer-wide iframe { flex:1; width:100%; border:0; background:var(--bg-surface,#fff); }

/* Bank reconciliation */
.ag-recon-bank { max-width:320px; margin-bottom:16px; }
.ag-recon-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; margin-bottom:16px; }
.ag-recon-stats > div { background:var(--bg-surface,#fff); border:1px solid var(--border-color); border-radius:12px; padding:14px 18px; display:grid; gap:2px; }
.ag-recon-stats span { color:var(--text-muted); font-size:.8rem; }
.ag-recon-stats strong { font-size:1.05rem; }
.ag-recon-stats small { color:var(--text-muted); }
.ag-recon-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ag-recon-actions form { display:flex; gap:6px; align-items:center; margin:0; }
.ag-recon-actions .form-select { min-width:150px; }
.ag-inline-form { display:inline-block; margin:0; }

/* Supporting documents panel */
.ag-attachments { list-style:none; margin:0 0 12px; padding:0; display:grid; gap:8px; }
.ag-attachments li { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:8px 0; border-bottom:1px solid var(--border-color); }
.ag-attachments li form { margin:0 0 0 auto; }
.ag-attach-form { display:flex; gap:8px; align-items:center; margin-top:8px; }
.ag-attach-form .form-control { max-width:360px; }

h1.topbar-title { margin:0; }

.topbar-lang{display:inline-flex;gap:2px;margin-right:8px;font-size:12px;font-weight:600}
.topbar-lang a{padding:4px 8px;border-radius:6px;color:inherit;text-decoration:none;opacity:.65}
.topbar-lang a[aria-current]{opacity:1;background:rgba(22,163,74,.14)}

/* Report filter bars: one tidy row (wraps on small screens) instead of stacked controls. */
.card-header { flex-wrap: wrap; gap: 12px; }
.card-header > form[method="get"] { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-left: auto; }
.card-header > form[method="get"] .form-label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; }
.card-header > form[method="get"] .form-control { width: auto; min-width: 140px; margin: 0; }

/* Branch context selector (header) */
.branch-ctx { position:relative; margin-left:.75rem; }
.branch-ctx > summary { list-style:none; display:inline-flex; align-items:center; gap:.4rem; max-width:220px; padding:.4rem .75rem; border:1px solid var(--border,#e3e7ee); border-radius:8px; cursor:pointer; font-size:.88rem; font-weight:600; background:var(--surface,#fff); }
.branch-ctx > summary::-webkit-details-marker { display:none; }
.branch-ctx-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.branch-ctx-panel { position:absolute; left:0; top:calc(100% + 6px); z-index:60; width:280px; max-height:60vh; overflow:auto; padding:.5rem; background:var(--surface,#fff); border:1px solid var(--border,#e3e7ee); border-radius:10px; box-shadow:0 10px 28px rgba(15,23,42,.16); }
.branch-ctx-search { width:100%; margin-bottom:.4rem; padding:.4rem .6rem; border:1px solid var(--border,#e3e7ee); border-radius:7px; font:inherit; background:transparent; color:inherit; }
.branch-tree, .branch-tree ul { list-style:none; margin:0; padding:0; }
.branch-tree ul { margin-left:1.1rem; padding-left:.4rem; border-left:1px solid var(--border,#e3e7ee); }
.branch-root.is-closed > ul { display:none; }
.branch-root.is-closed .branch-chev { transform:rotate(-90deg); }
.branch-root-row { display:flex; align-items:center; }
.branch-chev { border:0; background:transparent; width:22px; cursor:pointer; color:inherit; transition:transform .15s; }
.branch-opt { display:block; flex:1; text-align:left; border:0; background:transparent; padding:.4rem .5rem; border-radius:6px; font:inherit; color:inherit; cursor:pointer; }
.branch-opt:hover { background:rgba(120,130,150,.12); } .branch-opt.is-on { background:#e8f0fe; color:#1f4aa8; font-weight:600; } .branch-opt.is-static { cursor:default; }
.branch-opt small { color:var(--text-muted,#667085); margin-left:.3rem; }
@media (max-width:640px) { .branch-ctx { position:static; margin-left:.4rem; } .branch-ctx > summary { max-width:130px; } .branch-ctx-panel { position:fixed; left:12px; right:12px; top:64px; width:auto; } }

/* Mode gelap: --primary menjadi putih, jadi teks tombol utama harus gelap (sebelumnya putih di atas putih = tak terbaca); tombol hijau aksen juga memakai teks gelap. */
[data-theme="dark"] .btn-primary { color: #111; }
[data-theme="dark"] .ag-dt .ag-table-actions .btn-primary { color: #052e16; }
/* Dark mode contrast: partly-delivered pill and quantity +/- buttons (measured 2.5 and 1.0 before). */
[data-theme="dark"] .status-warning { color:var(--warning); }
[data-theme="dark"] .so2-step-btn { background:var(--bg-surface-alt); color:var(--text-main); border-color:var(--border-color); }

/* Financial statements (P&L, balance sheet): one column of accounts, group headers, totals, result rows */
.rpt-table { width:100%; border-collapse:collapse; }
.rpt-table thead th { padding:12px 16px; background:var(--bg-surface-alt); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; }
.rpt-table td { padding:9px 16px; font-size:.88rem; border-bottom:1px solid var(--border, rgba(128,128,128,.18)); }
.rpt-table .rpt-num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.rpt-table .rpt-sec td { background:var(--bg-surface-alt); font-weight:700; text-transform:uppercase; font-size:.78rem; letter-spacing:.06em; padding-top:12px; }
.rpt-table .rpt-group td { font-weight:600; }
.rpt-table .rpt-zero td { color:var(--text-muted); }
.rpt-table .rpt-total td { font-weight:700; border-top:2px solid var(--border, rgba(128,128,128,.35)); }
.rpt-table .rpt-result td { font-weight:700; background:rgba(99,102,241,.10); }
.rpt-table .rpt-final td { background:rgba(99,102,241,.20); font-size:.95rem; }
.rpt-table tr.rpt-row:hover td { background:var(--bg-surface-alt); }
/* Plain statements that use <th> rows as section headers / totals */
.rpt-table td:not(:first-child), .rpt-table tbody th:not(:first-child), .rpt-table tfoot th:not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.rpt-table tbody th, .rpt-table tfoot th { padding:10px 16px; font-size:.88rem; background:var(--bg-surface-alt); border-top:1px solid var(--border, rgba(128,128,128,.35)); }
.rpt-table tbody th[colspan] { text-transform:uppercase; font-size:.78rem; letter-spacing:.06em; text-align:left; }
.rpt-table thead th:not(:first-child) { text-align:right; }
/* Text columns on statements whose other columns are numbers: rpt-t2 = first two, rpt-t3 = first three */
.rpt-table tbody th:first-child, .rpt-table tfoot th:first-child { text-align:left; }
.rpt-t2 tbody td:nth-child(-n+2), .rpt-t2 thead tr:first-child th:nth-child(-n+2) { text-align:left; }
.rpt-t3 tbody td:nth-child(-n+3), .rpt-t3 thead th:nth-child(-n+3) { text-align:left; }
