/* Dashboard-only styling; existing module forms retain their styles. */
:root{--dh-surface:#f5f7fb;--dh-muted:#64748b;--dh-accent:#2563eb;--dh-soft:#edf3ff;--dh-line:#e5eaf2}
:root[data-theme="dark"]{--dh-surface:#121821;--dh-muted:#a5b1c4;--dh-accent:#82aaff;--dh-soft:#253858;--dh-line:#303b4d}
#mainDashboard{background:var(--dh-surface)}
#sidebar{width:220px;padding:26px 14px;border-color:var(--dh-line)}
#sidebar .sidebar-brand{border:0;margin-bottom:16px;padding:0 13px 18px}
#sidebar .sidebar-brand img{max-width:145px}
#sidebar .nav-group-label{letter-spacing:1.5px;font-size:10px;padding-top:12px}
#sidebar .nav-item{gap:11px;border-radius:8px;font-size:13px;padding:10px 12px;color:var(--dh-muted)}
#sidebar .nav-item.active{background:var(--dh-soft);color:var(--dh-accent);font-weight:600}
.dh-icon{width:19px;height:19px;flex-shrink:0;vertical-align:middle}
#topbar{min-height:72px;padding:16px 30px;gap:14px}
#topbar .topbar-welcome h1{font-size:14px;font-weight:600}#topbar .topbar-welcome p{font-size:11px;color:var(--dh-muted)}
#topbar .icon-btn{font-size:13px;min-width:38px;width:auto;padding:8px}
#topbar .topbar-icons{gap:7px;flex-wrap:wrap}
#dashboardMenu{display:none}
#mainColumn>main{padding:30px;min-width:0}
#homeView{display:block;max-width:1400px;margin:0 auto}
#homeView.hidden{display:none}
.dh-welcome{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:26px}
.dh-welcome h1{font-size:30px;line-height:1.2;letter-spacing:-1px;margin:0;font-weight:650}
#dashboardDate{color:var(--dh-muted);font-size:13px;margin:9px 0 0}
#dashboardMode{border:1px solid var(--dh-line);color:var(--dh-muted);font-size:11px;padding:5px 9px;border-radius:6px;white-space:nowrap}
#kpiRow{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;margin-bottom:28px}
#kpiRow .kpi-card{border-color:var(--dh-line);border-radius:14px;padding:21px 23px}
#kpiRow .kpi-label{color:var(--dh-muted);font-size:12px;font-weight:500}
#kpiRow .kpi-value{font-size:32px;font-weight:650;letter-spacing:-.8px;font-variant-numeric:tabular-nums;margin:11px 0 7px}
#kpiRow .kpi-note{font-size:12px;color:var(--dh-muted)}
.dh-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
#homeView .dh-heading h2{font-size:15px;color:var(--text);font-weight:600;margin:0}
.dh-text-button{color:var(--dh-accent);font:inherit;font-size:12px;background:none;border:0;padding:8px;cursor:pointer}
#tileContainer{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin-bottom:26px}
.dh-action{display:flex;align-items:center;gap:13px;padding:17px;border:1px solid var(--dh-line);border-radius:11px;background:var(--card);color:var(--text);text-align:left;cursor:pointer;min-height:78px}
.dh-action .dh-icon{color:var(--dh-accent);width:23px;height:23px}
.dh-action strong{font-size:13px;font-weight:600;display:block}
.dh-action small{font-size:11px;color:var(--dh-muted);display:block;margin-top:5px;line-height:1.4}
.dh-action:hover{border-color:var(--dh-accent);background:var(--dh-soft)}
.dh-action-primary{background:var(--dh-accent);border-color:var(--dh-accent);color:#fff}
.dh-action-primary .dh-icon,.dh-action-primary small{color:#fff}
.dh-action-primary:hover{background:var(--blue-dark);color:#fff}
:root[data-theme="dark"] .dh-action-primary,:root[data-theme="dark"] .dh-action-primary .dh-icon,:root[data-theme="dark"] .dh-action-primary small{color:#12223b}
.dh-columns{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(230px,1fr);gap:20px}
.dh-panel,#homeView aside#activityPanel{width:auto;min-width:0;padding:22px;border:1px solid var(--dh-line);border-radius:14px;background:var(--card)}
.dh-attention-row{display:flex;align-items:center;gap:13px;width:100%;padding:18px 0;text-align:left;border:0;border-top:1px solid var(--dh-line);background:transparent;color:var(--text);cursor:pointer}
.dh-attention-row>.dh-icon{color:var(--orange)}
.dh-attention-row>span:first-of-type{flex:1}
.dh-attention-row strong{display:block;font-size:13px;font-weight:600}.dh-attention-row small{display:block;font-size:12px;color:var(--dh-muted);margin-top:5px}
#attentionList,#activityList,.dh-empty{font-size:13px;color:var(--dh-muted);line-height:1.6}
.dh-activity-row{display:flex;gap:12px;padding:12px 0}.dh-activity-row>.dh-icon{color:var(--teal);margin-top:2px;width:17px}
.dh-activity-row strong{font-size:13px;color:var(--text);font-weight:500}.dh-activity-row p{margin:4px 0;font-size:12px}.dh-activity-row small{font-size:11px}
.dh-footer{border-top:1px solid var(--dh-line);margin-top:26px;padding-top:16px;color:var(--dh-muted);font-size:11px}
#quickActionsEditor{background:var(--card);border:1px solid var(--dh-line);border-radius:12px;padding:20px;margin-bottom:22px}
#quickActionsEditor[hidden]{display:none}#quickActionsEditor p{font-size:12px;color:var(--dh-muted);margin:0 0 14px}
#quickActionsChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;margin-bottom:18px}
.dh-choice{display:flex;align-items:center;gap:6px;min-height:40px}.dh-choice label{display:flex;align-items:center;gap:9px;flex:1;font-size:13px;cursor:pointer}.dh-choice input{accent-color:var(--dh-accent);width:17px;height:17px}
.dh-reorder{width:32px;height:32px;border:1px solid var(--dh-line);border-radius:6px;background:var(--card);color:var(--text);cursor:pointer}.dh-reorder:disabled{opacity:.35;cursor:default}
.dh-editor-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.dh-editor-actions span{font-size:12px;color:var(--dh-muted);margin-right:auto}
#quickActionsStatus{font-size:12px;color:var(--dh-muted);margin:8px 0}#quickActionsStatus:empty{display:none}
#mainDashboard button:focus-visible,#mainDashboard input:focus-visible{outline:2px solid var(--dh-accent);outline-offset:3px}
#demoNotice{border:1px solid var(--dh-line);border-radius:14px;background:var(--card);color:var(--text);padding:25px;max-width:420px;width:calc(100% - 32px)}#demoNotice::backdrop{background:#101b3480}#demoNotice h2{font-size:18px}#demoNotice p{font-size:14px;line-height:1.6;color:var(--dh-muted)}
@media(max-width:1100px){#sidebar{width:195px}#mainColumn>main{padding:24px}.dh-columns{grid-template-columns:1fr}#topbar{padding:14px 24px}.dh-welcome h1{font-size:26px}}
@media(max-width:900px){#sidebar{display:none}#dashboardMenu{display:block;min-width:42px;min-height:42px}#mainDashboard.dh-nav-open #sidebar{display:flex;width:100%;border-right:0;border-bottom:1px solid var(--dh-line)}#mainDashboard.dh-nav-open{flex-direction:column}#homeView aside#activityPanel{display:block}.avatar-name{display:none}}
@media(max-width:540px){#mainColumn>main{padding:18px}#topbar{padding:12px;flex-wrap:wrap}#topbar .topbar-welcome{flex:1}#topbar .topbar-icons{width:100%;justify-content:flex-end}.dh-welcome{align-items:flex-start;flex-direction:column;gap:12px}.dh-welcome h1{font-size:25px}#kpiRow{grid-template-columns:1fr;gap:10px}#kpiRow .kpi-card{padding:17px 20px}#tileContainer{grid-template-columns:1fr}.dh-panel,#homeView aside#activityPanel{padding:18px}#quickActionsChoices{grid-template-columns:1fr}.dh-reorder{width:40px;height:40px}}
@media(prefers-reduced-motion:reduce){#mainDashboard *{scroll-behavior:auto;transition:none}}

/* Keep account controls anchored while long module navigation scrolls. */
#sidebar{position:sticky;top:0;height:100vh;height:100dvh;align-self:flex-start;padding-bottom:16px}
#sidebar #navGroups{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:12px}
#sidebar .sidebar-brand,#sidebar #dashboardHomeLink{flex-shrink:0}
.dh-sidebar-footer{flex-shrink:0;margin-top:auto;padding-top:13px;border-top:1px solid var(--dh-line)}
.dh-sidebar-version{margin-top:10px;padding:0 12px;font-size:11px;color:var(--dh-muted);opacity:.65;text-align:center;letter-spacing:.2px}
.dh-sidebar-settings{display:flex;align-items:center;gap:11px;width:100%;border:0;background:transparent;color:var(--dh-muted);padding:10px 12px;border-radius:8px;text-align:left;font:inherit;font-size:13px;cursor:pointer;margin-bottom:8px}
.dh-sidebar-settings:hover{background:var(--dh-soft);color:var(--dh-accent)}
#sidebar .avatar-btn{width:100%;gap:11px;padding:10px 8px;border:0;text-align:left;min-height:64px}
#sidebar .avatar-circle{width:42px;height:42px;flex:0 0 42px;background:var(--dh-soft);color:var(--dh-accent);font-size:18px}
#sidebar .dh-profile-text{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
#sidebar .avatar-name{display:block;font-size:14px;font-weight:500;overflow-wrap:anywhere;line-height:1.3}
#sidebar #welcomeUserRole{display:block;font-size:12px;color:var(--dh-muted);line-height:1.35;overflow-wrap:anywhere}
#sidebar .dh-profile-chevron{font-size:14px;color:var(--dh-muted)}
#sidebar .avatar-dropdown{top:auto;bottom:calc(100% + 8px);left:0;right:0;min-width:0;width:100%;z-index:30}
@media(max-width:900px){#sidebar{position:static;height:auto;max-height:none;align-self:stretch}#sidebar #navGroups{overflow:visible}#sidebar .dh-sidebar-footer{margin-top:16px}}

/* Module links, Settings and profile now share one scrolling container. */
#sidebar .dh-sidebar-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;padding-bottom:8px}
#sidebar #navGroups{flex:0 0 auto;overflow:visible;padding-bottom:0}
#sidebar .dh-sidebar-footer{margin-top:auto;padding-top:14px}
#sidebar .avatar-dropdown{position:static;width:100%;margin:6px 0 0;box-shadow:none}
#sidebar .sidebar-brand{gap:10px;padding:0 4px 20px;align-items:center}
#sidebar .sidebar-brand img{width:48px;height:48px;max-width:48px;object-fit:contain;flex-shrink:0;background:#fff;border-radius:12px;padding:4px}
.dh-brand-name{font-size:14px;font-weight:650;line-height:1.3;color:var(--text)}
.dh-brand-name small{display:block;font-size:10px;font-weight:400;color:var(--dh-muted);margin-top:4px}
.login-card img.logo{width:100px;height:100px;object-fit:contain;background:#fff;border-radius:20px;padding:8px}
@media(max-width:900px){#sidebar .dh-sidebar-scroll{overflow:visible;flex:0 0 auto}#sidebar .dh-sidebar-footer{margin-top:16px}}

/* Module headings reuse the dashboard SVGs and their muted color. */
.module-view .orders-modal-icon{display:inline-flex;align-items:center;color:var(--dh-muted);flex-shrink:0}
.module-view .orders-modal-icon>.dh-icon,.module-view .module-icon-heading>.dh-icon{width:28px;height:28px;color:var(--dh-muted);flex-shrink:0}
.module-view .module-icon-heading{display:flex;align-items:center;gap:12px}
