/* Nếp. Web 2.2 — Sáng / Tối / Theo hệ thống.
   Không sử dụng filter đảo màu: giữ nguyên dấu trạng thái và khả năng đọc. */
:root{color-scheme:light}
html[data-theme="dark"]{
 color-scheme:dark;
 --bg:#101b17;--paper:#182820;--white:#1d3127;
 --ink:#eaf2ec;--ink2:#dce9df;--muted:#aec2b4;--light:#92a99a;
 --line:#30463a;--green:#33785c;--leaf:#8bc9a3;--mint:#233d2d;
 --sand:#41392e;--rust:#d29d7a;--risk:#ffb6a6;--riskbg:#412b2b;
 --amber:#f3c58c;--amberbg:#413626;--blue:#a2cede;--bluebg:#263e48;
 --v18-border:#32483b;--v18-cream:#101b17;--v18-quiet:#23392d;
 --v18-moss:#33785c;--v18-warn:#ecad87;--shadow:0 5px 20px rgba(0,0,0,.16);
 background:var(--bg);color:var(--ink)
}
html[data-theme="dark"] body,html[data-theme="dark"] .app,html[data-theme="dark"] .page{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] :is(.top,.nep-desktop-sidebar,.nep-desktop-rail){background:#15241c;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .top{background:rgba(21,36,28,.97)}
html[data-theme="dark"] :is(.card,.stat,.v18-panel,.v18-tasklist,.v18-report-metric,.v18-project,.v17-card,.v17-metric,.v17-project,.v17-stage-tile,.v17-partner-row,.v17-mini-link,.cal-day-card,.cal4-agenda,.cal4-selected-notice,.cal15-daybox,.h15-minirow,.h15-focus,.h15-next,.opp16-card,.nd-upcoming-item,.auth-panel,.cloud-controls,.sheet,.sheet-body,.sheet-card){background:var(--paper);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] :is(.v17-stage-tile.active,.cal15-daybox.selected,.v17-day.today){background:#244b39;border-color:#70b68c}
html[data-theme="dark"] :is(.demo,.v17-sample,.h15-sample,.v18-preview-tag,.v18-report-callout,.v18-home-alert){background:#3b3025;border-color:#63513c;color:#f4d4aa}
html[data-theme="dark"] :is(.v17-empty,.v18-empty,.v18-card-muted,.nd-railtop,.v18-next-copy small,.v18-reportline-main small,.v17-head p,.v17-muted,.nd-upcoming-item small,.subtle,.muted,.lead){color:var(--muted)}
html[data-theme="dark"] :is(.v17-empty,.v18-empty){background:#1a2a21}
html[data-theme="dark"] :is(.btn:not(.primary),.chip:not(.active),.v18-filterline button:not(.active),.v17-outline-btn,.v18-rowbtn,.v18-partner-action button,.v17-soft-btn,.v18-shortcuts button,.v18-action,.v17-textbtn,.v18-mini-control,.link-btn,.nd-rail-footerlink,.nd-rail-action,.nav){border-color:var(--line);color:var(--ink);background:#20352a}
html[data-theme="dark"] :is(.btn.soft,.pill,.v18-kpi-btn,.v17-tag,.v18-tag,.v17-home-shortcuts button,.h15-tools button){background:#254633;color:#b8e4c3;border-color:#345c44}
html[data-theme="dark"] :is(.pill.risk,.pill.a,.v18-tag.paused){background:#492d2b;color:#ffb3a4}
html[data-theme="dark"] :is(.pill.amber,.pill.s){background:#453825;color:#f5c58b}
html[data-theme="dark"] :is(.pill.blue,.pill.c){background:#273b45;color:#b2d6e3}
html[data-theme="dark"] :is(.pill.dim,.v18-tag.done){background:#303932;color:#bcc7b9}
html[data-theme="dark"] :is(.focus,.h15-focus,.v18-focus){background:#275c46;color:#fff;border-color:#3d775c}
html[data-theme="dark"] :is(.focus,.h15-focus,.v18-focus) :is(.btn,.pill){color:#15392b}
html[data-theme="dark"] :is(.v18-focus-controls button,.h15-focus button){border-color:#7bb292}
html[data-theme="dark"] :is(.cal15-item.block,.v17-month-item,.cal15-weekbar .block){background:#2e684d;color:#f2fff5}
html[data-theme="dark"] :is(.cal15-item.meeting,.cal15-weekbar .meeting,.v17-month-item.meeting){background:#32586d;color:#f0faff}
html[data-theme="dark"] :is(.cal15-item.deadline,.cal15-weekbar .deadline,.v17-month-item.task){background:#774735;color:#fff3e8}
html[data-theme="dark"] :is(.cal4-event.block,.cal-agenda-item.block){background:#305d48;color:#f3fcf5}
html[data-theme="dark"] :is(.cal4-event.meeting,.cal-agenda-item.meeting){background:#304d64;color:#eaf7ff}
html[data-theme="dark"] :is(.cal4-hour,.cal4-hour-label,.cal-month-head,.cal15-weekrow,.cal15-weekdate,.cal15-weekbar,.cal4-day-title,.cal4-timeline-meta){border-color:var(--line);color:var(--ink2)}
html[data-theme="dark"] :is(.cal4-timegrid,.cal4-time-scroll,.cal-month-scroll,.cal15-monthwrap,.v17-day,.cal4-timegrid .cal4-hour){background:#17261e}
html[data-theme="dark"] :is(.cal4-slot,.cal15-weekrow,.cal-agenda-item,.cal4-datepick){background:transparent;border-color:var(--line);color:var(--ink2)}
html[data-theme="dark"] :is(.v18-task,.v18-attn-row,.v18-next-item,.v18-reportline,.v17-line,.v17-partner-mini,.h15-block){border-color:var(--line)}
html[data-theme="dark"] :is(.v18-task-title,.v18-reportline-main strong,.v18-attn-text b,.v18-next-copy strong,.v17-stage-tile strong,.v17-partner-head strong,.v17-metric strong,.v17-line b,.v17-head h2,.v17-head h3,.v17-card h3,.v18-page-title,.h15-title,.nd-page-heading strong){color:var(--ink)}
html[data-theme="dark"] :is(.nd-brand strong,.nd-page-heading strong,.nd-snapshot strong,.nd-rail-focus strong,.nd-rail-heading b){color:#d6f1df}
html[data-theme="dark"] :is(.nd-nav button,.nd-footer,.nd-navlabel,.nd-brand small,.nd-page-heading span,.nd-railtop){color:#a9c0b1}
html[data-theme="dark"] .nd-nav button.active{background:#2a4b38;color:#edf7ef}
html[data-theme="dark"] .nd-snapshot-divider{background:var(--line)}
html[data-theme="dark"] .nd-rail-focus{background:#20392b;border-color:#365441}
html[data-theme="dark"] .nd-rail-focus small{color:#a9c4ac}
html[data-theme="dark"] :is(.nep-quick-capture,.v18-capture.nep-quick-capture){background:#1c3025;border-color:#42644e;box-shadow:none}
html[data-theme="dark"] .nep-quick-capture:hover{background:#223b2d;border-color:#75a788}
html[data-theme="dark"] .nep-quick-capture:focus-within{background:#223b2d;border-color:#95cda2;box-shadow:0 0 0 3px rgba(110,191,144,.20)}
html[data-theme="dark"] .nep-quick-capture input{color:var(--ink)!important}
html[data-theme="dark"] .nep-quick-capture input::placeholder{color:#a7bbaa}
html[data-theme="dark"] .nep-quick-icon{color:#9dccab}
html[data-theme="dark"] .nep-quick-capture .nep-capture-key{background:#254231;border-color:#48634f;color:#c4d4c6}
html[data-theme="dark"] .nep-quick-capture button{background:#327153;border-color:#327153;color:#fff}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:#203429;color:var(--ink);border-color:#46604f}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea)::placeholder{color:#91a597}
html[data-theme="dark"] :is(.auth-gate,.sheet-overlay){background:rgba(11,21,16,.94)}
html[data-theme="dark"] .auth-panel{background:#1b2e23;border-color:#35503c;box-shadow:0 16px 44px rgba(0,0,0,.35)}
html[data-theme="dark"] .auth-brand h1{color:#e4f6e9}
html[data-theme="dark"] :is(.auth-brand p,.auth-note,.auth-form p,#auth-setup p){color:#b2c5b6}
html[data-theme="dark"] :is(.auth-form h2,#auth-setup h2,.auth-form label){color:#e6f1e8}
html[data-theme="dark"] .auth-form input{background:#18281f;border-color:#446b52;color:#fff}
html[data-theme="dark"] .auth-note{border-color:var(--line)}
html[data-theme="dark"] .cloud-controls{background:#1b2d23;border-color:var(--line)}
html[data-theme="dark"] .cloud-controls button{color:#d5eede}
html[data-theme="dark"] .cloud-controls button:hover{background:#294533}
html[data-theme="dark"] .cloud-indicator{background:#244030;border-color:#4c7857;color:#e4f4e7}
html[data-theme="dark"] :is(.nav,.nav15){background:#1b2d23;border-color:var(--line)}
html[data-theme="dark"] :is(.nav button:not(.nav15-plus),.nav15 button:not(.nav15-plus)){color:#aabeb0}
html[data-theme="dark"] :is(.nav button.active,.nav15 button.active){color:#d6ffe3}
html[data-theme="dark"] :is(.nep-desktop-rail p,.nd-upcoming-list p){color:var(--muted)}
html[data-theme="dark"] :is(.sheet,.modal,.sheet-body){background:#192b22;color:var(--ink)}
html[data-theme="dark"] :is(.v17-switcher,.tabs,.tabbar){background:#24372a}
html[data-theme="dark"] :is(.v17-switcher button.active,.tabs .active){background:#365b43;color:#fff}
html[data-theme="dark"] :is(.v18-report-callout,.v17-stat-slim){background:#2d3829;color:#e5d9bb;border-color:#4c5644}
html[data-theme="dark"] .nep-theme-trigger{color:#dceee1;background:#254132;border:1px solid #3d6248}
/* Theme menu is always next to the toggle, not a permanent third column. */
.nep-theme-menu[hidden]{display:none!important}
.nep-theme-menu{position:fixed;z-index:2000;min-width:210px;max-width:calc(100vw - 16px);padding:7px;border-radius:14px;background:#fffefa;border:1px solid #dce5d9;box-shadow:0 14px 35px #132f2230;color:#253b30}
.nep-theme-caption{font-size:10px;letter-spacing:1.15px;font-weight:800;color:#73877a;padding:9px 11px 6px}
.nep-theme-menu button{width:100%;min-height:43px;display:flex;align-items:center;gap:9px;text-align:left;background:transparent;border:0;border-radius:9px;padding:6px 10px;color:inherit;font-size:13px}
.nep-theme-menu button:hover,.nep-theme-menu button:focus-visible{background:#edf3eb}
.nep-theme-menu button span{display:inline-flex;align-items:center;justify-content:center;width:21px;font-size:18px}
.nep-theme-menu button i{margin-left:auto;font-style:normal;visibility:hidden;color:#327456;font-weight:800}
.nep-theme-menu button[aria-checked="true"]{font-weight:800;background:#e9f2e7}
.nep-theme-menu button[aria-checked="true"] i{visibility:visible}
html[data-theme="dark"] .nep-theme-menu{background:#1d3226;border-color:#45634d;color:#e0eee3;box-shadow:0 16px 40px #0007}
html[data-theme="dark"] .nep-theme-caption{color:#a5bbaa}
html[data-theme="dark"] .nep-theme-menu button:hover,html[data-theme="dark"] .nep-theme-menu button:focus-visible{background:#2d4a37}
html[data-theme="dark"] .nep-theme-menu button[aria-checked="true"]{background:#315640}
html[data-theme="dark"] .nep-theme-menu button i{color:#9bdbad}
@media(prefers-reduced-motion:reduce){.nep-theme-menu button{transition:none}}

/* Explicit high-contrast overrides for legacy desktop cards */
html[data-theme="dark"] .nep-quick-capture--top,
html[data-theme="dark"] .nep-quick-capture--inbox,
html[data-theme="dark"] .v18-capture.nep-quick-capture{background-color:#1c3025!important;border-color:#456d53!important;color:#e4f2e8!important}
html[data-theme="dark"] .nd-nav button.active{background-color:#2b4b38!important;color:#e8f5eb!important}
html[data-theme="dark"] .nd-tip{background-color:#23392b!important;border-color:#38513f!important}
html[data-theme="dark"] .nd-tip b{color:#e7f3e7!important}
html[data-theme="dark"] .nd-tip small{color:#b4c6b8!important}
html[data-theme="dark"] .nd-upcoming-list p{background-color:#21382a!important;color:#adc4b1!important}
html[data-theme="dark"] .nd-rail-action{background-color:#21372b;color:#dcebe0;border-color:#395440}
html[data-theme="dark"] .v18-titlebar h1{color:#e9f2eb}

/* Readable compact controls in CRM, report, calendar and dark forms */
html[data-theme="dark"] .h15-search{background:#1e3227;border-color:#456950}
html[data-theme="dark"] .h15-search svg{color:#b5d1be}
html[data-theme="dark"] .crm16-actions button,
html[data-theme="dark"] .h15-crm-acts button{background:#263f30;color:#b7e2c5}
html[data-theme="dark"] .crm16-ticketbar button,
html[data-theme="dark"] .v17-textbtn,
html[data-theme="dark"] .v18-panel-head button,
html[data-theme="dark"] .link-btn{color:#a6dfbc}
html[data-theme="dark"] .v17-switcher button{color:#b8cbbd}
html[data-theme="dark"] .v17-stage-label{color:#c2d6c8}
html[data-theme="dark"] :is(.h15-crmrow,.crm16-card,.opp16-card){background:#1a2c22;border-color:#344b3b}
html[data-theme="dark"] .v18-rowbtn{color:#d9efdf}
@media(min-width:1024px){
 .nd-page-heading{flex-basis:232px;min-width:204px}
 .nd-page-heading strong{font-size:17px}
}
@media(min-width:1024px) and (max-width:1200px){
 .nd-page-heading{flex-basis:214px;min-width:187px}
}
