:root{--bg:#e9eef4;--surface:#fff;--blue:#0a84d8;--blue-dark:#0069ae;--navy:#0b1f33;--text:#18212b;--muted:#677481;--border:#e5eaf0;--danger:#c83d4b;--shadow:0 8px 24px rgba(14,43,71,.08);font-family:"Segoe UI","Noto Sans Thai",Tahoma,Arial,sans-serif;color:var(--text);background:var(--bg)}*{box-sizing:border-box}body{margin:0;background:var(--bg)}button,input,select,textarea{font:inherit}.login-view{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#e9eef4,#dceefe)}.login-card{width:min(440px,100%);background:#fff;padding:40px;border-radius:20px;border:1px solid var(--border);box-shadow:var(--shadow)}.brand-mark{width:64px;height:64px;display:grid;place-items:center;border-radius:16px;color:#fff;font-weight:800;background:linear-gradient(135deg,#1597e5,#0069ae);box-shadow:0 8px 20px rgba(10,132,216,.25)}.brand-mark.small{width:42px;height:42px;border-radius:12px;font-size:13px}.login-card h1{margin:24px 0 8px;color:var(--navy);font-size:28px}.login-card>p{color:var(--muted);margin:0 0 24px}.login-card label,.form-grid label,.filters label{display:grid;gap:7px;color:var(--navy);font-size:13px;font-weight:600;margin-bottom:15px}input,select,textarea{width:100%;border:1px solid #cfd8e3;border-radius:9px;padding:10px 12px;background:#fff;color:var(--text);outline:none}input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(10,132,216,.12)}.btn{border:1px solid transparent;border-radius:9px;padding:9px 14px;font-size:13px;font-weight:700;cursor:pointer}.btn.primary{background:var(--blue);color:#fff}.btn.primary:hover{background:var(--blue-dark)}.btn.ghost{background:#fff;border-color:var(--border);color:var(--navy)}.btn.wide{width:100%;padding:12px}.btn.small{padding:6px 9px;font-size:11px}.form-error{min-height:20px;color:var(--danger);font-size:13px}
.app-shell{min-height:100vh;display:grid;grid-template-columns:248px minmax(0,1fr)}.sidebar{position:sticky;top:0;height:100vh;background:#0b2035;color:#fff;padding:22px 16px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;padding:0 6px 24px}.brand div{display:grid}.brand small{color:#9bb3c9;margin-top:2px}.nav{display:grid;gap:5px}.nav button{border:0;background:transparent;color:#b9c9d8;text-align:left;padding:11px 13px;border-radius:9px;cursor:pointer;font-weight:600}.nav button:hover,.nav button.active{background:#143b5e;color:#fff}.sidebar-user{margin-top:auto;border-top:1px solid #24435e;padding:18px 6px 0;display:grid;gap:6px}.sidebar-user span{color:#9bb3c9;font-size:12px}.sidebar-user .btn{margin-top:8px;background:transparent;color:#dce9f4;border-color:#36556f}.workspace{min-width:0;padding:0 28px 40px}.topbar{min-height:88px;display:flex;align-items:center;gap:14px}.topbar h1{margin:0;color:var(--navy);font-size:24px}.topbar p{margin:3px 0 0;color:var(--muted);font-size:13px}.topbar-meta{margin-left:auto;text-align:right;display:grid;font-size:12px;color:var(--muted)}.topbar-meta b{color:var(--navy);margin-top:3px}.menu-btn{display:none;border:0;background:transparent;font-size:22px}.page{display:none}.page.active{display:block}.toolbar{display:flex;gap:10px;align-items:end;margin-bottom:16px}.toolbar>input{max-width:360px}.filters label{margin:0;min-width:160px}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:16px}.metric{position:relative;overflow:hidden;min-height:140px;border-radius:15px;padding:20px;color:#fff;display:flex;flex-direction:column}.metric:after{content:"";position:absolute;width:90px;height:90px;border-radius:50%;right:-25px;bottom:-30px;background:rgba(255,255,255,.13)}.metric.blue{background:#168be5}.metric.teal{background:#1597a2}.metric.orange{background:#f28a00}.metric.purple{background:#7049e8}.metric span{font-size:13px}.metric strong{font-size:32px;margin:8px 0}.metric small{opacity:.85}.content-grid{display:grid;grid-template-columns:2fr 1fr;gap:16px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:15px;padding:20px;box-shadow:0 3px 12px rgba(14,43,71,.04);margin-bottom:16px}.panel-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:16px}.panel h2{font-size:17px;color:var(--navy);margin:0}.panel-head p{color:var(--muted);font-size:12px;margin:4px 0 0}.big-number{font-size:34px;font-weight:800;color:var(--blue-dark);padding:28px 0}.note{color:var(--muted);font-size:13px;line-height:1.6}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;color:#536372;font-size:12px;background:#f6f8fa;padding:11px 10px;border-bottom:1px solid var(--border);white-space:nowrap}td{padding:11px 10px;border-bottom:1px solid #edf0f4;vertical-align:top}tbody tr:hover{background:#f9fbfd}.badge{display:inline-flex;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:700;background:#eaf6ff;color:#0069ae;white-space:nowrap}.badge.success{background:#e6f7f0;color:#087e58}.badge.warning{background:#fff2da;color:#995d00}.badge.danger{background:#feecef;color:#aa2937}.empty{text-align:center;color:var(--muted);padding:32px}.row-actions{display:flex;gap:6px;flex-wrap:wrap}
.chart{min-height:220px;display:flex;align-items:end;gap:12px;padding:20px 8px 10px;border-bottom:1px solid var(--border)}.chart-group{flex:1;min-width:30px;text-align:center}.chart-bars{height:160px;display:flex;align-items:end;justify-content:center;gap:4px}.bar{width:14px;min-height:2px;border-radius:4px 4px 0 0;background:var(--blue)}.bar.win{background:#18a675}.chart-label{font-size:10px;color:var(--muted);margin-top:7px}.appointment-list{display:grid;gap:10px}.appointment{display:grid;grid-template-columns:130px 1fr auto;gap:16px;padding:14px;border:1px solid var(--border);border-radius:11px}.appointment time{font-weight:700;color:var(--blue-dark)}.appointment h3{font-size:14px;margin:0 0 4px}.appointment p{font-size:12px;color:var(--muted);margin:0}.settings-list{display:grid;gap:8px}.setting-row{display:grid;grid-template-columns:220px 1fr auto;gap:16px;padding:12px;border-bottom:1px solid var(--border)}.dialog{width:min(860px,calc(100% - 32px));border:0;border-radius:16px;padding:0;box-shadow:0 30px 80px rgba(0,24,48,.25)}.dialog.compact{width:min(680px,calc(100% - 32px))}.dialog::backdrop{background:rgba(5,24,42,.55)}.dialog form{padding:24px}.dialog-head{display:flex;justify-content:space-between;gap:20px}.dialog-head h2{margin:0;color:var(--navy)}.dialog-head p{margin:5px 0 20px;color:var(--muted);font-size:12px}.icon-btn{border:0;background:#eff3f7;border-radius:9px;width:36px;height:36px;font-size:23px;cursor:pointer}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 16px}.wide-field{grid-column:1/-1}fieldset{border:1px solid var(--border);border-radius:12px;margin:10px 0 0;padding:16px}legend{color:var(--navy);font-weight:700;font-size:13px;padding:0 8px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.toast{position:fixed;right:24px;bottom:24px;background:#0b1f33;color:#fff;padding:12px 16px;border-radius:10px;box-shadow:var(--shadow);opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s}.toast.show{opacity:1;transform:none}
@media(max-width:1000px){.metrics{grid-template-columns:repeat(2,1fr)}.content-grid{grid-template-columns:1fr}.app-shell{grid-template-columns:210px minmax(0,1fr)}.workspace{padding:0 18px 32px}}@media(max-width:720px){.app-shell{display:block}.sidebar{position:fixed;z-index:20;width:260px;transform:translateX(-105%);transition:.2s}.sidebar.open{transform:none}.workspace{padding:0 12px 24px}.menu-btn{display:block}.topbar-meta{display:none}.metrics{gap:10px}.metric{min-height:120px;padding:16px}.metric strong{font-size:25px}.toolbar{align-items:stretch;flex-direction:column}.toolbar>input,.filters label{max-width:none;width:100%}.form-grid{grid-template-columns:1fr}.wide-field{grid-column:auto}.appointment{grid-template-columns:1fr}.setting-row{grid-template-columns:1fr}.login-card{padding:28px 22px}.dialog form{padding:18px}}
[hidden]{display:none!important}

/* Prototype-aligned PMK workspace */
:root{--pmk-red:#d7192d;--pmk-red-soft:#fff0f2;--pmk-page:#f4f5f7;--pmk-ink:#20242c;--pmk-line:#e0e3e8;--shadow:none}
body{background:var(--pmk-page);font-size:13px}.app-shell{grid-template-columns:192px minmax(0,1fr)}
.sidebar{background:#7c1222;color:#fff;padding:20px 12px;border-right:0}
.brand{padding:0 4px 24px;gap:10px}.brand-mark.small{width:38px;height:38px;border-radius:50%;font-size:11px;background:#fff;color:var(--pmk-red);box-shadow:none}.brand b{font-size:13px;line-height:1.25;color:#fff;}.brand small{color:rgba(255,255,255,0.7);font-size:9px;margin-top:4px}
.login-card .brand-mark.small{border-radius:12px;background:var(--pmk-red);color:#fff;box-shadow:0 7px 16px rgba(167,15,32,.22)}
.nav{gap:5px}.nav button{display:flex;align-items:center;gap:10px;color:rgba(255,255,255,0.85);padding:11px 12px;border-radius:8px;font-size:12px;font-weight:600;background:transparent;border:0;width:100%;cursor:pointer}
.nav button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nav button:hover,.nav button.active{background:rgba(255,255,255,0.15);color:#fff}
.nav-group{font-size:10px;font-weight:700;color:rgba(255,255,255,0.6);margin:12px 0 2px 10px;display:block}
.sidebar-user{border-top:1px solid rgba(255,255,255,0.2);padding:16px 7px 0}.sidebar-user span{color:rgba(255,255,255,0.7)}.sidebar-user .btn{color:#fff;background:rgba(255,255,255,0.1);border-color:transparent}.sidebar-user .btn:hover{background:rgba(255,255,255,0.2)}
.workspace{padding:0 22px 36px;background:var(--pmk-page)}.topbar{min-height:64px;margin:0 -22px 18px;padding:0 22px;background:#fff;border-bottom:1px solid var(--pmk-line)}.topbar h1{font-size:16px;color:var(--pmk-ink)}.topbar p{display:none}.topbar-meta{grid-template-columns:auto auto;column-gap:10px;align-items:center}.topbar-meta span{grid-row:1/3}.topbar-meta b{margin:0;font-size:11px}.topbar-meta small{font-size:9px;color:#8a9099}
.btn{border-radius:8px}.btn.primary{background:var(--pmk-red)}.btn.primary:hover{background:#b91224}
.dashboard-heading{display:grid;grid-template-columns:minmax(240px,1fr) minmax(600px,2.5fr);gap:20px;align-items:start;margin-bottom:14px}.dashboard-heading h2{margin:0;color:var(--pmk-ink);font-size:21px;line-height:1.2}.dashboard-heading>div>p{margin:5px 0 0;color:#7b828c;font-size:11px}.dashboard-filters{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:9px;align-items:end}.dashboard-filters label{display:grid;gap:5px;color:#69717c;font-size:9px;font-weight:600}.dashboard-filters input,.dashboard-filters select{height:37px;padding:7px 9px;border-color:#d9dde3;border-radius:7px;font-size:10px}.dashboard-filters #dashSource{grid-column:1/2}.dashboard-filters .btn{height:37px;font-size:10px}
.dashboard-metrics{grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.dashboard-metrics .metric{min-height:74px;background:#fff!important;color:var(--pmk-ink);border:1px solid var(--pmk-line);border-radius:11px;padding:13px 15px;box-shadow:none}.dashboard-metrics .metric:after{display:none}.dashboard-metrics .metric span{font-size:9px;color:#737b85}.dashboard-metrics .metric strong{font-size:20px;margin:6px 0 0;line-height:1.1}.dashboard-metrics .metric:nth-child(5),.dashboard-metrics .metric:nth-child(6){min-height:60px}
.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.dashboard-grid .panel{margin:0;padding:16px;border-color:var(--pmk-line);border-radius:11px;box-shadow:none}.dashboard-grid .dashboard-wide{grid-column:1/-1}.dashboard-grid .panel-head{margin-bottom:10px}.dashboard-grid .panel h2{font-size:15px;color:var(--pmk-ink)}
.line-chart,.activity-chart{min-height:220px}.line-chart svg,.activity-chart svg{display:block;width:100%;height:205px;overflow:visible}.line-chart .grid line,.activity-chart .grid line{stroke:#e7e9ed;stroke-width:1}.line-chart polyline,.activity-chart polyline{fill:none;stroke:var(--series);stroke-width:2}.line-chart circle,.activity-chart circle{fill:#fff;stroke:var(--series);stroke-width:2}.line-chart .labels text,.activity-chart .labels text{font-size:8px;fill:#7a818b}.chart-legend{display:flex;gap:14px;justify-content:center;margin-top:-4px;font-size:9px;color:#69717c}.chart-legend span{display:flex;align-items:center;gap:5px}.chart-legend i{width:7px;height:7px;border-radius:50%}.chart-note{color:#777f89;font-size:9px;margin:10px 0 0}
.compact-table table{font-size:10px}.compact-table th{font-size:9px;background:#fff;padding:8px;border-color:#e5e7eb}.compact-table td{padding:8px;border-color:#eceef1}.compact-table small{display:block;color:#8a9099;margin-top:3px}.num{text-align:center}.num.red{color:var(--pmk-red);font-weight:700}.num.green{color:#15975c;font-weight:700}
.funnel-chart{display:grid;gap:11px;padding-top:8px}.funnel-chart>div{display:grid;grid-template-columns:120px 1fr 30px;align-items:center;gap:10px;font-size:10px}.funnel-chart>div span{height:10px;background:#edf0f3;border-radius:99px;overflow:hidden}.funnel-chart>div i{display:block;height:100%;background:var(--pmk-red);border-radius:99px}.funnel-chart em{font-style:normal;color:#69717c}.funnel-chart small{font-size:9px;color:#8a9099}
.insight-list{display:grid;gap:8px}.insight{padding:10px 11px;border:1px solid var(--pmk-line);border-left:3px solid;border-radius:7px;font-size:10px;line-height:1.45}.insight.blue{border-left-color:#356fc3;background:#f8fbff}.insight.green{border-left-color:#15975c;background:#f7fcf9}.insight.amber{border-left-color:#e9a217;background:#fffaf1}
.status-summary{display:grid;gap:8px}.status-summary>div{display:flex;justify-content:space-between;padding:11px;border:1px solid #e7e9ed;border-radius:9px}.status-summary b{font-size:11px}.status-summary span{font-size:10px;color:#737b85}.import-summary p{margin:0 0 10px}.import-summary dl{display:grid;gap:6px;margin:0 0 10px}.import-summary dl>div{display:flex;justify-content:space-between;border-bottom:1px solid #eceef1;padding:7px 0}.import-summary dt,.import-summary dd{margin:0;font-size:10px}.import-summary small{color:#777f89;line-height:1.5}.dashboard-footnote{margin:12px 0 0;padding:8px 10px;border:1px solid #f2cbd0;border-radius:7px;background:#fff4f5;color:#8b3a45;font-size:9px}
.panel{box-shadow:none}.toolbar>input{background:#fff}.badge{font-size:9px;padding:3px 7px}.page>.panel{border-radius:11px}
.head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:15px}
.head h2{margin:0 0 4px;font-size:22px;color:var(--pmk-ink);font-weight:700}.head p{margin:0;color:var(--muted);font-size:11px}
.summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}
.summary.grid-3{grid-template-columns:repeat(3,1fr)}
.page-metric, .metric {
    position: relative;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pmk-line);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    cursor: pointer;
    transition: all .2s;
    min-height: 80px;
}
.metric:hover, .page-metric:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.metric span, .page-metric span {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    z-index: 1;
    position: relative;
}
.metric strong, .page-metric b {
    font-size: 26px;
    color: #7c1222;
    font-weight: 800;
    line-height: 1.1;
    z-index: 1;
    position: relative;
    margin-top: 2px;
}
.page-metric i { display: none; }
.metric::after, .page-metric::after {
    content: "";
    position: absolute;
    bottom: -25px;
    right: -25px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #f8fafc;
    z-index: 0;
}
.blue { background: #fff; }
.teal { background: #fff; }
.orange { background: #fff; }
.purple { background: #fff; }
.darkblue { background: #fff; }
.red { background: #fff; }
.green { background: #fff; }
.action-btn-group{display:flex;gap:4px;align-items:center}
.action-btn{border:1px solid var(--pmk-line);background:#fff;border-radius:6px;padding:4px 7px;font-size:12px;cursor:pointer;line-height:1;transition:all .15s}
.action-btn:hover{background:#f0f4f8;border-color:#cfd8e3}
.action-btn.view:hover{background:#eaf4ff;color:#0a84d8;border-color:#b3d7ff}
.action-btn.edit:hover{background:#fff8ea;color:#d97706;border-color:#fcd34d}
.action-btn.delete:hover{background:#fef2f2;color:#dc2626;border-color:#fca5a5}
.detail-item{padding:8px 10px;background:#f9fafb;border-radius:8px;border:1px solid #f0f2f5}
.detail-item label{display:block;font-size:10px;color:var(--muted);margin-bottom:3px;font-weight:600}
.detail-item span{font-size:12px;color:var(--pmk-ink);font-weight:700}
@media(max-width:1100px){.dashboard-heading{grid-template-columns:1fr}.dashboard-filters{grid-template-columns:repeat(3,1fr)}.dashboard-metrics{grid-template-columns:repeat(3,1fr)}.summary{grid-template-columns:repeat(2,1fr)}.summary.grid-3{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.app-shell{display:block}.sidebar{width:250px}.workspace{padding:0 12px 24px}.topbar{margin:0 -12px 14px;padding:0 12px}.dashboard-filters{grid-template-columns:1fr 1fr}.dashboard-filters #dashSource{grid-column:auto}.dashboard-metrics{grid-template-columns:1fr 1fr}.dashboard-metrics .metric{min-height:70px}.dashboard-grid{grid-template-columns:1fr}.dashboard-grid .dashboard-wide{grid-column:auto}.line-chart,.activity-chart{overflow-x:auto}.line-chart svg,.activity-chart svg{min-width:620px}.topbar-meta{display:grid}.summary,.summary.grid-3{grid-template-columns:1fr 1fr}}

/* Complete operational pages from the approved prototype */
.full-data-panel{padding:0;overflow:hidden}.wide-data-table{min-width:2500px;font-size:11px}.wide-data-table th{position:sticky;top:0;z-index:1;background:var(--pmk-red-soft);color:var(--pmk-red);font-size:11px;font-weight:700}.wide-data-table td{white-space:nowrap}.wide-data-table .wrap-cell{white-space:normal;min-width:220px;line-height:1.5}.wide-data-table .row-actions{min-width:150px;flex-wrap:nowrap}
.table-wrap th{background:var(--pmk-red-soft);color:var(--pmk-red);font-weight:700;border-bottom:1px solid #f2cbd0}
tbody tr:nth-child(even){background:#fafbfc}
.calendar-panel{padding:0;overflow:hidden}.week-grid{display:grid;grid-template-columns:repeat(7,minmax(145px,1fr));min-width:1015px}.day-col{min-height:410px;border-right:1px solid var(--pmk-line)}.day-col:last-child{border-right:0}.day-col header{height:62px;padding:11px;border-bottom:1px solid var(--pmk-line);display:grid;gap:3px}.day-col header.today{background:var(--pmk-red-soft);color:var(--pmk-red)}.day-col header small{font-size:10px}.day-col header b{font-size:17px}.day-col>div{padding:8px;display:grid;gap:7px}.day-empty{display:grid;place-items:center;height:90px;color:#9aa1aa}.cal-appt{display:grid;gap:2px;padding:9px;border:1px solid #dce2e9;border-left:3px solid var(--pmk-red);border-radius:8px;background:#fff;font-size:10px}.cal-appt b{font-size:10px}.cal-appt strong{font-size:11px}.cal-appt span,.cal-appt small{color:#66717d}
.month-grid{display:grid;grid-template-columns:repeat(7,minmax(120px,1fr));min-width:840px}.month-name{padding:9px;text-align:center;background:#f7f8fa;border-bottom:1px solid var(--pmk-line)}.month-cell{min-height:115px;padding:8px;border-right:1px solid var(--pmk-line);border-bottom:1px solid var(--pmk-line);display:flex;flex-direction:column;gap:5px}.month-cell.outside{background:#fafbfc;color:#a0a6ad}.month-cell>span{display:block;padding:4px 5px;border-left:2px solid var(--pmk-red);background:#fff3f4;border-radius:4px;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.month-cell small{color:var(--pmk-red)}.view-modes .active{background:var(--pmk-red-soft);border-color:#efb6bd;color:var(--pmk-red)}
.cal-toolbar-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:11px 16px;border-bottom:1px solid var(--pmk-line);background:#fff}
.cal-toolbar-controls{margin-left:auto;justify-content:flex-end}
.cal-date-range-row{gap:12px;justify-content:flex-start;background:#f8fafc;border-top:0}
.cal-date-range-row label{display:grid;gap:5px;font-size:12px;font-weight:700;color:var(--muted);margin:0}
.cal-date-range-row input{min-height:38px;font-size:13px;width:160px}
@media(max-width:720px){.calendar-panel,.full-data-panel{overflow-x:auto}.week-grid{min-width:1015px}.head{align-items:stretch;flex-direction:column}.head .btn{align-self:flex-start}.cal-toolbar-controls{margin-left:0;justify-content:flex-start;width:100%}}

/* Standard-size forms: readable and touch-friendly across the whole system. */
body{font-size:14px;line-height:1.5}
input,select,textarea{
  min-height:44px;
  padding:10px 13px;
  border-radius:9px;
  font-size:14px;
  line-height:1.4;
}
textarea{min-height:104px;resize:vertical}
.login-card label,.form-grid label,.filters label,.dashboard-filters label{
  gap:7px;
  margin-bottom:16px;
  font-size:13px;
  line-height:1.4;
}
.dashboard-filters input,.dashboard-filters select,.dashboard-filters .btn{
  height:44px;
  min-height:44px;
  padding:10px 12px;
  border-radius:9px;
  font-size:13px;
}
.toolbar input,.toolbar select,.filters input,.filters select{min-height:44px;font-size:14px}
.btn{min-height:42px;padding:10px 16px;font-size:14px;line-height:1.3}
.btn.small,.row-actions .btn{min-height:34px;padding:7px 10px;font-size:12px}
.icon-btn{width:42px;height:42px;min-height:42px}
.dialog{
  width:min(1040px,calc(100% - 40px));
  max-height:92vh;
  border-radius:18px;
  overflow:hidden;
}
.dialog.compact{width:min(760px,calc(100% - 40px))}
.dialog form{max-height:92vh;overflow-y:auto;padding:28px 30px}
.dialog-head h2{font-size:22px;line-height:1.3}
.dialog-head p{font-size:13px;line-height:1.5;margin:6px 0 22px}
.form-grid{gap:2px 20px}
fieldset{margin-top:16px;padding:20px;border-radius:13px}
legend{font-size:14px;padding:0 10px}
#jobForm fieldset{background:#fff6f7;border-color:#efc5ca;box-shadow:inset 4px 0 0 rgba(215,25,45,.12)}
#jobForm fieldset legend{color:#a81729;background:#fff6f7;border-radius:6px}
.dialog-actions{gap:10px;margin-top:24px;padding-top:16px;border-top:1px solid var(--border)}
.form-error{font-size:14px}

@media(max-width:720px){
  body{font-size:14px}
  input,select,textarea{min-height:46px;font-size:16px}
  .dashboard-filters input,.dashboard-filters select,.dashboard-filters .btn{height:46px;font-size:14px}
  .dialog{width:calc(100% - 16px);max-height:96vh;border-radius:14px}
  .dialog.compact{width:calc(100% - 16px)}
  .dialog form{max-height:96vh;padding:20px 16px}
  .dialog-head h2{font-size:20px}
  fieldset{padding:16px 12px}
  .btn{min-height:44px}
}

/* Sales register list: larger reading size without compressing 22 columns. */
#page-sales .wide-data-table{min-width:3100px;font-size:14px;line-height:1.5}
#page-sales .wide-data-table th{padding:13px 12px;font-size:13px;line-height:1.35}
#page-sales .wide-data-table td{padding:14px 12px;line-height:1.55}
#page-sales .wide-data-table .wrap-cell{min-width:260px;line-height:1.6}
#page-sales .wide-data-table .badge{padding:5px 10px;font-size:12px}
#page-sales .wide-data-table .row-actions{min-width:250px;gap:8px}
#page-sales .wide-data-table .row-actions .btn{min-height:36px;padding:8px 11px;font-size:12px}
#page-sales .appointment-job:not(.icon-action){display:inline-flex;align-items:center;gap:5px;border-color:#b9d5ee;color:#0069ae;background:#f3f9ff}
#page-sales .appointment-job:not(.icon-action):hover{background:#e6f3ff;border-color:#82b9e4}
#page-sales .appointment-job:not(.icon-action) svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

@media(max-width:720px){
  #page-sales .wide-data-table{font-size:14px}
  #page-sales .wide-data-table th{font-size:13px}
}

/* Larger primary navigation for comfortable scanning and clicking. */
.app-shell{grid-template-columns:228px minmax(0,1fr)}
.sidebar{padding:24px 14px}
.brand{gap:12px;padding:0 6px 28px}
.brand-mark.small{width:44px;height:44px;font-size:12px}
.brand b{font-size:15px;line-height:1.3}
.brand small{font-size:11px;line-height:1.35;margin-top:4px}
.nav{gap:7px}
.nav button{min-height:48px;padding:13px 14px;border-radius:10px;font-size:14px;line-height:1.35}
.sidebar-user{padding:18px 8px 0;gap:7px}
.sidebar-user strong{font-size:14px}
.sidebar-user span{font-size:13px}

@media(max-width:1000px) and (min-width:721px){
  .app-shell{grid-template-columns:220px minmax(0,1fr)}
}
@media(max-width:720px){
  .app-shell{display:block}
  .sidebar{width:280px;padding:24px 16px}
  .nav button{min-height:50px;font-size:15px}
}

/* Dashboard layout aligned with the original prototype. */
.dashboard-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:15px}
.dashboard-heading>div:first-child{flex:0 0 320px}
.dashboard-heading h2{font-size:25px;margin:0 0 5px}
.dashboard-heading>div>p{font-size:14px;line-height:1.5;margin:0;color:var(--muted)}
.dashboard-filters{display:flex;flex:1;flex-wrap:wrap;gap:10px;align-items:flex-end}
.dashboard-filters label{flex:1 1 145px;min-width:145px;max-width:190px;margin:0;font-size:11px;font-weight:700;color:var(--muted)}
.dashboard-filters #dashSource{grid-column:auto}
.dashboard-filters input,.dashboard-filters select{min-width:145px;height:44px;font-size:13px}
.dashboard-metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}
.dashboard-metrics .metric,.dashboard-metrics .metric:nth-child(5),.dashboard-metrics .metric:nth-child(6){min-height:75px;padding:13px;border-radius:12px}
.dashboard-metrics .metric span{font-size:11px}
.dashboard-metrics .metric strong{font-size:20px;margin-top:5px}
.num.blue{color:#356fc3;font-weight:700}

@media(max-width:1100px){
  .dashboard-heading{flex-direction:column}
  .dashboard-heading>div:first-child{flex:0 0 auto}
  .dashboard-filters{width:100%}
  .dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .dashboard-heading h2{font-size:22px}
  .dashboard-filters label{flex:1 1 calc(50% - 5px);min-width:140px;max-width:none}
  .dashboard-filters input,.dashboard-filters select{width:100%;min-width:0}
}

/* ── Column widths: all data tables ── */

/* Sales: 12 columns, scrolls at < 1220px */
#page-sales .wide-data-table{min-width:1220px;table-layout:fixed;width:100%;font-size:13px;line-height:1.45}
#page-sales .wide-data-table th,#page-sales .wide-data-table td{padding:9px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#page-sales .company-contact{min-width:0;white-space:normal}
#page-sales .company-contact b,#page-sales .company-contact small{display:block}
#page-sales .company-contact small{margin-top:3px;color:var(--muted);font-size:12px}
.s30{color:#8b5b00;font-weight:800}.s60{color:#3157a4;font-weight:800}.s90{color:#147a46;font-weight:800}
#page-sales .score-pair,#page-sales .next-date{display:grid;gap:2px;white-space:nowrap}
#page-sales .score-pair b{color:var(--pmk-red)}
#page-sales .score-pair small,#page-sales .next-date small{color:var(--muted);font-size:12px}
#page-sales .money-cell{font-weight:700;white-space:nowrap}
#page-sales .wide-data-table .row-actions{gap:6px;flex-wrap:nowrap}
#page-sales .wide-data-table th:nth-child(1){width:36px}
#page-sales .wide-data-table th:nth-child(2){width:140px}
#page-sales .wide-data-table td:nth-child(2){text-overflow:clip}
#page-sales .wide-data-table th:nth-child(3){width:82px}
#page-sales .wide-data-table th:nth-child(4){width:94px}
#page-sales .wide-data-table th:nth-child(5){width:190px}
#page-sales .wide-data-table th:nth-child(6){width:100px}
#page-sales .wide-data-table th:nth-child(7){width:92px}
#page-sales .wide-data-table th:nth-child(8){width:72px}
#page-sales .wide-data-table th:nth-child(9){width:86px}
#page-sales .wide-data-table th:nth-child(10){width:94px}
#page-sales .wide-data-table th:nth-child(11){width:86px}
#page-sales .wide-data-table th:nth-child(12){width:182px}

/* Users: 7 columns, scrolls at < 800px */
#page-users .wide-data-table{min-width:800px;table-layout:fixed;width:100%;font-size:13px;line-height:1.45}
#page-users .wide-data-table th,#page-users .wide-data-table td{padding:9px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#page-users .wide-data-table td:nth-child(2){white-space:normal}
#page-users .wide-data-table .row-actions{gap:6px;flex-wrap:nowrap}
#page-users .wide-data-table th:nth-child(1){width:36px}
#page-users .wide-data-table th:nth-child(2){width:165px}
#page-users .wide-data-table th:nth-child(3){width:110px}
#page-users .wide-data-table th:nth-child(4){width:100px}
#page-users .wide-data-table th:nth-child(5){width:82px}
#page-users .wide-data-table th:nth-child(6){width:78px}
#page-users .wide-data-table th:nth-child(7){width:250px}

/* Audit: 5 columns, scrolls at < 580px */
#page-audit .wide-data-table{min-width:580px;table-layout:fixed;width:100%;font-size:13px;line-height:1.45}
#page-audit .wide-data-table th,#page-audit .wide-data-table td{padding:9px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#page-audit .wide-data-table th:nth-child(1){width:36px}
#page-audit .wide-data-table th:nth-child(2){width:140px}
#page-audit .wide-data-table th:nth-child(3){width:130px}
#page-audit .wide-data-table th:nth-child(4){width:160px}
.icon-action{width:41px;height:40px;min-height:40px;padding:0;display:inline-grid;place-items:center;border:1px solid transparent;border-radius:10px;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.04);transition:transform .15s,box-shadow .15s,background .15s,border-color .15s,color .15s}
.icon-action.view-job, .icon-action.view-production{color:#1769a8;background:#edf7ff;border-color:#cde7fa}
.icon-action.edit-job, .icon-action.edit-user, .icon-action.edit-production{color:#a55b08;background:#fff8e9;border-color:#f5dfb5}
.icon-action.appointment-job, .icon-action.activate-user{color:#087e78;background:#eaf9f7;border-color:#bfe8e3}
.icon-action.delete-job, .icon-action.delete-user, .icon-action.suspend-user{color:#b62b3b;background:#fff1f3;border-color:#f3cbd1}
.icon-action:hover{transform:translateY(-1px);box-shadow:0 5px 12px rgba(15,23,42,.1)}
.icon-action.view-job:hover, .icon-action.view-production:hover{background:#dff1ff;border-color:#91c9ef;color:#075f9e}
.icon-action.edit-job:hover, .icon-action.edit-user:hover, .icon-action.edit-production:hover{background:#fff0d2;border-color:#eac477;color:#8a4800}
.icon-action.appointment-job:hover, .icon-action.activate-user:hover{background:#d9f3ef;border-color:#79cec4;color:#006b65}
.icon-action.delete-job:hover, .icon-action.delete-user:hover, .icon-action.suspend-user:hover{background:#ffe3e7;border-color:#e999a4;color:#9f1729}
.icon-action:active{transform:translateY(0);box-shadow:inset 0 1px 3px rgba(15,23,42,.12)}
.icon-action:focus-visible{outline:3px solid rgba(10,132,216,.22);outline-offset:2px}
.icon-action svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
#viewJobDialog[open]{display:flex;flex-direction:column;max-height:92vh;overflow:hidden}
#viewJobDialog>div{display:flex;flex-direction:column;height:100%;overflow:hidden}
#viewJobDialog .dialog-head{flex-shrink:0;padding:20px 24px 16px;border-bottom:1px solid var(--pmk-line);background:#fff;position:sticky;top:0;z-index:2}
#viewJobDetails{flex:1;overflow-y:auto;min-height:0}
#viewJobDetails{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px 12px!important;padding:12px 24px!important}
.detail-section-title{grid-column:1/-1;margin:10px 0 2px;padding:8px 0 6px;border-bottom:1px solid var(--pmk-line);font-size:13px;font-weight:700;color:var(--pmk-ink)}
.detail-section-title:first-child{margin-top:0}
.detail-highlight-box{grid-column:1/-1;border-radius:12px;padding:12px 14px;margin-bottom:4px}
.detail-highlight-box.red{border:1px solid #f0c7cc;border-left:4px solid var(--pmk-red);background:#fff8f9}
.detail-highlight-box.yellow{border:1px solid #e8d96a;border-left:4px solid #d4a700;background:#fffde7}
.detail-highlight-title{font-weight:800;font-size:12px;margin-bottom:8px;text-transform:uppercase;letter-spacing:.4px}
.detail-highlight-box.red .detail-highlight-title{color:#8f1d29}
.detail-highlight-box.yellow .detail-highlight-title{color:#7a5500}
.detail-highlight-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.appt-highlight-box{grid-column:1/-1;border:1px solid #f0c7cc;border-left:4px solid var(--pmk-red);border-radius:12px;background:#fff8f9;padding:14px 16px}
.appt-highlight-title{font-weight:800;color:#8f1d29;font-size:14px;display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.appt-date-pill{font-weight:700;font-size:12px;background:var(--pmk-red);color:#fff;padding:3px 10px;border-radius:999px}
.appt-no-date{font-weight:400;font-size:12px;color:var(--muted);background:#f3d6da;padding:2px 9px;border-radius:999px}
.appt-highlight-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
@media(max-width:720px){.appt-highlight-fields{grid-template-columns:1fr 1fr}}
.detail-item{padding:6px 10px;background:transparent;border:0;border-bottom:1px solid #f0f2f5}
.detail-item label{font-size:11px;margin-bottom:2px;color:#8a95a3}
.detail-item span{font-size:13px;line-height:1.4;overflow-wrap:anywhere;font-weight:700;color:#8f1d29}
.detail-wide{grid-column:1/-1}
.button-icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px;margin-right:6px}
#viewJobDialog .view-detail-actions{position:sticky;bottom:0;flex-shrink:0;padding:14px 24px;background:#fff;border-top:1px solid var(--pmk-line);box-shadow:0 -6px 16px rgba(17,24,39,.05);display:flex;gap:8px;justify-content:flex-end;z-index:2}
#viewProductionDialog[open]{display:flex;flex-direction:column;max-height:92vh;overflow:hidden}
#viewProductionDialog>div{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
#viewProductionDialog{width:min(980px,calc(100% - 28px));border-radius:16px}
#viewProductionDialog .dialog-head{flex-shrink:0;align-items:center;padding:15px 17px!important;border-bottom:1px solid var(--pmk-line);background:#fff;z-index:2}
#viewProductionDialog .dialog-head h2{font-size:18px;line-height:1.3}
#viewProductionDialog .dialog-head p{margin:3px 0 0;font-size:11px}
.production-close-btn{min-height:32px;padding:6px 10px;border:2px solid #20242a;border-radius:10px;background:#fff;color:#20242a;font-size:12px;font-weight:600;cursor:pointer}
.production-close-btn:hover{background:#f6f7f9}
.production-close-btn:focus-visible{outline:3px solid rgba(215,25,45,.18);outline-offset:2px}
#viewProdDetails{flex:1;min-height:0;overflow-y:auto;padding:18px;background:#f7f9fb}
.production-detail-overview{padding:18px;border:1px solid #dfe6ed;border-radius:14px;background:#fff}
.production-detail-overview>h3{margin:0 0 14px;padding-bottom:11px;border-bottom:1px solid #e8edf2;color:var(--navy);font-size:16px;line-height:1.35}
.production-detail-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;font-size:13px;line-height:1.45}
.production-detail-item{min-width:0;padding:11px 12px;border:1px solid #e5eaf0;border-radius:10px;background:#fafbfd}
.production-detail-item.follow-up{grid-column:span 2}
.production-detail-item.money{background:#f1f8fd;border-color:#d6e8f5}
.production-detail-label{display:block;margin-bottom:5px;color:var(--muted);font-size:11px;font-weight:500}
.production-detail-value{min-width:0;color:var(--pmk-ink);font-size:13px;font-weight:650;overflow-wrap:anywhere}
.production-detail-item.money .production-detail-value{color:#0069ae;font-size:16px;font-weight:750}
.production-detail-badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;line-height:1.25;white-space:nowrap}
.production-detail-badge.production{background:#f0eaff;color:#6741a5}
.production-detail-badge.finance{background:#fff2d7;color:#8b5b00}
.production-detail-badge.order{background:#e9efff;color:#3157a4}
.production-detail-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
.production-detail-card{min-width:0;padding:16px;border:1px solid #dfe6ed;border-radius:14px;background:#fff;box-shadow:0 5px 16px rgba(25,30,40,.04)}
.production-detail-card h3{margin:18px 0 8px;color:var(--navy);font-size:15px;line-height:1.35}
.production-detail-card h3:first-child{margin-top:0}
.production-detail-card p{margin:0;white-space:pre-wrap;color:var(--pmk-ink);font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.production-detail-muted{color:var(--muted);font-size:12px}
.production-detail-actions{display:flex;justify-content:flex-end;margin-top:14px}
.production-detail-edit{min-width:132px}

#productionEditDialog[open]{display:flex;flex-direction:column;max-height:94vh;overflow:hidden}
#productionEditDialog{width:min(980px,calc(100% - 28px));border-radius:16px}
#productionEditDialog form{display:flex;flex-direction:column;width:100%;height:100%;max-height:94vh;padding:0;overflow:hidden}
#productionEditDialog .dialog-head{flex-shrink:0;align-items:center;padding:15px 17px;border-bottom:1px solid var(--pmk-line);background:#fff;z-index:2}
#productionEditDialog .dialog-head h2{font-size:18px;line-height:1.3}
.production-edit-body{flex:1;min-height:0;overflow-y:auto;padding:17px;background:#fff}
.production-edit-note{margin-bottom:14px;padding:10px 12px;border:1px solid #f3cbd1;border-radius:10px;background:#fff5f6;color:#8f1d29;font-size:12px;line-height:1.5}
.production-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
.production-edit-grid label,.production-edit-three label{display:grid;gap:6px;margin:0;color:#555;font-size:12px;line-height:1.4}
.production-edit-grid input,.production-edit-grid select,.production-edit-grid textarea,.production-edit-three input,.production-edit-three select{min-height:40px;padding:8px 10px;border-radius:8px;font-size:13px}
.production-edit-grid input[readonly],.production-edit-three input[readonly]{background:#f5f6f8;color:#5f6670}
.production-edit-grid textarea{min-height:82px;resize:vertical}
.production-edit-wide{grid-column:1/-1}
.production-edit-section{margin:14px 0 0;padding:13px;border-radius:12px}
.production-edit-section legend{padding:0 7px;font-size:15px;font-weight:800}
.production-edit-section legend span{margin-left:5px;color:var(--muted);font-size:11px;font-weight:400}
.production-edit-three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.production-appointment-section{border-color:#cbd7f5;background:#f7f9ff}
.production-appointment-section legend{color:#8f1d29}
.production-finance-section{border-color:#ead9a5;background:#fffdf6}
.production-finance-section legend{color:#7a5900}
#productionEditError{margin:12px 0 0}
.production-edit-actions{flex-shrink:0;margin:0;padding:13px 17px;border-top:1px solid var(--pmk-line);background:#fff;z-index:2}

@media(max-width:720px){
  #viewProductionDialog{width:calc(100% - 16px)}
  #viewProductionDialog .dialog-head{padding:13px 14px!important;align-items:flex-start}
  #viewProductionDialog .dialog-head h2{font-size:17px}
  #viewProdDetails{padding:12px}
  .production-detail-overview{padding:14px}
  .production-detail-list{grid-template-columns:1fr;gap:8px}
  .production-detail-item.follow-up{grid-column:auto}
  .production-detail-cards{grid-template-columns:1fr;gap:10px;margin-top:10px}
  .production-detail-card{padding:14px}
  #productionEditDialog{width:calc(100% - 16px);max-height:96vh}
  #productionEditDialog form{max-height:96vh}
  #productionEditDialog .dialog-head{padding:13px 14px}
  .production-edit-body{padding:14px}
  .production-edit-grid,.production-edit-three{grid-template-columns:1fr}
  .production-edit-wide{grid-column:auto}
  .production-edit-section legend span{display:block;margin:2px 0 0}
  .production-edit-actions{padding:12px 14px}
}

/* Central option management */
.option-add-panel{display:grid;grid-template-columns:minmax(210px,.7fr) minmax(520px,2fr);gap:24px;align-items:center;padding-left:18px;border-left:4px solid var(--pmk-red)}
.option-add-panel h2{font-size:20px;margin:0 0 5px}.option-add-panel>div>p{margin:0;color:var(--muted);font-size:13px}
.option-add-form{display:grid;grid-template-columns:minmax(190px,.8fr) minmax(230px,1.2fr) auto;gap:12px;align-items:end}
.option-add-form label{margin:0}.option-add-form label span{display:block;margin-bottom:6px;color:var(--muted);font-size:12px;font-weight:600}
.option-add-form select,.option-add-form input{width:100%;min-height:42px}.option-add-form .btn{min-height:42px;white-space:nowrap}
.option-add-form .form-error{grid-column:1/-1;margin:0}
.option-groups-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.option-group-card{min-width:0;background:#fff;border:1px solid var(--border);border-radius:14px;padding:18px;box-shadow:0 3px 12px rgba(14,43,71,.04)}
.option-group-card header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.option-group-card h3{margin:0;color:var(--navy);font-size:15px}.option-group-card header>span{color:#9f1729;background:#fff0f2;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:700;white-space:nowrap}
.option-chip-list{display:flex;flex-wrap:wrap;gap:7px;padding-top:14px;min-height:46px}
.option-chip{display:inline-flex;align-items:center;gap:7px;max-width:100%;min-height:32px;padding:6px 7px 6px 10px;border:1px solid #f0d4d8;border-radius:9px;background:#fff8f9;color:#49282d;font:inherit;font-size:12px;cursor:pointer;transition:.15s}
.option-chip span{overflow-wrap:anywhere;text-align:left}.option-chip b{display:grid;place-items:center;width:18px;height:18px;border-radius:6px;color:#b52b3b;background:#fff;font-size:15px;line-height:1}
.option-chip:hover{border-color:#efb6bd;background:#fff4f5}.option-chip:hover b{background:#fee4e8;color:#9f1729}
.option-chip.readonly{cursor:default}.option-chip.readonly small{color:var(--muted);font-size:10px}.option-chip.readonly.inactive{opacity:.48;text-decoration:line-through}
.option-empty{color:var(--muted);font-size:12px;padding:5px 0}.option-card-note{margin:12px 0 0;color:var(--muted);font-size:11px}
.inactive-options{margin-top:12px;border-top:1px dashed var(--border);padding-top:10px}.inactive-options summary{color:var(--muted);font-size:11px;cursor:pointer}.inactive-options>div{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.inactive-options button{border:1px solid #c9e7dc;border-radius:8px;background:#edf9f4;color:#147a5c;padding:5px 9px;font:inherit;font-size:11px;cursor:pointer}.inactive-options button:hover{background:#dcf3e9;border-color:#8fcdb7}
#page-options>.panel{position:relative;overflow:hidden;padding:24px;border:1px solid rgba(255,255,255,.14);border-radius:18px;background:linear-gradient(135deg,#870b19 0%,#a80f20 56%,#bd172b 100%);box-shadow:0 12px 28px rgba(123,8,24,.18)}
#page-options>.panel::after{content:"";position:absolute;right:-70px;top:-105px;width:190px;height:190px;border-radius:50%;background:rgba(255,255,255,.07);pointer-events:none}
#page-options .option-add-panel{position:relative;z-index:1;grid-template-columns:minmax(230px,.75fr) minmax(0,2.25fr);gap:28px;align-items:start;padding:0;border:0}
#page-options .option-add-panel>div{padding-top:27px}
#page-options .option-add-panel h2{margin:0;color:#fff;font-size:21px;line-height:1.25;letter-spacing:-.2px}
#page-options .option-add-panel>div>p{margin-top:7px;line-height:1.5}
#page-options .option-add-panel>div>p,#page-options .option-add-form label span{color:rgba(255,255,255,.84)}
#page-options .option-add-form{grid-template-columns:minmax(220px,.8fr) minmax(280px,1.25fr) minmax(96px,auto);gap:12px}
#page-options .option-add-form label span{margin-bottom:7px;font-size:12px;font-weight:600}
#page-options .option-add-form select,#page-options .option-add-form input{height:48px;min-height:48px;padding:10px 14px;border:1px solid rgba(255,255,255,.78);border-radius:12px;background:rgba(255,255,255,.98);font-size:14px;box-shadow:0 3px 10px rgba(65,0,10,.1)}
#page-options .option-add-form select:focus,#page-options .option-add-form input:focus{border-color:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.22),0 4px 14px rgba(65,0,10,.12)}
#page-options .option-add-form .btn{height:48px;min-height:48px;min-width:96px;padding:0 18px;border-radius:12px;box-shadow:0 4px 12px rgba(65,0,10,.16);transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
#page-options .option-add-form .form-error{color:#ffe5e8}
#page-options .btn.primary{background:#fff;color:#a80f20}
#page-options .btn.primary:hover{transform:translateY(-1px);background:#fff1f3;color:#870b19;box-shadow:0 7px 16px rgba(65,0,10,.2)}
#page-options .option-group-card:hover{border-color:#efc4ca;box-shadow:0 6px 18px rgba(143,29,41,.07)}

/* Readable operational type for production and summary pages. */
#page-production .head h2,#page-summary .head h2{font-size:24px}
#page-production .head p,#page-summary .head p{font-size:14px;line-height:1.5}
#page-production .page-metric,#page-summary .page-metric{padding:16px 18px;gap:7px;min-height:76px}
#page-production .page-metric span,#page-summary .page-metric span{font-size:13px}
#page-production .page-metric b,#page-summary .page-metric b{font-size:23px;line-height:1.15}
#page-production .dashboard-footnote{padding:11px 13px;font-size:12px;line-height:1.55}
#page-production .wide-data-table{font-size:13px;line-height:1.45;min-width:820px;table-layout:fixed;width:100%}
#page-production .wide-data-table th{padding:9px 10px;font-size:12px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#page-production .wide-data-table td{padding:8px 10px;line-height:1.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#page-production .wide-data-table .badge{padding:3px 8px;font-size:11px}
#page-production .wide-data-table th:nth-child(1){width:36px}
#page-production .wide-data-table th:nth-child(2){width:88px}
#page-production .wide-data-table th:nth-child(3){width:88px}
#page-production .wide-data-table th:nth-child(4){width:140px}
#page-production .wide-data-table th:nth-child(5){width:110px}
#page-production .wide-data-table th:nth-child(6){width:90px}
#page-production .wide-data-table th:nth-child(7){width:96px}
#page-production .wide-data-table th:nth-child(8),#page-production .wide-data-table td:nth-child(8){display:none}
#page-production .wide-data-table th:nth-child(9),#page-production .wide-data-table td:nth-child(9){display:none}
#page-production .wide-data-table th:nth-child(10),#page-production .wide-data-table td:nth-child(10){display:none}
#page-production .wide-data-table th:nth-child(11),#page-production .wide-data-table td:nth-child(11){display:none}
#page-production .wide-data-table th:nth-child(12),#page-production .wide-data-table td:nth-child(12){display:none}
#page-production .wide-data-table th:nth-child(13){width:100px}
#page-production .wide-data-table th:nth-child(14){width:90px}
#page-production .wide-data-table th:nth-child(15){width:90px}
#page-production .wide-data-table th:nth-child(16){width:96px}
#page-production .page-metric,#page-summary .page-metric{padding:11px 14px;min-height:60px}
#page-production .page-metric b,#page-summary .page-metric b{font-size:19px}
#page-prospects .wide-data-table{font-size:13px;line-height:1.4;min-width:680px;table-layout:fixed;width:100%}
#page-prospects .wide-data-table th{padding:8px 10px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page-prospects .wide-data-table td{padding:7px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page-prospects .wide-data-table th:nth-child(1){width:36px}
#page-prospects .wide-data-table th:nth-child(2){width:200px}
#page-prospects .wide-data-table th:nth-child(3){width:130px}
#page-prospects .wide-data-table th:nth-child(4){width:110px}
#page-prospects .wide-data-table th:nth-child(5){width:170px}
#page-prospects .wide-data-table th:nth-child(6){width:100px}
#page-prospects .wide-data-table th:nth-child(7){width:100px}
#page-summary .panel{padding:22px}
#page-summary .panel-head h2{font-size:18px}
#page-summary .status-summary{gap:10px}
#page-summary .status-summary>div{padding:14px 15px;border-radius:10px;align-items:center}
#page-summary .status-summary b{font-size:14px;line-height:1.4}
#page-summary .status-summary span{font-size:13px}

/* Summary page: quiet white/gray cards with restrained PMK-red emphasis. */
#page-summary .summary .page-metric{background:#fff;border:1px solid #dfe3e8;cursor:default;box-shadow:0 2px 6px rgba(0,0,0,.02)}
#page-summary .summary .page-metric span{color:#677481}
#page-summary .summary .page-metric b{color:#7c1222}
#page-summary .summary .page-metric::after{background:#f4f5f7}
#page-summary .summary .page-metric:hover{border-color:#d2d7de;box-shadow:0 5px 14px rgba(0,0,0,.05)}
#page-summary .panel-head h2{display:flex;align-items:center;gap:9px;color:var(--pmk-ink)}
#page-summary .panel-head h2::before{content:"";width:4px;height:20px;border-radius:4px;background:var(--pmk-red)}
#page-summary .status-summary>div{background:#fafbfc;border-color:#e1e4e8}
#page-summary .status-summary span{min-width:64px;text-align:right;font-weight:700;color:#7c1222}

@media(max-width:720px){
  #page-sales .wide-data-table{min-width:1000px}
  #page-users .wide-data-table{min-width:680px}
  #page-audit .wide-data-table{min-width:480px}
  #page-prospects .wide-data-table{min-width:540px}
  #page-production .wide-data-table{min-width:700px}
  #viewJobDetails,#viewProdDetails{grid-template-columns:1fr!important}
  .detail-section-title,.detail-wide{grid-column:auto}
  #viewJobDialog .view-detail-actions{padding:12px 16px;flex-wrap:wrap}
  .option-add-panel{grid-template-columns:1fr;gap:16px}.option-add-form{grid-template-columns:1fr}.option-groups-grid{grid-template-columns:1fr}
  #page-options>.panel{padding:18px;border-radius:15px}
  #page-options .option-add-panel{grid-template-columns:1fr;gap:18px}
  #page-options .option-add-panel>div{padding-top:0}
  #page-options .option-add-form{grid-template-columns:1fr}
  #page-options .option-add-form .btn{width:100%}
  #page-production .head h2,#page-summary .head h2{font-size:22px}
  #page-production .page-metric,#page-summary .page-metric{padding:14px;min-height:72px}
  #page-production .page-metric b,#page-summary .page-metric b{font-size:21px}
}

@media(min-width:721px) and (max-width:1100px){.option-groups-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.option-add-panel{grid-template-columns:1fr}.option-add-form{grid-template-columns:1fr 1fr auto}#page-options .option-add-panel{grid-template-columns:1fr;gap:18px}#page-options .option-add-panel>div{padding-top:0}}

/* Consistent numbered lists and 30-row pagination. */
th.sequence-heading,.row-number{width:68px;min-width:68px;text-align:center;white-space:nowrap}
td.row-number{color:#64748b;font-weight:700;font-variant-numeric:tabular-nums}
th.company-heading{color:var(--pmk-red)!important;font-weight:800}
.company-contact>b,.company-name-cell>b,#productionRows td:nth-child(4)>b,#prospectRows td:nth-child(2)>b,#followUpRows td:nth-child(2)>b{color:inherit!important;font-weight:normal}
.list-pagination{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:14px 16px;border-top:1px solid var(--pmk-line);background:#fff;color:var(--muted);font-size:13px}
.list-pagination[hidden]{display:none!important}
.list-pagination>div{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.list-pagination button{min-width:38px;min-height:36px;padding:7px 11px;border:1px solid #d7dee7;border-radius:8px;background:#fff;color:var(--navy);font:inherit;font-weight:700;cursor:pointer}
.list-pagination button:hover:not(:disabled){border-color:#87bde5;background:#eef8ff;color:#0069ae}
.list-pagination button.active{border-color:var(--blue);background:var(--blue);color:#fff}
.list-pagination button:disabled{opacity:.45;cursor:not-allowed}
.page-gap{padding:0 3px;color:#94a3b8}
#appointmentList{padding:12px 14px;display:grid;gap:8px}
#appointmentList .appointment{
  grid-template-columns:38px 132px minmax(0,1fr) auto;
  align-items:center;gap:0 16px;
  min-height:78px;padding:12px 16px;
  border:1px solid #dfe7ef;
  border-left:4px solid var(--pmk-red);
  border-radius:11px;background:#fff;
  box-shadow:0 2px 7px rgba(15,43,69,.035);
  transition:box-shadow .15s,border-color .15s,transform .15s
}
#appointmentList .appointment:hover{box-shadow:0 6px 16px rgba(15,43,69,.09);border-color:#efb6bd;transform:translateY(-1px)}
#appointmentList .appointment-sequence{
  width:34px;height:34px;border-radius:10px;
  background:#fff0f2;color:var(--pmk-red);
  font-size:12px;font-weight:700;
  display:grid;place-items:center;flex-shrink:0
}
#appointmentList .appointment time{
  display:grid;gap:4px;line-height:1.3;
  font-size:12px;font-weight:400;color:var(--pmk-ink);
  border-right:1px solid #e3e9ef;padding-right:16px
}
#appointmentList .appointment time strong{font-size:13px;font-weight:650;color:var(--navy)}
#appointmentList .appointment time span{width:max-content;padding:3px 7px;border-radius:6px;background:#f1f6fa;color:#526273;font-weight:600}
#appointmentList .appointment-detail{min-width:0}
#appointmentList .appointment-title{display:flex;align-items:center;gap:8px;min-width:0;margin-bottom:5px}
#appointmentList .appointment h3{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:650;margin:0;color:var(--navy)}
#appointmentList .appointment-type{flex:0 0 auto;padding:3px 8px;border-radius:999px;background:#fff0f2;color:var(--pmk-red);font-size:10px;font-weight:600}
#appointmentList .appointment p{font-size:12px;color:var(--muted);margin:0;line-height:1.45}
#appointmentList .appointment-actions{display:flex;flex-direction:column;align-items:flex-end;gap:7px;min-width:92px}
#appointmentList .appointment-actions .badge{font-size:10px;padding:4px 8px;font-weight:600}
#appointmentList .cancel-appt{font-size:11px;font-weight:500;padding:4px 9px;min-height:28px;border-radius:7px;color:#526273}
#appointmentList .edit-appt{font-size:11px;font-weight:600;padding:4px 9px;min-height:28px;border-radius:7px;color:#0069ae;border-color:#b9d8ee;background:#eef8ff}
#appointmentList .edit-appt:hover{background:#dff1ff;border-color:#91c9ef}
#appointmentList .appointment-today{background:#a80f20;border-color:#a80f20;box-shadow:0 6px 16px rgba(123,8,24,.24)}
#appointmentList .appointment-today:hover{background:#8e0b19;border-color:#8e0b19;box-shadow:0 8px 20px rgba(123,8,24,.3)}
#appointmentList .appointment-today .appointment-sequence{background:rgba(255,255,255,.18);color:#fff}
#appointmentList .appointment-today time{border-right-color:rgba(255,255,255,.3);color:#fff}
#appointmentList .appointment-today time strong,#appointmentList .appointment-today h3,#appointmentList .appointment-today p{color:#fff}
#appointmentList .appointment-today time span,#appointmentList .appointment-today .appointment-type,#appointmentList .appointment-today .badge{background:rgba(255,255,255,.16);color:#fff}
#appointmentList .appointment-today .cancel-appt{background:#fff;border-color:#fff;color:var(--pmk-red)}
#appointmentList .appointment-today .edit-appt{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.5);color:#fff}
.appointment-list .appointment{grid-template-columns:44px 130px 1fr auto;align-items:start}
.appointment-sequence{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#eaf6ff;color:#0069ae;font-weight:800;font-variant-numeric:tabular-nums}

@media(max-width:720px){
  .list-pagination{align-items:stretch;flex-direction:column}
  .list-pagination>div{justify-content:space-between}
  .appointment-list .appointment{grid-template-columns:42px 1fr}
  .appointment-list .appointment>div:last-child{grid-column:2}
  #appointmentList .appointment{grid-template-columns:30px 1fr;row-gap:8px}
  #appointmentList .appointment time{border-right:0;padding-right:0;grid-column:2}
  #appointmentList .appointment-title{align-items:flex-start;flex-direction:column;gap:5px}
  #appointmentList .appointment h3{white-space:normal}
  #appointmentList .appointment-actions{grid-column:2;flex-direction:row;align-items:center;flex-wrap:wrap}
}

/* Dashboard readability and restrained semantic color. */
#page-dashboard .dashboard-heading{flex-direction:column;gap:12px;margin-bottom:16px}
#page-dashboard .dashboard-heading>div:first-child{flex:0 0 auto}
#page-dashboard .dashboard-heading h2{font-size:28px;line-height:1.25;color:var(--navy)}
#page-dashboard .dashboard-heading>div>p{font-size:15px;line-height:1.6;color:#5f6f7e}
#page-dashboard .dashboard-filters{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:11px;width:100%;max-width:1080px}
#page-dashboard .dashboard-filters label{min-width:0;max-width:none;font-size:11px;font-weight:500;line-height:1.3;color:#526273}
#page-dashboard .dashboard-filters input,#page-dashboard .dashboard-filters select{min-width:0;height:42px;min-height:42px;padding:8px 10px;font-size:13px;font-weight:400;border-color:#cfd9e4;background:#fff}
#page-dashboard .dashboard-metrics{gap:12px;margin-bottom:18px}
#page-dashboard .dashboard-metrics .metric,#page-dashboard .dashboard-metrics .metric:nth-child(5),#page-dashboard .dashboard-metrics .metric:nth-child(6){position:relative;min-height:104px;padding:18px 19px;border:0;color:#fff;border-radius:14px;box-shadow:0 7px 18px rgba(15,43,69,.12)}
#page-dashboard .dashboard-metrics .metric:after{display:block;width:86px;height:86px;right:-24px;bottom:-28px;background:rgba(255,255,255,.14)}
#page-dashboard .dashboard-metrics .metric:nth-child(1){background:#168be5!important}
#page-dashboard .dashboard-metrics .metric:nth-child(2){background:#1597a2!important}
#page-dashboard .dashboard-metrics .metric:nth-child(3){background:#f28a00!important}
#page-dashboard .dashboard-metrics .metric:nth-child(4){background:#7049e8!important}
#page-dashboard .dashboard-metrics .metric:nth-child(5){background:#0069ae!important}
#page-dashboard .dashboard-metrics .metric:nth-child(6){background:#c9495b!important}
#page-dashboard .dashboard-metrics .metric span{position:relative;z-index:1;font-size:13px;line-height:1.4;color:rgba(255,255,255,.9)}
#page-dashboard .dashboard-metrics .metric strong{position:relative;z-index:1;font-size:27px;line-height:1.15;margin-top:8px;color:#fff}
#page-dashboard .dashboard-grid{gap:16px}
#page-dashboard .dashboard-grid .panel{padding:20px;border-radius:14px;border-color:#dce4ec;box-shadow:0 4px 13px rgba(15,43,69,.055)}
#page-dashboard .dashboard-grid .panel-head{margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid #e8edf2}
#page-dashboard .dashboard-grid .panel h2{display:flex;align-items:center;gap:9px;font-size:18px;line-height:1.4;color:var(--navy)}
#page-dashboard .dashboard-grid .panel h2:before{content:"";width:5px;height:20px;flex:0 0 5px;border-radius:5px;background:#168be5}
#page-dashboard .dashboard-grid .panel:nth-child(2n) h2:before{background:#1597a2}
#page-dashboard .dashboard-grid .panel:nth-child(3n) h2:before{background:#f28a00}
#page-dashboard .line-chart .labels text,#page-dashboard .activity-chart .labels text{font-size:10px;fill:#526273}
#page-dashboard .value-badge rect{fill:#fff;stroke:none}
#page-dashboard .line-chart .value-label,#page-dashboard .activity-chart .value-label{font-size:13px;font-weight:900;fill:var(--series)}
#page-dashboard .chart-legend{gap:18px;font-size:12px;color:#526273}
#page-dashboard .chart-legend i{width:9px;height:9px}
#page-dashboard .chart-note{font-size:13px;line-height:1.5;color:#637282}
#page-dashboard .compact-table table{font-size:13px;line-height:1.45}
#page-dashboard .compact-table th{padding:11px 10px;font-size:12px;background:#f3f7fa;color:#526273}
#page-dashboard .compact-table td{padding:11px 10px}
#page-dashboard #trendRows tr:nth-child(odd)>td{background:#fff}
#page-dashboard #trendRows tr:nth-child(even)>td{background:#f7f9fb}
#page-dashboard #trendRows tr:hover>td{background:#f1f5f8}
#page-dashboard .compact-table small{font-size:11px;line-height:1.45}
#page-dashboard .funnel-chart{gap:15px;padding-top:6px}
#page-dashboard .funnel-chart>div{grid-template-columns:145px 1fr 40px;gap:12px;font-size:14px}
#page-dashboard .funnel-chart>div span{height:13px}
#page-dashboard .funnel-chart>div:nth-child(1) i{background:#168be5}
#page-dashboard .funnel-chart>div:nth-child(2) i{background:#f28a00}
#page-dashboard .funnel-chart>div:nth-child(3) i{background:#18a675}
#page-dashboard .funnel-chart em{font-weight:700;color:#34485b}
#page-dashboard .funnel-chart small{font-size:12px;line-height:1.5;color:#677481}
#page-dashboard .insight-list{gap:10px}
#page-dashboard .insight{padding:13px 14px;border-left-width:4px;border-radius:9px;font-size:13px;line-height:1.55}
#page-dashboard .insight.blue{background:#eef8ff}
#page-dashboard .insight.green{background:#edf9f4}
#page-dashboard .insight.amber{background:#fff7e8}
#page-dashboard .status-summary{gap:10px}
#page-dashboard .status-summary>div{padding:13px 14px;border-radius:10px;background:#f8fafc}
#page-dashboard .status-summary b{font-size:13px;line-height:1.4}
#page-dashboard .status-summary span{font-size:13px;font-weight:700;color:#0069ae}
#page-dashboard .import-summary{font-size:13px;line-height:1.55}
#page-dashboard .import-summary dl>div{padding:10px 0}
#page-dashboard .import-summary dt,#page-dashboard .import-summary dd{font-size:13px}
#page-dashboard .import-summary dd{font-weight:800;color:#0069ae}
#page-dashboard .import-summary small{font-size:12px}
#page-dashboard>.dashboard-footnote{padding:12px 14px;border-radius:9px;font-size:12px;line-height:1.55}

@media(max-width:1100px){
  #page-dashboard .dashboard-filters{grid-template-columns:repeat(3,minmax(140px,160px))}
}
@media(max-width:720px){
  #page-dashboard .dashboard-heading h2{font-size:24px}
  #page-dashboard .dashboard-heading>div>p{font-size:14px}
  #page-dashboard .dashboard-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  #page-dashboard .dashboard-filters label{min-width:0;max-width:none}
  #page-dashboard .dashboard-metrics .metric,#page-dashboard .dashboard-metrics .metric:nth-child(5),#page-dashboard .dashboard-metrics .metric:nth-child(6){min-height:94px;padding:15px}
  #page-dashboard .dashboard-metrics .metric strong{font-size:23px}
  #page-dashboard .dashboard-grid .panel{padding:16px}
  #page-dashboard .dashboard-grid .panel h2{font-size:17px}
  #page-dashboard .line-chart .value-label,#page-dashboard .activity-chart .value-label{font-size:14px}
}

/* Personal profile settings. */
.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:1050px}
.profile-card{display:flex;flex-direction:column;gap:13px;min-width:0;padding:22px;border:1px solid #dce5ed;border-radius:15px;background:#fff;box-shadow:0 4px 14px rgba(15,43,69,.05)}
.profile-card-head{display:flex;align-items:center;gap:12px;padding-bottom:15px;border-bottom:1px solid #e8edf2}
.profile-card-head h3{margin:0;color:var(--navy);font-size:18px}
.profile-card-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
.profile-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:11px;background:#eaf6ff;color:#0069ae;font-size:12px;font-weight:750}
.profile-icon.secure{background:#edf9f4;color:#087e58}
.profile-card label{display:grid;gap:6px;margin:0;color:#526273;font-size:12px;font-weight:600}
.profile-card input{min-height:42px;font-size:13px}
.profile-readonly-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.profile-readonly-grid label:first-child{grid-column:1/-1}
.profile-readonly-grid input[readonly]{background:#f4f7f9;color:#5c6b78}
.profile-actions{display:flex;justify-content:flex-end;margin-top:auto;padding-top:3px}
.profile-actions .btn{min-width:150px}

@media(max-width:820px){
  .profile-grid{grid-template-columns:1fr}
}
@media(max-width:480px){
  .profile-card{padding:16px}
  .profile-readonly-grid{grid-template-columns:1fr}
  .profile-readonly-grid label:first-child{grid-column:auto}
  .profile-actions .btn{width:100%}
}

/* Remove the redundant desktop top bar; page sections already contain their own titles. */
.topbar{display:none!important}
.workspace>.page{padding-top:24px}

@media(max-width:720px){
  .topbar{display:flex!important;min-height:52px;margin:0;padding:8px 0;background:transparent;border:0}
  .topbar>div,.topbar-meta{display:none!important}
  .topbar .menu-btn{display:block;width:44px;height:40px;border:1px solid #d7e0e8;border-radius:9px;background:#fff;color:var(--navy)}
  .workspace>.page{padding-top:4px}
}
