:root {
  color-scheme: light;
  --ink: #12343b;
  --ink-soft: #244a51;
  --muted: #667d81;
  --paper: #f1f6f5;
  --card: #ffffff;
  --line: #d9e6e3;
  --teal: #0796a2;
  --teal-dark: #05636c;
  --teal-deep: #063f47;
  --aqua: #e3f7f6;
  --gold: #f5b721;
  --coral: #ef836d;
  --navy: #123b49;
  --shadow: 0 24px 70px rgba(7, 56, 63, .14);
  --soft-shadow: 0 10px 34px rgba(7, 56, 63, .07);
  font-family: Inter, Aptos, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }

.brand-logo-crop { position: relative; display: block; flex: 0 0 auto; overflow: hidden; }
.brand-logo-crop img { position: absolute; display: block; max-width: none; }
.brand-logo-crop-large { width: 263px; height: 122px; border-radius: 25px; box-shadow: 0 18px 44px rgba(2,38,43,.18); }
.brand-logo-crop-large img { width: 1200px; left: -48px; top: -42px; }
.brand-logo-crop-nav { width: 138px; height: 66px; border-radius: 15px; }
.brand-logo-crop-nav img { width: 636px; left: -27px; top: -23px; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(470px, 1.04fr) minmax(440px, .96fr); }
.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(50px, 7vw, 104px);
  color: white;
  background:
    linear-gradient(145deg, rgba(4,52,59,.96), rgba(7,105,111,.80) 62%, rgba(7,150,162,.50)),
    url('/assets/holiday-hero.png') 63% center / cover no-repeat;
}
.brand-panel::after { content: ''; position: absolute; width: 58px; height: 5px; left: clamp(50px, 7vw, 104px); top: calc(50% - 18px); border-radius: 8px; background: var(--gold); }
.brand-panel h1 { position: relative; z-index: 1; max-width: 680px; margin: 48px 0 18px; font-size: clamp(46px, 5.8vw, 78px); line-height: .98; letter-spacing: -.058em; text-wrap: balance; }
.brand-panel > p:not(.eyebrow) { position: relative; z-index: 1; max-width: 570px; margin: 0; color: rgba(255,255,255,.82); font-size: 18px; line-height: 1.65; }
.eyebrow { position: relative; z-index: 1; margin: 24px 0 0; font-size: 11px; font-weight: 900; letter-spacing: .19em; text-transform: uppercase; }
.eyebrow.teal { margin: 0 0 9px; color: var(--teal); }
.login-benefits { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 34px; }
.login-benefits span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.20); border-radius: 999px; color: rgba(255,255,255,.86); background: rgba(2,44,49,.26); font-size: 12px; font-weight: 750; backdrop-filter: blur(8px); }
.brand-orbit { position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.orbit-one { width: 470px; height: 470px; right: -260px; top: -250px; box-shadow: 0 0 0 70px rgba(255,255,255,.025); }
.orbit-two { width: 620px; height: 620px; left: -410px; bottom: -450px; }
.login-panel { position: relative; display: grid; place-items: center; overflow: hidden; padding: 38px; background: radial-gradient(circle at 85% 12%, #dcefee 0, transparent 28%), linear-gradient(145deg, #f7faf9, #edf5f4); }
.login-panel::before { content: ''; position: absolute; inset: 0; opacity: .30; background-image: radial-gradient(#78aaa7 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to bottom right, transparent, black 60%, transparent); }
.login-card { position: relative; z-index: 1; width: min(460px, 100%); display: grid; gap: 21px; padding: 42px; overflow: hidden; background: rgba(255,255,255,.96); border: 1px solid rgba(210,228,225,.95); border-radius: 28px; box-shadow: var(--shadow); }
.login-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--teal), #29b9c0 74%, var(--gold)); }
.login-card h2 { margin: 0; font-size: 36px; letter-spacing: -.04em; }
.muted { color: var(--muted); }
.login-card .muted { margin: 10px 0 0; line-height: 1.55; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid #cbdcd8; border-radius: 12px; padding: 12px 13px; color: var(--ink); background: white; outline: none; transition: border-color .16s, box-shadow .16s; }
input:hover, select:hover, textarea:hover { border-color: #a9c8c4; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(7,150,162,.11); }
textarea { min-height: 116px; resize: vertical; }
.button { min-height: 43px; border: 0; border-radius: 12px; padding: 11px 17px; font-weight: 850; transition: transform .15s, box-shadow .15s, background .15s; }
.button.primary { color: white; background: linear-gradient(135deg, var(--teal), #087a83); box-shadow: 0 9px 22px rgba(7,150,162,.19); }
.button.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 27px rgba(7,150,162,.25); }
.button.secondary { color: var(--teal-dark); background: var(--aqua); }
.button.ghost { color: var(--ink); background: white; border: 1px solid var(--line); }
.button.ghost:hover { border-color: #afcac6; background: #f8fbfa; }
.button.danger { color: #9d2c1b; background: #fff0ed; }
.login-submit { display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
.form-error { min-height: 20px; margin: -8px 0 0; color: #b93825; font-size: 13px; }
.security-note { display: flex; align-items: center; gap: 7px; margin: -4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.security-note span { color: #2da56e; font-size: 10px; }

.dashboard { min-height: 100vh; background: radial-gradient(circle at 8% 0%, rgba(27,166,173,.07), transparent 26%), var(--paper); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 20px; padding: 6px clamp(20px, 4vw, 58px); background: rgba(255,255,255,.95); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); box-shadow: 0 4px 24px rgba(7,56,63,.045); }
.logo-lockup { display: flex; align-items: center; gap: 15px; font-weight: 900; }
.logo-context { display: grid; gap: 2px; padding-left: 14px; border-left: 1px solid var(--line); }
.logo-context strong { font-size: 14px; }
.logo-context small { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.user-actions { display: flex; align-items: center; gap: 9px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 6px; border-radius: 99px; background: #eef5f4; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, var(--teal-deep), var(--teal)); font-weight: 850; }
.content { width: min(1480px, 100%); margin: 0 auto; padding: 34px clamp(20px, 4vw, 58px) 76px; }
.section-tabs { display: inline-flex; gap: 5px; margin-bottom: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: #e6f0ee; box-shadow: inset 0 1px 2px rgba(7,56,63,.05); }
.section-tab { min-width: 120px; border: 0; border-radius: 11px; padding: 10px 18px; color: var(--muted); background: transparent; font-weight: 850; }
.section-tab.active { color: var(--ink); background: white; box-shadow: 0 4px 14px rgba(7,56,63,.11); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 23px; }
.page-head-panel { position: relative; overflow: hidden; padding: clamp(25px, 3vw, 38px); border: 1px solid #cce3df; border-radius: 24px; background: linear-gradient(115deg, #e9f8f6 0%, #f8fbfa 66%, #fff8e9 100%); box-shadow: var(--soft-shadow); }
.page-head-panel::before { content: ''; position: absolute; width: 210px; height: 210px; right: -96px; top: -124px; border: 1px solid rgba(7,150,162,.15); border-radius: 50%; box-shadow: 0 0 0 38px rgba(7,150,162,.025); }
.page-head-panel::after { content: ''; position: absolute; width: 45px; height: 4px; left: clamp(25px, 3vw, 38px); top: 20px; border-radius: 8px; background: var(--gold); }
.page-head-panel > * { position: relative; z-index: 1; }
.page-head h1 { margin: 5px 0 0; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.05em; }
.page-description { max-width: 690px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.statistics-head p.muted { max-width: 620px; margin: 10px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 23px; }
.stat { position: relative; overflow: hidden; min-height: 130px; padding: 20px 21px; border: 1px solid var(--line); background: var(--card); border-radius: 19px; box-shadow: var(--soft-shadow); }
.stat::after { content: ''; position: absolute; width: 86px; height: 86px; right: -35px; bottom: -43px; border-radius: 50%; background: rgba(7,150,162,.06); }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.stat-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(7,150,162,.10); }
.stat-progress .stat-label i { background: #d2a114; box-shadow: 0 0 0 4px rgba(210,161,20,.11); }
.stat-waiting .stat-label i { background: var(--coral); box-shadow: 0 0 0 4px rgba(239,131,109,.12); }
.stat-closed .stat-label i { background: #687c80; box-shadow: 0 0 0 4px rgba(104,124,128,.10); }
.stat strong { display: inline-block; margin-top: 11px; font-size: 34px; line-height: 1; }
.stat small { margin-left: 7px; color: #8a999c; font-size: 11px; }
.workspace { overflow: hidden; border: 1px solid var(--line); background: var(--card); border-radius: 22px; box-shadow: 0 16px 48px rgba(7,56,63,.08); }
.toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: linear-gradient(#fff, #fcfdfd); }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 43px; }
.search-wrap::before { content: ''; position: absolute; left: 15px; top: 50%; width: 13px; height: 13px; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-60%); opacity: .8; }
.search-wrap::after { content: ''; position: absolute; left: 28px; top: 27px; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); opacity: .8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { padding: 13px 17px; text-align: left; color: var(--muted); background: #f5f9f8; font-size: 10px; font-weight: 850; letter-spacing: .10em; text-transform: uppercase; }
td { padding: 16px 17px; border-top: 1px solid #edf2f0; font-size: 13px; }
tbody tr { cursor: pointer; transition: background .14s; }
tbody tr:hover { background: #f2faf9; }
.client-cell strong { display: block; font-size: 14px; }
.client-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 850; }
.badge.new { color: #075c58; background: #d9f2ee; }
.badge.progress { color: #775b06; background: #fff4c7; }
.badge.waiting { color: #7a3a2d; background: #ffe3dc; }
.badge.closed { color: #405156; background: #e8eeee; }
.empty { padding: 76px 25px; text-align: center; color: var(--muted); }
.empty::before { content: '⌁'; display: block; margin-bottom: 10px; color: #99b2ae; font-size: 35px; }
.empty strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 20px; }

.detail-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 24px; box-shadow: var(--shadow); }
.detail-dialog.compact { width: min(520px, calc(100vw - 24px)); }
.detail-dialog::backdrop { background: rgba(5,39,44,.62); backdrop-filter: blur(5px); }
.dialog-head { position: relative; display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 25px 27px; border-bottom: 1px solid var(--line); background: linear-gradient(110deg, #f4fbfa, #fff); }
.dialog-head::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--teal), #27b9c1, var(--gold)); }
.dialog-head h2 { margin: 2px 0 0; letter-spacing: -.025em; }
.dialog-body { display: grid; gap: 18px; padding: 24px 27px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 27px; border-top: 1px solid var(--line); background: #fbfdfc; }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 24px; }
.icon-button:hover { background: #eaf3f1; }
.user-management h3 { margin: 2px 0 13px; font-size: 18px; }
.user-list { display: grid; gap: 14px; }
.user-card { display: grid; gap: 16px; padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: #f8fbfa; }
.user-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.user-card-head strong, .user-card-head span { display: block; }
.user-card-head div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.check-stack { display: grid; align-content: center; gap: 11px; }
.check-row { display: flex; grid-auto-flow: column; justify-content: start; align-items: center; gap: 9px; font-weight: 700; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.user-card-actions { display: flex; justify-content: flex-end; }
.add-user { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); }

.analytics-filters { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; margin-bottom: 23px; padding: 19px; border: 1px solid var(--line); border-radius: 19px; background: var(--card); box-shadow: var(--soft-shadow); }
.analytics-summary { margin-bottom: 18px; }
.analytics-summary .stat { display: flex; flex-direction: column; justify-content: center; }
.analytics-summary .stat > span { display: block; margin-bottom: 17px; color: var(--muted); font-size: 13px; font-weight: 750; }
.analytics-summary .stat > strong { display: block; margin-top: 0; font-size: 39px; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--soft-shadow); }
.chart-card-wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.chart-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.chart-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.chart-head > strong { font-size: 29px; }
.chart-scroll { overflow-x: auto; padding-bottom: 3px; }
.chart-svg { display: block; width: 100%; min-width: 720px; height: auto; }
.chart-grid-line { stroke: #e2ebe8; stroke-width: 1; }
.chart-axis-label { fill: var(--muted); font-size: 12px; }
.chart-value { fill: var(--ink); font-size: 12px; font-weight: 800; }
.chart-bar { fill: var(--teal); }
.progress-chart { display: grid; gap: 18px; }
.progress-row > div { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 7px; font-size: 14px; }
.progress-row span { color: var(--muted); }
.progress-row progress { width: 100%; height: 12px; overflow: hidden; border: 0; border-radius: 99px; background: #e8efed; accent-color: var(--teal); }
.progress-row progress::-webkit-progress-bar { border-radius: 99px; background: #e8efed; }
.progress-row progress::-webkit-progress-value { border-radius: 99px; background: var(--teal); }
.progress-row progress.new { accent-color: #0a8f86; }
.progress-row progress.progress { accent-color: #d5a61d; }
.progress-row progress.waiting { accent-color: #e28269; }
.progress-row progress.closed { accent-color: #637579; }
.progress-row progress.new::-webkit-progress-value { background: #0a8f86; }
.progress-row progress.progress::-webkit-progress-value { background: #d5a61d; }
.progress-row progress.waiting::-webkit-progress-value { background: #e28269; }
.progress-row progress.closed::-webkit-progress-value { background: #637579; }
.chart-empty { display: grid; min-height: 180px; place-items: center; color: var(--muted); text-align: center; }
.statistics-note { margin: 18px 4px 0; color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 12px 16px; color: white; background: var(--navy); border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-panel { min-height: 480px; padding: 52px 34px 62px; justify-content: end; }
  .brand-panel::after { left: 34px; top: 217px; }
  .brand-panel h1 { margin-top: 48px; font-size: clamp(46px, 8vw, 68px); }
  .login-panel { padding: 28px 18px 46px; margin-top: -28px; overflow: visible; background: transparent; }
  .login-card { padding: 34px 29px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .analytics-filters { grid-template-columns: 1fr 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
  .topbar { align-items: center; }
  .logo-context { display: none; }
  .user-actions { justify-content: flex-end; flex-wrap: wrap; }
  .user-chip span:not(.avatar) { display: none; }
}

@media (max-width: 720px) {
  .brand-panel { min-height: 430px; padding: 44px 22px 55px; }
  .brand-panel::after { left: 22px; top: 190px; }
  .brand-logo-crop-large { width: 210px; height: 98px; border-radius: 20px; }
  .brand-logo-crop-large img { width: 960px; left: -38px; top: -34px; }
  .brand-panel h1 { font-size: 46px; }
  .brand-panel > p:not(.eyebrow) { font-size: 15px; }
  .login-benefits { display: none; }
  .topbar { min-height: 68px; padding: 4px 12px; }
  .brand-logo-crop-nav { width: 112px; height: 54px; border-radius: 13px; }
  .brand-logo-crop-nav img { width: 516px; left: -22px; top: -19px; }
  .user-actions { gap: 6px; }
  .user-actions .button { min-height: 38px; padding: 9px 11px; font-size: 12px; }
  .user-chip { display: none; }
  .content { padding: 22px 14px 60px; }
  .section-tabs { width: 100%; }
  .section-tab { flex: 1; min-width: 0; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head-panel { padding: 30px 20px 22px; }
  .page-head-panel::after { left: 20px; top: 17px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { min-height: 112px; padding: 17px; }
  .toolbar { grid-template-columns: 1fr; }
  .analytics-filters { grid-template-columns: 1fr; }
  .chart-card { padding: 18px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}

@media (max-width: 420px) {
  .login-card { padding: 31px 20px; }
  .topbar .brand-logo-crop-nav { width: 96px; }
  .user-actions .button { padding-inline: 9px; }
  .stats { grid-template-columns: 1fr; }
}
