/* Decco OS — warm, fluid workspace. Loaded after page styles on every screen. */


:root, [data-theme="light"] {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --surface-hover: #e7eeea;
  --border: #dde5e1;
  --border-subtle: #edf1ef;
  --border-focus: rgba(55, 111, 99, .38);
  --text: #26332f;
  --text-secondary: #65746f;
  --text-tertiary: #84918c;
  --primary: #376f63;
  --primary-dark: #2e5d53;
  --primary-light: #50877a;
  --primary-subtle: rgba(55, 111, 99, .10);
  --primary-glow: transparent;
  --secondary: #a6715c;
  --secondary-subtle: #f4eae5;
  --sidebar-bg: #eaf0ed;
  --sidebar-w: 258px;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 8px 26px -22px rgba(40, 75, 67, .22);
  --card-shadow: 0 8px 28px -25px rgba(40, 75, 67, .24);
  --diffusion-shadow: 0 22px 56px -34px rgba(39, 62, 55, .30);
  --glass-surface: rgba(244, 246, 245, .92);
  --yellow: #94691e;
  --yellow-bg: #fbf2df;
  --yellow-border: #f0e1be;
  --blue: #4b7491;
  --blue-bg: #e9f1f7;
  --blue-border: #d5e5ef;
  --red: #a85f5b;
  --red-bg: #f8ecea;
  --red-border: #efd9d6;
  --green: #4b7761;
  --green-bg: #e9f2eb;
  --green-border: #d5e6da;
  --purple: #786d91;
  --purple-bg: #f0edf5;
  --purple-border: #e3dded;
}

:root:not([data-theme="light"]), [data-theme="dark"] {
  --bg: #20292b;
  --surface: #293436;
  --surface-2: #334042;
  --surface-hover: #3a4849;
  --border: #435153;
  --border-subtle: #374446;
  --border-focus: rgba(126, 185, 165, .45);
  --text: #eaf0ec;
  --text-secondary: #b7c5be;
  --text-tertiary: #91a39b;
  --primary: #7eb9a5;
  --primary-dark: #679c8b;
  --primary-light: #9bcebc;
  --primary-subtle: rgba(126, 185, 165, .14);
  --secondary: #d19b82;
  --secondary-subtle: rgba(209, 155, 130, .14);
  --sidebar-bg: #253032;
  --shadow: 0 10px 28px -21px rgba(0, 0, 0, .4);
  --card-shadow: 0 10px 28px -22px rgba(0, 0, 0, .42);
  --diffusion-shadow: 0 28px 68px -37px rgba(0, 0, 0, .65);
  --glass-surface: rgba(32, 41, 43, .93);
  --yellow: #e0bb70; --yellow-bg: rgba(224, 187, 112, .14); --yellow-border: rgba(224, 187, 112, .23);
  --blue: #9ac2d9; --blue-bg: rgba(154, 194, 217, .14); --blue-border: rgba(154, 194, 217, .23);
  --red: #dfa29d; --red-bg: rgba(223, 162, 157, .14); --red-border: rgba(223, 162, 157, .23);
  --green: #9bc8a6; --green-bg: rgba(155, 200, 166, .14); --green-border: rgba(155, 200, 166, .23);
  --purple: #beb1d4; --purple-bg: rgba(190, 177, 212, .14); --purple-border: rgba(190, 177, 212, .23);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Google Sans';
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  background-image: none;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
::selection { background: var(--primary-subtle); color: var(--text); }

.sidebar {
  border-right: 1px solid var(--border);
  box-shadow: none;
}
.sidebar-logo {
  padding: 29px 24px 23px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.055em;
  border-bottom: 0;
}
.sidebar-logo span:not(.logo-dot) { font-size: .65rem; letter-spacing: .12em; margin-top: 6px; }
.sidebar-logo .logo-dot { color: var(--primary); animation: none; }
.nav { padding: 10px 13px 18px; gap: 3px; }
.nav a {
  padding: 10px 13px;
  min-height: 44px;
  border-radius: 13px;
  font-size: .89rem;
  font-weight: 500;
  transition: background .25s cubic-bezier(.16,1,.3,1), color .25s, transform .25s;
}
.nav a:hover { transform: translateX(3px); }
.nav a.active { background: var(--surface); color: var(--primary); box-shadow: none; }
.nav a.active::before { display: none; }
.nav-icon { width: 20px; height: 20px; }
.sidebar-footer { padding: 16px 20px; background: transparent; }

.main {
  width: calc(100% - var(--sidebar-w));
  max-width: none;
  padding: clamp(22px, 3vw, 46px) clamp(22px, 4vw, 62px) 72px;
}
.main > * { max-width: 1500px; margin-left: auto; margin-right: auto; }
.page-header { margin-bottom: 33px; gap: 18px; align-items: flex-end; }
.page-header h1 { font-size: clamp(1.8rem, 2.2vw, 2.5rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.08; }
.page-header .subtitle, .subtitle { color: var(--text-secondary); font-size: .88rem; margin-top: 8px; }
.page-header .actions { flex-wrap: wrap; justify-content: flex-end; }
.section-title { font-size: .78rem; font-weight: 600; letter-spacing: .095em; margin: 33px auto 13px; }

.btn { min-height: 42px; padding: 9px 17px; border-radius: 12px; box-shadow: none; font-weight: 600; transition: background .25s cubic-bezier(.16,1,.3,1), transform .25s, border-color .25s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff !important; box-shadow: none; }
.btn-primary, .btn-primary *, .btn-primary span { color: #fff !important; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: none; }
.btn-secondary { background: var(--surface); border-color: var(--border); }
.btn-danger { background: var(--red-bg); }
.btn-sm { min-height: 36px; padding: 6px 12px; }

.card, .period-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.card { padding: clamp(16px, 1.7vw, 26px); }
.card:hover { border-color: var(--border); }
.card:focus-within { border-color: var(--primary); }
.card-grid { gap: 15px; margin-bottom: 28px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card-grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.kpi-card { min-height: 144px; border-top: 1px solid var(--border) !important; }
.kpi-card::after { content: none; }
.kpi-card { border-left: 3px solid var(--primary); }
.kpi-card.accent-yellow { border-left-color: var(--yellow); }
.kpi-card.accent-blue { border-left-color: var(--blue); }
.kpi-card.accent-green { border-left-color: var(--green); }
.kpi-card.accent-red { border-left-color: var(--red); }
.kpi-card.accent-purple { border-left-color: var(--purple); }
.kpi-card .kpi-icon { background: var(--primary-subtle); color: var(--primary); }
.kpi-card.accent-yellow .kpi-icon { background: var(--yellow-bg); color: var(--yellow); }
.kpi-card.accent-blue .kpi-icon { background: var(--blue-bg); color: var(--blue); }
.kpi-card.accent-green .kpi-icon { background: var(--green-bg); color: var(--green); }
.kpi-card.accent-red .kpi-icon { background: var(--red-bg); color: var(--red); }
.kpi-card.accent-purple .kpi-icon { background: var(--purple-bg); color: var(--purple); }
.kpi-label { font-size: .72rem; letter-spacing: .09em; font-weight: 600; }
.kpi-value { font-family: 'Google Sans'; font-size: clamp(1.35rem, 2vw, 2rem); font-weight: 600; letter-spacing: -.06em; overflow-wrap: anywhere; }
.kpi-icon { border-radius: 14px; box-shadow: none; }
.period-summary-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.period-card { min-height: 108px; padding: 18px 20px; box-shadow: var(--card-shadow); }
.period-card-rev { font-family: 'Google Sans'; letter-spacing: -.06em; }
.period-card:nth-child(3n + 1) { border-top: 3px solid var(--blue); }
.period-card:nth-child(3n + 2) { border-top: 3px solid var(--green); }
.period-card:nth-child(3n) { border-top: 3px solid var(--secondary); }
.section-title { color: var(--text-secondary); }
.date-badge { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue); }
.job-item { background: var(--surface-2); border: 1px solid var(--border-subtle); }
.pre-opening-banner { background: var(--yellow-bg); border-color: var(--yellow-border); }

.chip { padding: 5px 10px; border-radius: 999px; font-weight: 600; }
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: 12px; scrollbar-gutter: stable; }
.card:has(> .table-wrap) { padding: 5px 8px; }
table { min-width: 620px; font-size: .88rem; }
thead th { background: var(--surface); color: var(--text-secondary); font-size: .69rem; padding: 15px 16px; }
tbody td { padding: 15px 16px; border-bottom-color: var(--border-subtle); }
tbody tr:hover { background: var(--surface-2); }
.td-bold, .kpi-value, .progress-count { font-variant-numeric: tabular-nums; }

.filter-tabs, .report-tabs, .settings-nav { scrollbar-width: thin; }
.filter-tabs { gap: 5px; overflow-x: auto; max-width: 100%; padding-bottom: 3px; }
.filter-tabs > * { white-space: nowrap; flex-shrink: 0; }
.search-input, .form-control, input, select, textarea { border-radius: 12px; }
.form-group { min-width: 0; }
.form-label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: .78rem; font-weight: 600; }
.form-control { min-height: 44px; background: var(--surface); border-color: var(--border); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }
.form-row, .form-row-3 { gap: 16px; }
.modal-overlay { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal { border-radius: 26px; background: var(--surface); box-shadow: var(--diffusion-shadow); }
.modal-body { overflow-y: auto; overscroll-behavior: contain; }
.modal { display:flex; flex-direction:column; overflow:hidden; max-height:calc(100dvh - 24px); }
.modal-header, .modal-footer { flex-shrink:0; }
.modal-header h3 { min-width:0; overflow-wrap:anywhere; line-height:1.35; }
.modal-body { min-height:0; flex:1 1 auto; overflow-x:hidden; }
.modal-footer { flex-wrap:wrap; padding-bottom:calc(14px + var(--sab)); }
.modal-footer .btn { white-space:normal; }
.empty-state { border-radius: var(--radius); color: var(--text-secondary); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .period-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 768px) {
  body { background-image: none; }
  .mobile-topbar { height: calc(62px + var(--sat)); padding: var(--sat) max(16px,var(--sal)) 0 max(16px,var(--sar)); background: var(--glass-surface); border-bottom-color: var(--border); }
  .mobile-menu-btn { border-radius: 13px; background: var(--surface); }
  .mobile-topbar-title { font-size: 1.13rem; font-weight: 700; letter-spacing: -.05em; }
  .sidebar { width: min(320px, 88vw); background: var(--sidebar-bg); }
  .sidebar.open { box-shadow: var(--diffusion-shadow); }
  .sidebar-backdrop { background: rgba(28,29,26,.5); }
  .main { width: 100%; max-width: 100%; padding: 22px max(16px,var(--sal)) calc(45px + var(--sab)) max(16px,var(--sar)); }
  .main > * { max-width: 100%; min-width: 0; }
  .page-header { gap: 16px; margin-bottom: 24px; align-items: flex-start; }
  .page-header h1 { font-size: clamp(1.65rem,6vw,2.05rem); }
  .page-header .actions { justify-content: flex-start; width: 100%; }
  .page-header .actions .btn { min-height: 44px; }
  .card-grid, .grid-2, .grid-2-1, .grid-3, .grid-4, .period-summary-grid { grid-template-columns: minmax(0,1fr) !important; }
  .card-grid { gap: 12px; }
  .card { border-radius: 18px; }
  .kpi-card { min-height: 115px; }
  .section-title { margin-top: 28px; }
  .form-row, .form-row-3 { grid-template-columns: minmax(0,1fr) !important; }
  .modal { width: min(100%, 620px); max-height: calc(100dvh - 20px - var(--sat) - var(--sab)); border-radius: 20px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { min-height: 44px; }
  .period-summary-grid { gap: 12px; }
}
@media (max-width: 480px) {
  .main { padding-left: max(14px,var(--sal)); padding-right: max(14px,var(--sar)); }
  .page-header .actions .btn { flex: 1 1 100%; }
  .filter-tabs { margin-right: -14px; padding-right: 14px; }
  .modal-overlay { padding: 10px; }
  .card { padding: 16px; }
  .card:has(> .table-wrap) { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Sign-in screen uses its own original styles; bring it into the same system. */
.screen { align-items: stretch; padding: calc(100px + var(--sat)) 24px calc(40px + var(--sab)); }
.login-card { width: min(100%, 470px); margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--diffusion-shadow); padding: clamp(24px,4vw,46px); }
.menubar { background: var(--glass-surface); border-bottom: 1px solid var(--border); color: var(--text-secondary); font-family: 'Google Sans'; }
.menubar-logo { color: var(--text); font-size: 1.1rem; letter-spacing: -.05em; }
.menubar-logo .dot, .system-name .dot { color: var(--primary); }
.bg-canvas { background: var(--bg); }
.bg-grid { opacity: .2; background-image: linear-gradient(var(--border) 1px,transparent 1px),linear-gradient(90deg,var(--border) 1px,transparent 1px); background-size: 56px 56px; }
.orb { display: none; }
.avatar { border-radius: 22px; background: var(--primary-subtle); border: 1px solid var(--border); box-shadow: none; color: var(--primary); }
.system-name { font-family: 'Google Sans'; font-size: 1.45rem; font-weight: 600; letter-spacing: -.04em; }
.system-sub { color: var(--text-secondary); font-size: .84rem; }
.login-card .form-label { color: var(--text-secondary); text-transform: none; letter-spacing: 0; font-size: .82rem; }
.login-card .form-input { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); min-height: 48px; font-family: 'Google Sans'; }
.login-card .form-input:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }
.login-card .form-input::placeholder { color: var(--text-tertiary); }
.login-card .pass-toggle { color: var(--text-secondary); min-width: 32px; min-height: 32px; }
.login-card .btn-login { background: var(--primary); border-radius: 12px; box-shadow: none; min-height: 50px; font-family: 'Google Sans'; font-weight: 600; }
.login-card .btn-login:hover { background: var(--primary-dark); box-shadow: none; }
.login-card .error-box { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
@media (max-width: 480px) {
  .screen { padding: calc(86px + var(--sat)) 14px calc(24px + var(--sab)); }
  .login-card { border-radius: 20px; padding: 25px 20px; }
}

/* One typeface and one icon family throughout the product. */
html, body, body *, body *::before, body *::after, button, input, select, textarea {
  font-family: 'Google Sans', sans-serif !important;
}
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.nav-icon .material-symbols-outlined { font-size: 21px; }
.kpi-icon .material-symbols-outlined { font-size: 24px; }
.mobile-menu-btn .material-symbols-outlined { font-size: 25px; }
.login-card .avatar .material-symbols-outlined { font-size: 32px; }
.sidebar-footer .material-symbols-outlined { font-size: 20px; }
.material-symbols-outlined + span { min-width: 0; }

/* Let controls and information use their available width instead of nested scrolling. */
.main, .main > *, .card, .modal, .modal-body, .table-wrap, .settings-layout, .settings-layout > *, .settings-panel, .settings-nav, .filter-tabs, .report-tabs {
  min-width: 0;
}
.filter-tabs, .report-tabs, .settings-nav {
  display: flex;
  flex-wrap: wrap !important;
  overflow: visible !important;
  max-width: 100%;
  gap: 7px;
}
.filter-tabs > *, .report-tabs > *, .settings-nav > * {
  flex: 0 1 auto !important;
  white-space: nowrap !important;
}
.table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table {
  width: 100%;
  min-width: 860px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
thead th {
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  letter-spacing: .02em;
}
tbody td {
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.chip {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  word-break: keep-all !important;
}
.period-summary-grid, .orders-toolbar, .search-bar { min-width: 0; max-width: 100%; }
.orders-toolbar, .search-bar { flex-wrap: wrap; }
.preview-scroll, #cust-list, #order-search-results { max-height: none !important; overflow: visible !important; }
.modal-body { overflow-y: auto; scrollbar-width: none; }
.modal-body::-webkit-scrollbar, .nav::-webkit-scrollbar, .sidebar::-webkit-scrollbar { display: none; }
.nav, .sidebar { scrollbar-width: none; }

@media (max-width: 850px) {
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: grid; gap: 11px; }
  .table-wrap tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 7px 14px;
    box-shadow: var(--shadow);
    cursor: default;
  }
  .table-wrap tbody td {
    display: grid;
    grid-template-columns: minmax(86px, 38%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .table-wrap tbody td:last-child { border-bottom: 0; }
  .table-wrap tbody td::before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.45;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .table-wrap tbody td:not([data-label]) { display: block; }
  .table-wrap tbody td[data-label=""]::before { content: none; }
  .table-wrap tbody td[data-label=""] { display: block; }
  .table-wrap tbody td[colspan] { display: block; }
  .table-wrap tbody td[colspan]::before { content: none; }
  .table-wrap tbody td button, .table-wrap tbody td .btn { max-width: 100%; white-space: normal; }
  .settings-nav { width: 100%; }
}
@media (max-width: 480px) {
  .table-wrap tbody td { grid-template-columns: minmax(75px, 34%) minmax(0,1fr); gap: 9px; }
  .filter-tabs, .report-tabs, .settings-nav { margin-right: 0; padding-right: 0; }
  .filter-tabs > *, .report-tabs > *, .settings-nav > * { flex: 1 1 auto !important; }
}
