/* Domestic UI refresh: task-first layout, scoped to the existing application. */
:root {
    --primary: #0080cc;
    --primary-dark: #006ba9;
    --primary-light: #329ddd;
    --primary-glow: rgba(0, 128, 204, .10);
    --border-focus: #0080cc;
    --border-glow: rgba(0, 128, 204, .2);
    --bg: #f7fafc;
    --bg-subtle: #edf5fa;
    --border: #e4ebf0;
    --shadow-sm: 0 1px 4px rgba(18, 45, 68, .04);
    --shadow: 0 4px 16px rgba(18, 45, 68, .07);
}

.sidebar { width: 236px; }
.main-content { margin-left: 236px; }
.sidebar-header { padding: 21px 18px 17px; text-align: left; }
.sidebar-header img { height: 48px; margin: 0 0 5px; }
.sidebar-header h3 { font-size: 11px; letter-spacing: .8px; }
.nav-menu { padding: 13px 9px; }
.nav-item, .nav-parent, .nav-child { border-radius: 7px; }
.nav-item:hover, .nav-parent:hover, .nav-group.expanded .nav-parent { background: #edf5fb; color: var(--primary); }
.nav-item.active, .nav-child.active { background: #e9f4fc; color: var(--primary); border-left-color: var(--primary); }
.top-bar { padding: 0 26px; }
.search-box input { border-radius: 9px; background: #f6f9fb; }
.content-area { padding: 26px; }
.page-header { margin-bottom: 21px; }
.page-header h1 { font-size: 26px; letter-spacing: -.4px; }
.page-header p { line-height: 1.6; }
.dashboard-card, .stat-card { border-radius: 10px; }
.stat-card { padding: 17px 19px; }
.stat-card-value { font-size: 27px; }
.stats-grid { gap: 14px; margin-bottom: 20px; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.mobile-nav-toggle, .mobile-nav-close { display: none; }

/* Academic library */
.academic-hero { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:30px 34px; border-radius:14px; background:linear-gradient(115deg,#edf8fe,#f9fcff); border:1px solid #dceef8; margin-bottom:22px; }
.academic-eyebrow { color:var(--primary); font-size:12px; font-weight:700; letter-spacing:.12em; }
.academic-hero h2 { font-size:22px; margin:10px 0 7px; color:var(--text); }
.academic-hero p { color:var(--text-light); margin:0; font-size:14px; }
.academic-total { display:flex; flex-direction:column; align-items:center; font-size:30px; font-weight:750; color:var(--primary); white-space:nowrap; }
.academic-total small { font-size:12px; font-weight:400; color:var(--text-light); }
.academic-collections { display:grid; grid-template-columns:repeat(auto-fill,minmax(185px,1fr)); gap:12px; margin-bottom:22px; }
.academic-collection { text-align:left; display:flex; flex-direction:column; gap:7px; border:1px solid var(--border); border-radius:10px; background:#fff; padding:17px 19px; color:var(--text); cursor:pointer; box-shadow:var(--shadow-sm); }
.academic-collection:hover,.academic-collection.selected { border-color:var(--primary); background:#f4fbff; }
.academic-collection small { color:var(--primary); font-weight:700; }
.academic-collection strong { font-size:15px; }
.academic-collection span { font-size:12px; color:var(--text-light); }
.academic-filter { display:flex; flex-wrap:wrap; align-items:end; gap:10px; padding:18px; background:#fff; border:1px solid var(--border); border-radius:11px; margin-bottom:23px; }
.academic-filter label { display:flex; flex-direction:column; gap:6px; color:var(--text-light); font-size:12px; min-width:110px; }
.academic-filter .academic-search { flex:2 1 220px; }
.academic-filter input,.academic-filter select { min-height:38px; max-width:100%; border:1px solid var(--border); border-radius:7px; background:#fff; padding:7px 9px; color:var(--text); font:inherit; font-size:13px; }
.academic-filter input:focus,.academic-filter select:focus { outline:2px solid var(--border-glow); border-color:var(--primary); }
.academic-filter .btn { min-height:38px; }
.academic-results-heading { display:flex; align-items:baseline; gap:12px; margin:0 0 12px; }
.academic-results-heading h3 { font-size:17px; margin:0; }
.academic-results-heading span { color:var(--text-light); font-size:12px; }
.academic-resource-list { display:grid; gap:9px; }
.academic-resource { display:flex; align-items:center; gap:15px; width:100%; text-align:left; border:1px solid var(--border); border-radius:9px; background:#fff; padding:15px 17px; cursor:pointer; color:var(--text); }
.academic-resource:hover { border-color:#94cdec; box-shadow:var(--shadow); }
.academic-kind { flex:0 0 44px; text-align:center; padding:8px 0; border-radius:6px; background:#eaf5fc; color:#0879bd; font-size:11px; font-weight:700; }
.academic-kind.is-video { background:#edf3ff; color:#536bc3; }
.academic-resource-copy { display:grid; gap:5px; min-width:0; flex:1; }
.academic-resource-copy strong { font-size:14px; overflow-wrap:anywhere; }
.academic-resource-copy small { color:var(--text-light); font-size:12px; }
.academic-resource-copy em { font-size:11px; font-style:normal; color:var(--primary); background:#f1f8fc; border-radius:4px; padding:3px 6px; margin-right:5px; }
.academic-open { color:var(--primary); font-size:12px; white-space:nowrap; }
.academic-pagination { display:flex; justify-content:center; align-items:center; gap:15px; margin:19px 0; font-size:12px; color:var(--text-light); }
.academic-pagination button { border:1px solid var(--border); background:#fff; border-radius:6px; padding:7px 11px; cursor:pointer; color:var(--primary); }
.academic-pagination button:disabled { opacity:.45; cursor:default; }
.academic-empty,.academic-error,.academic-loading { padding:28px; text-align:center; background:#fff; border:1px solid var(--border); border-radius:9px; color:var(--text-light); }
.academic-error { color:#a33f39; }
.academic-detail { margin:25px 0; padding:22px; border:1px solid var(--border); border-radius:11px; background:#fff; }
.academic-detail[hidden] { display:none; }
.academic-detail-top { display:flex; justify-content:space-between; gap:20px; }
.academic-detail-top small { color:var(--primary); }
.academic-detail-top h3 { margin:8px 0; overflow-wrap:anywhere; }
.academic-detail-top p { margin:0 0 15px; color:var(--text-light); font-size:13px; }
.academic-close { border:0; background:transparent; font-size:26px; color:var(--text-light); cursor:pointer; align-self:start; }
.academic-viewer { width:100%; background:#17232d; border-radius:7px; overflow:hidden; }
.academic-viewer iframe { display:block; width:100%; height:min(74vh,820px); border:0; background:#fff; }
.academic-viewer video { display:block; width:100%; max-height:74vh; }
.academic-detail-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:15px; }
.academic-related { margin-top:24px; border-top:1px solid var(--border); padding-top:18px; }
.academic-related h4 { margin:0 0 12px; font-size:15px; }
.academic-related > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.academic-related button { display:grid; grid-template-columns:auto 1fr; gap:3px 8px; text-align:left; border:1px solid var(--border); border-radius:8px; background:#fafcfd; padding:11px; color:var(--text); cursor:pointer; }
.academic-related button:hover { border-color:var(--primary); }
.academic-related button span { color:var(--primary); font-size:11px; }
.academic-related button strong { font-size:12px; overflow-wrap:anywhere; }
.academic-related button small { grid-column:2; color:var(--text-light); }
@media(max-width:700px) {
    .academic-hero { padding:20px; align-items:flex-start; }
    .academic-hero h2 { font-size:18px; }
    .academic-total { font-size:22px; }
    .academic-filter { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .academic-filter .academic-search { grid-column:1/-1; }
    .academic-filter .btn { grid-column:1/-1; }
    .academic-resource { padding:13px; gap:10px; }
    .academic-open { display:none; }
    .academic-detail { padding:12px; }
    .academic-viewer iframe { height:66vh; }
    .academic-related > div { grid-template-columns:1fr; }
}

/* Dashboard */
.dashboard-priority-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 17px; margin-bottom: 22px; }
.dashboard-priority-grid .dashboard-card { margin-bottom: 0; padding: 20px; }
.dashboard-priority-grid h3 { font-size: 16px; margin: 0 0 13px; }
.dashboard-work-link, .dashboard-recent-row { display: flex; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.dashboard-work-link { gap: 13px; padding: 15px 5px; border-bottom: 1px solid var(--border); }
.dashboard-work-link:hover, .dashboard-recent-row:hover { background: #f6fbfe; }
.dashboard-work-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 9px; background: #e9f4fc; color: var(--primary); font-size: 24px; }
.dashboard-work-link > span:nth-child(2) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.dashboard-work-link strong, .dashboard-recent-copy strong { font-size: 14px; font-weight: 650; }
.dashboard-work-link small, .dashboard-recent-copy small { font-size: 12px; color: var(--text-light); }
.dashboard-work-arrow { color: var(--primary); font-size: 12px; white-space: nowrap; }
.dashboard-quick-title { margin: 19px 0 12px !important; }
.dashboard-quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dashboard-section-heading h3 { margin: 0 !important; }
.dashboard-section-heading button { color: var(--primary); border: 0; background: transparent; cursor: pointer; font-size: 13px; }
.dashboard-recent-row { gap: 12px; padding: 12px 3px; border-bottom: 1px solid var(--border); }
.dashboard-recent-row:last-child { border-bottom: 0; }
.dashboard-recent-date { display: grid; justify-items: center; width: 43px; flex: 0 0 43px; padding: 5px 0; border: 1px solid #dce9f3; border-radius: 7px; color: var(--primary); }
.dashboard-recent-date strong { font-size: 18px; line-height: 1.1; }
.dashboard-recent-date small { font-size: 11px; }
.dashboard-recent-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.dashboard-recent-copy strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dashboard-recent-empty { color: var(--text-light); padding: 18px 0; }
.dashboard-overview-heading { margin: 4px 0 12px; }
.dashboard-overview-heading h3 { font-size: 16px; }
.dashboard-overview-heading span { color: var(--text-light); font-size: 12px; }

/* Expert list */
#page-experts .action-bar { align-items: stretch; }
#page-experts .filter-group { flex: 1 1 380px; }
#page-experts .filter-group input { flex: 1 1 185px; }
#page-experts .btn-group { flex-wrap: wrap; }
#page-experts #expertsTableCard { padding: 0; overflow: hidden; }
.expert-list-count { padding: 13px 17px; color: var(--text-light); font-size: 12px; border-bottom: 1px solid var(--border); }
.expert-scroll-hint { display: none; float: right; color: var(--primary); }
#page-experts .experts-table { min-width: 730px !important; }
#page-experts .experts-table th, #page-experts .experts-table td { padding: 12px 13px; }
#page-experts .experts-table th:nth-child(1) { width: 75px; }
#page-experts .experts-table th:nth-child(2) { width: 78px; }
#page-experts .experts-table th:nth-child(3) { width: auto; }
#page-experts .experts-table th:nth-child(4) { width: 83px; }
#page-experts .experts-table th:nth-child(5) { width: 100px; }
#page-experts .experts-table th:nth-child(6) { width: 88px; }
#page-experts .experts-table th:nth-child(7) { width: 178px; }
#page-experts .experts-table .cell-clamp-2 { max-width: none; }

/* Approval workspace */
#page-meeting-approvals .page-header { padding-right: 230px; }
#page-meeting-approvals .page-header p { max-width: 740px; }
.approval-top-actions { display: flex; justify-content: flex-end; gap: 9px; margin: -61px 0 22px; min-height: 39px; }
.approval-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(315px, .85fr); min-height: 600px; background: #fff; border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-sm); overflow: hidden; }
.approval-list-panel { min-width: 0; padding: 0 16px 12px; }
.approval-tabs { display: flex; align-items: stretch; gap: 22px; height: 58px; border-bottom: 1px solid var(--border); }
.approval-tabs button { position: relative; border: 0; background: transparent; color: var(--text-light); font-size: 13px; cursor: pointer; white-space: nowrap; }
.approval-tabs button.active { color: var(--primary); font-weight: 700; }
.approval-tabs button.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 3px 3px 0 0; }
.approval-tabs span { margin-left: 3px; font-size: 12px; }
.approval-search-wrap { padding: 15px 0 13px; }
.approval-search-wrap input { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; background: #fbfdfe; }
.approval-search-wrap input:focus { outline: 2px solid var(--border-glow); border-color: var(--primary); }
.approval-list { display: grid; align-content: start; }
.approval-list-item { display: grid; grid-template-columns: 56px minmax(0,1fr) auto 12px; align-items: center; gap: 9px; width: 100%; padding: 17px 11px; border: 0; border-bottom: 1px solid var(--border); background: #fff; text-align: left; color: var(--text); cursor: pointer; }
.approval-list-item:hover { background: #f7fbfe; }
.approval-list-item.selected { background: #eaf5fd; border-radius: 7px; border-bottom-color: transparent; }
.approval-code { align-self: start; padding-top: 2px; color: #47677e; font-size: 12px; font-weight: 650; }
.approval-item-main { min-width: 0; }
.approval-item-main strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; line-height: 1.45; }
.approval-item-main small { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 9px; color: var(--text-light); font-size: 11px; }
.approval-status { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 20px; background: #e6f5ed; color: #178653; font-size: 11px; white-space: nowrap; font-weight: 650; }
.approval-status.complete { background: #edf3f7; color: #547085; }
.approval-item-arrow { color: #7190a5; font-size: 20px; }
.approval-list-count { padding: 15px 2px; color: var(--text-light); font-size: 12px; }
.approval-empty, .approval-detail-empty { padding: 48px 15px; text-align: center; color: var(--text-light); font-size: 13px; }
.approval-detail-panel { min-width: 0; padding: 22px 20px; border-left: 1px solid var(--border); }
.approval-detail-top { display: flex; gap: 10px; align-items: center; color: #517086; font-size: 12px; }
.approval-detail-panel h2 { margin: 11px 0 18px; font-size: 19px; line-height: 1.4; }
.approval-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.approval-detail-meta div { display: grid; gap: 4px; min-width: 0; }
.approval-detail-meta small { color: var(--text-light); font-size: 11px; }
.approval-detail-meta strong { font-size: 13px; overflow-wrap: anywhere; }
.approval-detail-section { padding: 19px 0 1px; border-bottom: 1px solid var(--border); }
.approval-detail-section h3 { margin-bottom: 13px; font-size: 13px; }
.approval-detail-section p { color: var(--text-light); font-size: 12px; line-height: 1.65; padding-bottom: 16px; }
.approval-timeline { list-style: none; padding: 0 0 2px; margin: 0; }
.approval-timeline li { position: relative; display: flex; align-items: flex-start; gap: 11px; min-height: 42px; padding-bottom: 13px; color: #7a8d9b; }
.approval-timeline li:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 15px; bottom: -1px; width: 1px; background: #d6e3eb; }
.approval-timeline-dot { position: relative; z-index: 1; display: block; width: 13px; height: 13px; flex: 0 0 13px; border: 2px solid #c8d7e2; border-radius: 50%; background: white; }
.approval-timeline li.done .approval-timeline-dot { border-color: var(--primary); background: var(--primary); }
.approval-timeline li.active .approval-timeline-dot { border-color: var(--primary); }
.approval-timeline li > span:last-child { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; width: 100%; }
.approval-timeline strong { font-size: 12px; color: var(--text-mid); }
.approval-timeline small { font-size: 11px; }
.approval-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 19px; }
.approval-detail-actions .btn { margin: 0 !important; }
.approval-detail-actions > span { display: block; width: 100%; }

/* Approval form */
#meetingApprovalModal .modal-content { max-width: 790px !important; }
.approval-form-heading { display: flex; align-items: center; gap: 9px; margin: 7px 0 15px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text); font-size: 15px; }
.approval-form-heading:first-child { border-top: 0; padding-top: 0; }
.approval-form-heading span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e8f4fc; color: var(--primary); font-size: 12px; }
.approval-form-hint { margin-bottom: 10px; color: var(--text-light); font-size: 12px; line-height: 1.6; }
#maApproverSearch { margin-bottom: 10px; }
.approval-approver-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 10px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.approval-approver-option { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 9px; border-radius: 6px; background: #f8fafc; cursor: pointer; font-size: 13px; }
.approval-approver-option:has(input:checked) { background: #e8f4fc; color: var(--primary-dark); }
.approval-approver-option[hidden] { display: none !important; }
.approval-approver-option input { width: auto !important; min-width: auto !important; margin: 0 !important; }
.approval-selected-approvers { margin-top: 9px; color: var(--text-light); font-size: 12px; line-height: 1.6; }
#meetingApprovalModal input[type=file]::file-selector-button { margin: 8px 10px 8px 0; padding: 7px 12px; border: 1px solid #bbd7e9; border-radius: 6px; background: #f1f8fd; color: var(--primary-dark); cursor: pointer; }

@media (max-width: 1180px) {
    .dashboard-priority-grid { grid-template-columns: 1fr; }
    .approval-shell { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
    .approval-shell { grid-template-columns: 1fr; }
    .approval-detail-panel { border-left: 0; border-top: 1px solid var(--border); }
    #page-meeting-approvals .page-header { padding-right: 0; }
    .approval-top-actions { margin: 0 0 15px; }
}
@media (max-width: 720px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
    .content-area { padding: 18px; }
}
@media (max-width: 600px) {
    .sidebar { display: none; position: fixed; width: min(290px, 85vw); height: 100vh; overflow-y: auto; z-index: 200; box-shadow: 10px 0 30px rgba(15, 35, 55, .16); }
    .sidebar.mobile-open { display: flex; }
    .mobile-nav-toggle, .mobile-nav-close { display: block; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 23px; }
    .mobile-nav-toggle { margin-right: 10px; }
    .mobile-nav-close { position: absolute; top: 16px; right: 16px; }
    .main-content { margin-left: 0; }
    .top-bar { padding: 0 12px; }
    .search-box { flex: 1; width: auto; min-width: 0; }
    .top-actions { gap: 5px; }
    .content-area { padding: 16px 12px; }
    .dashboard-priority-grid { gap: 12px; }
    .dashboard-priority-grid .dashboard-card { padding: 16px; }
    .dashboard-work-arrow { display: none; }
    .approval-list-panel { padding: 0 10px 10px; }
    .approval-tabs { gap: 17px; }
    .approval-list-item { grid-template-columns: 46px minmax(0,1fr) auto; gap: 7px; padding: 14px 7px; }
    .approval-item-arrow { display: none; }
    .approval-detail-panel { padding: 18px 14px; }
    .approval-approver-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    #page-experts .btn-group { width: 100%; }
    .expert-scroll-hint { display: inline; }
}
