/* Watakat CRM V7.4 – visual comfort only; no API, schema, or project state changes. */
:root[data-theme="soft"]{--theme-bg:#20262b;--theme-surface:#293139;--theme-surface2:#303a43;--theme-tile:#333e47;--theme-input:#252e36;--theme-border:#45515b;--theme-text:#e0e7eb;--theme-muted:#b6c3cb;--theme-accent:#a8c7e3;--theme-active:#3c4b57;--theme-primary:#485e71;--theme-shadow:rgba(0,0,0,.09);color-scheme:dark}
:root[data-theme="office"]{--theme-bg:#ecefeb;--theme-surface:#fafbf8;--theme-surface2:#f1f4ef;--theme-tile:#e9eee7;--theme-input:#fff;--theme-border:#ccd5cd;--theme-text:#293b39;--theme-muted:#5d716e;--theme-accent:#3b777c;--theme-active:#dbe9e5;--theme-primary:#497b80;--theme-shadow:rgba(19,44,38,.05);color-scheme:light}
/* Fix readability across ALL themes; retain existing layout and data behavior. */
.dashboard{font-size:14px;line-height:1.5}
.page-header h1{font-weight:700;letter-spacing:-.025em}
.table-wrap td,.table-wrap th{font-size:13px;line-height:1.5}
.table-wrap .project-name,.table-wrap .w-name{font-size:13px;font-weight:650}
.table-wrap .inline-date{font-size:12px;min-width:125px}
.table-wrap .inline-status{font-size:11px;font-weight:700;letter-spacing:.015em}
.sidebar .legend-item strong,.sidebar .mini-item strong{font-size:12px;line-height:1.45}
.sidebar .legend-item span,.sidebar .mini-item span{font-size:12px;line-height:1.5}
.table-meta,.w-quickbar,.month-info small{font-size:12px}
/* The muted palette is applied only to dark comfort surfaces; semantic status hues remain legible. */
:root[data-theme="soft"] .metric-card,:root[data-theme="soft"] .panel,:root[data-theme="soft"] .auth-card,:root[data-theme="soft"] .modal-card,
:root[data-theme="office"] .metric-card,:root[data-theme="office"] .panel,:root[data-theme="office"] .auth-card,:root[data-theme="office"] .modal-card{box-shadow:0 3px 12px var(--theme-shadow)!important}
:root[data-theme="soft"] .inline-status{color:color-mix(in srgb,var(--status-color) 72%,#e0e7eb)!important;background-color:color-mix(in srgb,var(--status-color) 14%,#2d3940)!important;border-color:color-mix(in srgb,var(--status-color) 27%,#35434a)!important}
:root[data-theme="office"] .inline-status{background-color:color-mix(in srgb,var(--status-color) 15%,white)!important;color:color-mix(in srgb,var(--status-color) 72%,black)!important;border-color:color-mix(in srgb,var(--status-color) 32%,transparent)!important}
:root[data-theme="soft"] .status-pill,:root[data-theme="soft"] .badge{filter:saturate(.82)}
:root[data-theme="soft"] .metric-value.green{color:#78d3ae}:root[data-theme="soft"] .metric-value.purple{color:#b6a7d7}
:root[data-theme="office"] .w-drawer-backdrop{background:rgba(24,43,39,.38)}
:root[data-theme="soft"] .table-wrap thead th,:root[data-theme="office"] .table-wrap thead th{background:var(--theme-surface2)!important}
:root[data-theme="soft"] .table-wrap tr:hover td,:root[data-theme="office"] .table-wrap tr:hover td{background:color-mix(in srgb,var(--theme-accent) 7%,transparent)!important}
:root[data-theme="soft"] .w-name,:root[data-theme="soft"] .project-name-link,:root[data-theme="office"] .w-name,:root[data-theme="office"] .project-name-link{color:var(--theme-text)!important}
:root[data-theme="soft"] .inline-date,:root[data-theme="office"] .inline-date{color:var(--theme-text)!important;background:var(--theme-input)!important;border-color:var(--theme-border)!important}
:root[data-theme="soft"] .inline-date::-webkit-calendar-picker-indicator{filter:invert(.75)}
:root[data-theme="office"] .inline-date::-webkit-calendar-picker-indicator{filter:none}
:root[data-theme="soft"] .w-quickbar input,:root[data-theme="office"] .w-quickbar input{accent-color:var(--theme-accent)}
:root[data-theme="soft"] .table-wrap,:root[data-theme="office"] .table-wrap{scrollbar-color:var(--theme-border) var(--theme-surface)}
/* Override fixed dark colors still present in original styles for both new presets. */
:root[data-theme="soft"] .w-nav,:root[data-theme="office"] .w-nav,
:root[data-theme="soft"] .tab-btn,:root[data-theme="office"] .tab-btn{color:var(--theme-muted)}
:root[data-theme="soft"] .w-nav.active,:root[data-theme="office"] .w-nav.active{color:var(--theme-text)!important}
:root[data-theme="soft"] .w-drawer-content,:root[data-theme="office"] .w-drawer-content{color:var(--theme-text)}
:root[data-theme="soft"] .w-form label,:root[data-theme="office"] .w-form label{color:var(--theme-muted)}
:root[data-theme="office"] .metric-value{color:var(--theme-text)}
:root[data-theme="office"] .metric-value.green{color:#197850}:root[data-theme="office"] .metric-value.purple{color:#7959a9}:root[data-theme="office"] .metric-value.coral{color:#966fb1}
/* Independent density preference; active theme does not change row count. */
:root[data-density="compact"] .table-wrap td,:root[data-density="compact"] .table-wrap th{padding:9px 10px}
:root[data-density="compact"] .table-wrap .inline-date{padding:5px 2px}
:root[data-density="compact"] .table-wrap .inline-status{padding-top:6px;padding-bottom:6px}
:root[data-density="comfort"] .table-wrap td,:root[data-density="comfort"] .table-wrap th{padding:17px 14px}
:root[data-density="comfort"] .table-wrap .inline-date{padding-top:10px;padding-bottom:10px}
:root[data-density="comfort"] .table-wrap .inline-status{padding-top:9px;padding-bottom:9px}
:root[data-density="comfort"] .table-wrap .project-name,:root[data-density="comfort"] .table-wrap .w-name{font-size:14px}
:root[data-density="comfort"] .table-wrap td{line-height:1.6}
/* Right sidebar can be hidden without affecting the table state. */
.main-grid.sidebar-collapsed{grid-template-columns:minmax(0,1fr)!important}
.main-grid.sidebar-collapsed #crmSidebar{display:none!important}
#sidebarToggle{white-space:nowrap}
/* Density selector near the existing theme menu. */
.density-select-wrap{position:relative}
.density-menu{position:absolute;right:0;top:calc(100% + 10px);min-width:180px;padding:7px;background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:12px;box-shadow:0 14px 35px var(--theme-shadow);z-index:131;display:grid;gap:3px}
.density-menu button{display:flex;align-items:center;gap:8px;justify-content:space-between;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--theme-text);font:inherit;font-size:12px;cursor:pointer}
.density-menu button:hover,.density-menu button.selected{background:var(--theme-active)}
.density-menu button span{visibility:hidden;color:var(--theme-accent)}.density-menu button.selected span{visibility:visible}
@media(max-width:720px){.header-right{flex-wrap:wrap;justify-content:flex-end}.density-select-wrap .btn{padding:9px}.table-wrap{max-height:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important}}

/* Watakat V7.5: compact KPI cards and streamlined table actions */
.metrics-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:11px;margin-bottom:13px}
.metric-card{min-height:79px!important;padding:12px 16px!important;display:flex;flex-direction:column;justify-content:center;gap:7px;cursor:pointer}
.metric-card:hover{filter:brightness(1.035)}
.metric-label{font-size:11px!important;letter-spacing:.018em;line-height:1.2}
.metric-value{font-size:28px!important;line-height:1.05}
.w-row-icon{border-radius:7px;padding:6px 8px;border:1px solid var(--theme-border,#334963);background:var(--theme-surface2,#21334a);color:var(--theme-text,#dde8fa);cursor:pointer;font-size:14px;font-weight:700;min-width:33px}
.w-row-icon:hover{filter:brightness(1.14)}
.w-budget-icon{color:#5fdbad}
.row-actions{display:flex;align-items:center;gap:5px;white-space:nowrap}
.w-export-menu{display:flex;flex-wrap:wrap;gap:8px;padding:10px;margin:0 0 9px;border:1px solid var(--theme-border,#334963);background:var(--theme-surface,#192638);border-radius:10px}
.w-export-menu.hidden{display:none}
.w-export-menu button{padding:9px 12px;border:1px solid var(--theme-border,#334963);border-radius:8px;background:var(--theme-surface2,#25354a);color:var(--theme-text,#eef4fd);cursor:pointer}
.w-cal-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.w-cal-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.w-cal-controls select{padding:8px;border:1px solid var(--theme-border,#34465c);color:var(--theme-text,#eaf1ff);background:var(--theme-surface2,#17283d);border-radius:8px}
.w-cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:16px 0}
.w-cal-weekday{text-align:center;font-size:12px;color:var(--theme-muted,#99a9c0);padding:7px}
.w-cal-day{display:flex;flex-direction:column;align-items:flex-start;gap:9px;min-height:68px;min-width:0;border:1px solid var(--theme-border,#30405a);border-radius:9px;padding:9px;background:var(--theme-surface2,#172438);color:var(--theme-text,#eef4ff);cursor:pointer}
.w-cal-day:not(.empty):hover,.w-cal-day.selected{border-color:#87acd9;filter:brightness(1.08)}
.w-cal-day.empty{visibility:hidden;pointer-events:none}
.w-cal-count{font-size:10px;font-weight:600;color:#efbd64;line-height:1.25}
@media(max-width:1100px){.metrics-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:660px){.metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card{min-height:72px!important}.w-cal-day{padding:4px;min-height:51px}.w-cal-count{font-size:9px}.w-cal-controls{gap:5px}}

/* V7.7 — polished, consistent profile management / trash views */
.manager-modal-card{width:min(820px,calc(100vw - 32px));max-height:min(88vh,820px);overflow:auto;border-radius:22px;padding:26px}
.manager-modal-card .modal-header{padding-bottom:10px;border-bottom:1px solid var(--stroke)}
.manager-description{font-size:13px;line-height:1.65;max-width:650px;margin:14px 0 20px}
.manager-create-row{display:flex;gap:10px;align-items:end;padding:16px;border:1px solid var(--stroke);background:var(--panel-2);border-radius:15px}
.manager-create-row label{flex:1;min-width:0}
.manager-create-row input{height:42px;padding:10px 13px}
.manager-create-row .btn{min-height:42px;white-space:nowrap}
.profile-toolbar{background:transparent;padding:14px 0 8px;display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:12px}
.manager-list{display:grid;gap:9px;margin-top:8px}
.manager-list-item{border:1px solid var(--stroke)!important;background:var(--panel-2);border-radius:13px;padding:13px 14px;gap:18px;min-height:72px}
.manager-list-item:last-child{border-bottom:1px solid var(--stroke)!important}
.manager-list-item .profile-info{min-width:0;display:flex;flex-direction:column;gap:5px}
.manager-list-item .profile-info strong{font-size:14px;overflow-wrap:anywhere}
.manager-list-item .profile-info small{font-size:12px;white-space:normal;line-height:1.4}
.profile-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.profile-actions .btn{font-size:12px;padding:8px 12px;border-radius:9px}
.profile-actions .profile-delete{color:var(--danger)}
.profile-actions button:disabled{opacity:.33;cursor:not-allowed}
.profile-footnote{margin-top:16px;line-height:1.5;color:var(--muted);font-size:12px}
.w-extra .w-listrow{padding:14px 16px;margin:0 0 8px;background:var(--panel-2);border:1px solid var(--stroke);border-radius:12px;gap:16px}
.w-extra .w-listrow:last-child{border:1px solid var(--stroke)}
.w-extra .w-listrow strong{font-size:14px;font-weight:650}
.w-extra .w-listrow small{line-height:1.5;font-size:12px}
.w-extra .w-action{padding:9px 14px;border-radius:10px;white-space:nowrap}
.w-extra h2{font-size:22px;letter-spacing:-.03em;margin:0 0 8px}
.w-extra .w-section{background:transparent;border:0;padding:0;margin-top:20px}
.w-nav,.tab-btn{transition:background .16s ease,color .16s ease,border-color .16s ease}
.w-extra .trash-header{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.w-extra .trash-icon{display:grid;place-items:center;height:42px;width:42px;border-radius:12px;background:var(--panel-2);color:var(--muted);font-size:20px}
@media(max-width:650px){.manager-modal-card{padding:16px}.manager-create-row{flex-direction:column;align-items:stretch}.profile-toolbar{grid-template-columns:1fr}.manager-list-item{align-items:stretch}.profile-actions{justify-content:flex-start}.w-extra .w-listrow{align-items:flex-start;flex-direction:column}}

.w-change-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--stroke);overflow-wrap:anywhere}
.w-change-row span{min-width:0;flex:1;color:var(--muted)}
.w-revert{cursor:pointer;border:1px solid var(--stroke);color:var(--text);background:var(--panel-2);border-radius:8px;padding:6px 10px;font-size:11px;white-space:nowrap}
.w-revert:hover{border-color:var(--blue)}.w-revert:disabled{opacity:.5}


/* V7.8 Night Shift: warm low-glare work theme, no browser blue-light claims. */
:root[data-theme="night"]{
 --theme-bg:#24251f;--theme-surface:#2c2d27;--theme-surface2:#32342c;
 --theme-tile:#363930;--theme-input:#282b25;--theme-border:#4a4e42;
 --theme-text:#d9d7c6;--theme-muted:#adaf9c;--theme-accent:#c2ad83;
 --theme-active:#44473a;--theme-primary:#615e48;--theme-shadow:rgba(0,0,0,.11);
 color-scheme:dark;
}
:root[data-theme="night"] .inline-status{
 background-color:color-mix(in srgb,var(--status-color) 11%,#303329)!important;
 color:color-mix(in srgb,var(--status-color) 58%,#ded9c5)!important;
 border-color:color-mix(in srgb,var(--status-color) 25%,#4b4a3b)!important;
}
:root[data-theme="night"] .metric-value.green{color:#9fc4a8!important}
:root[data-theme="night"] .metric-value.purple{color:#bbb0c7!important}
:root[data-theme="night"] .metric-value.coral{color:#c6aaba!important}
:root[data-theme="night"] .inline-date::-webkit-calendar-picker-indicator{filter:invert(.65) sepia(.24)}


/* V7.8: analytics theme isolation - remove the legacy dark backgrounds. */
.w-extra .w-grid .w-section,
.w-extra .w-section {background:transparent!important;border:0!important;color:var(--theme-text)!important;}
.w-extra .w-listrow,
.w-extra .w-section .w-listrow,
.w-extra .w-grid .w-listrow {
 background:var(--theme-tile)!important;
 border:1px solid var(--theme-border)!important;
 color:var(--theme-text)!important;
 box-shadow:none!important;
}
.w-extra .w-listrow b,.w-extra .w-listrow strong,.w-extra .w-listrow small,
.w-extra .w-section h3,.w-extra .w-card h3,.w-extra .w-card b,
.w-extra .w-listrow {color:var(--theme-text)!important;}
.w-extra .w-grid .w-card {background:var(--theme-tile)!important;border:1px solid var(--theme-border)!important;color:var(--theme-text)!important;}
.w-extra .w-card h3{color:var(--theme-muted)!important;}
.w-extra .w-muted {color:var(--theme-muted)!important;}
/* Move Trash to the far right on desktop, keep scrolling navigation on mobile. */
.w-mainnav .w-nav-trash {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:5px;}
@media (max-width:650px) {.w-mainnav .w-nav-trash {margin-left:12px;}}

/* V7.9 company history: theme-aware, responsive, isolated from operational records */
.w-h-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}.w-h-header h2{margin:0}.w-h-count{font-size:12px;color:var(--theme-muted)}
.w-h-controls{display:grid;gap:10px}.w-h-years,.w-h-months{display:flex;gap:5px;flex-wrap:wrap}.w-h-months .w-action{flex:0 0 auto;min-width:42px;text-align:center}
.w-h-selected{background:var(--theme-active)!important;color:var(--theme-accent)!important;border-color:var(--theme-accent)!important}
.w-h-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:18px 0}.w-h-search{display:flex;align-items:center;gap:8px;flex:1;max-width:600px}.w-h-search input{flex:1;min-width:160px;border:1px solid var(--theme-border);border-radius:9px;background:var(--theme-input);color:var(--theme-text);padding:10px}
.w-h-tablewrap{overflow:auto;border:1px solid var(--theme-border);border-radius:12px;background:var(--theme-surface)}
.w-h-table{border-collapse:collapse;width:100%;min-width:930px;font-size:12px}.w-h-table th{text-align:left;font-weight:650;padding:11px 13px;background:var(--theme-surface2);color:var(--theme-muted)}.w-h-table td{padding:12px 13px;border-top:1px solid var(--theme-border);color:var(--theme-text);vertical-align:middle}
.w-history-name{border:0;background:transparent;color:var(--theme-text);font:inherit;font-weight:650;cursor:pointer;text-align:left}.w-history-name:hover{color:var(--theme-accent)}.w-h-reason{max-width:190px;display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:middle}
.w-h-paging{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:15px 0;color:var(--theme-muted);font-size:12px}.w-h-paging div{display:flex;gap:8px}.w-h-error{border:1px solid #aa6a53;border-radius:9px;padding:12px;margin:12px 0;color:var(--theme-text)}
.w-h-overlay{position:fixed;inset:0;background:rgba(0,0,0,.48);z-index:150;display:flex;justify-content:flex-end}.w-h-detail{position:relative;width:min(540px,95vw);height:100%;overflow:auto;padding:34px;background:var(--theme-surface);border-left:1px solid var(--theme-border);color:var(--theme-text);box-shadow:0 10px 40px var(--theme-shadow)}.w-h-close{position:absolute;right:18px;top:18px}.w-h-detail h2{margin-top:12px}.w-h-detail dl{display:grid;grid-template-columns:145px 1fr;gap:18px 12px;margin-top:28px}.w-h-detail dt{color:var(--theme-muted);font-size:12px}.w-h-detail dd{margin:0;overflow-wrap:anywhere}
.w-history-comparison{display:flex;gap:12px;flex-wrap:wrap}.w-history-comparison>div{padding:12px 16px;background:var(--theme-tile);border:1px solid var(--theme-border);border-radius:10px;color:var(--theme-text)}
.prev-summary{display:none!important}
@media(max-width:760px){.w-h-header{align-items:flex-start}.w-h-months{flex-wrap:nowrap;overflow:auto;padding-bottom:5px}.w-h-tools{align-items:stretch}.w-h-search{width:100%;max-width:none}.w-h-detail{padding:22px}.w-h-detail dl{grid-template-columns:1fr;gap:5px}.w-h-detail dd{margin-bottom:12px}}

/* Watakat CRM V8 — daily workflow */
.w-mainnav .w-nav-archive{margin-left:auto}
.w-mainnav .w-nav-trash{margin-left:0}
.w-month-right{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-wrap:wrap}
.w-new-project{white-space:nowrap;font-weight:750}
.w-launch-alert{margin:0 0 12px}
.w-launch-jump{width:100%;display:flex;gap:13px;align-items:center;text-align:left;padding:12px 16px;cursor:pointer;border:1px solid var(--theme-border);background:var(--theme-surface2);border-radius:12px;color:var(--theme-text);font:inherit}
.w-launch-jump:hover{filter:brightness(1.08)}
.w-launch-jump strong{display:block;font-size:14px}
.w-launch-jump small{display:block;font-size:12px;opacity:.78;margin-top:3px}
.w-launch-rocket{font-size:20px}
.w-launch-chevron{margin-left:auto;font-size:12px;opacity:.84}
@media(max-width:720px){.w-mainnav .w-nav-archive{margin-left:0}.w-month-right{width:100%;justify-content:space-between}.w-new-project{width:auto}}

.w-field-hint{display:block;grid-column:1/-1;color:var(--theme-muted);font-size:12px;margin:-5px 0 5px}.table-message{overflow-wrap:anywhere}
