:root {
  --pink: #ef8fc2;
  --pink-strong: #e963aa;
  --pink-deep: #c83f87;
  --pink-pale: #fff1f8;
  --pink-wash: #fff8fb;
  --ink: #241b22;
  --ink-soft: #594d56;
  --muted: #8c7f88;
  --line: #eadfe5;
  --surface: #ffffff;
  --canvas: #faf8f9;
  --success: #2b9a71;
  --warning: #d69b37;
  --danger: #d65367;
  --shadow: 0 14px 40px rgba(69, 38, 56, .08);
  --shadow-soft: 0 4px 16px rgba(69, 38, 56, .06);
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--canvas); }
body { min-width: 320px; }
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.screen { min-height: 100vh; }
.eyebrow { color: var(--pink-deep); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.light { color: #fff; opacity: .85; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -.035em; }

/* Brand */
.brand-lockup { display: inline-flex; flex-direction: column; align-items: center; gap: 0; }
.brand-lockup > span { margin-top: 3px; line-height: 1; font-size: 8px; font-weight: 600; letter-spacing: .42em; color: var(--ink-soft); }
.logo-crop { position: relative; width: 145px; height: 84px; overflow: hidden; }
.logo-crop img { position: absolute; width: 180px; height: 180px; max-width: none; left: -18px; top: -60px; }
.brand-large .logo-crop { width: 212px; height: 120px; }
.brand-large .logo-crop img { width: 260px; height: 260px; left: -25px; top: -87px; }
.brand-large > span { margin-top: 4px; font-size: 9px; }
.brand-small .logo-crop { width: 112px; height: 65px; }
.brand-small .logo-crop img { width: 140px; height: 140px; left: -14px; top: -47px; }
.brand-small > span { margin-top: 3px; font-size: 7px; }

/* Login */
.login-screen { display: grid; grid-template-columns: minmax(430px, .9fr) minmax(440px, 1.1fr); background: #fff; }
.login-art { grid-column: 2; grid-row: 1; position: relative; min-height: 100vh; overflow: hidden; padding: 70px; display: flex; align-items: flex-end; color: white; background: #dba939; }
.login-art::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, rgba(31,18,26,.03) 28%, rgba(35,19,29,.18) 60%, rgba(35,19,29,.78) 100%); }
.login-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; }
.orb { position: absolute; border: 1px solid rgba(255,255,255,.27); border-radius: 50%; }
.orb-one { width: 420px; height: 420px; right: -120px; top: -100px; }
.orb-two { width: 270px; height: 270px; left: -80px; bottom: 26%; }
.login-quote { position: relative; z-index: 2; max-width: 590px; margin-bottom: 40px; }
.login-quote h2 { margin: 18px 0 24px; font-family: "Fraunces", Georgia, serif; font-size: clamp(44px, 5vw, 74px); line-height: .98; font-weight: 600; }
.login-quote h2 em { font-weight: 600; color: #6f2a50; }
.login-quote p { max-width: 500px; font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.88); }
.dessert-lines { position: absolute; right: 8%; bottom: 3%; display: flex; gap: 10px; align-items: flex-end; opacity: .32; }
.dessert-lines span { width: 11px; border-radius: 9px 9px 2px 2px; background: #fff; }
.dessert-lines span:nth-child(1) { height: 70px; }.dessert-lines span:nth-child(2) { height: 108px; }.dessert-lines span:nth-child(3) { height: 145px; }.dessert-lines span:nth-child(4) { height: 98px; }.dessert-lines span:nth-child(5) { height: 125px; }
.login-panel { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: center; padding: 50px 10%; background: #fff; }
.login-box { width: min(430px, 100%); }
.login-copy { margin: 44px 0 32px; }
.login-copy h1 { margin: 9px 0 8px; font-family: "Fraunces", Georgia, serif; font-size: 38px; }
.login-copy p { color: var(--muted); }
#login-form { display: grid; gap: 10px; }
#login-form label { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.input-wrap { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: #fff; transition: .2s; }
.input-wrap:focus-within { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(239,143,194,.13); }
.input-icon { color: var(--pink-deep); font-size: 12px; }
.input-wrap input { min-width: 0; flex: 1; height: 52px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.icon-button { border: 0; background: transparent; color: var(--pink-deep); font-size: 12px; font-weight: 700; cursor: pointer; }
.form-error { min-height: 18px; margin: 2px 0 0; color: var(--danger); font-size: 12px; }
.primary-button { margin-top: 4px; display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--pink-strong); color: white; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px rgba(220,82,157,.24); transition: .2s; }
.primary-button:hover { background: var(--pink-deep); transform: translateY(-1px); }
.primary-button:disabled { opacity: .6; cursor: wait; transform: none; }
.secure-note { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.secure-note span { color: var(--success); }

/* Areas */
.areas-screen { background: linear-gradient(180deg, #fff 0, #fff 125px, var(--pink-wash) 125px, var(--canvas) 100%); }
.topbar { height: 94px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; border-bottom: 1px solid rgba(234,223,229,.7); background: rgba(255,255,255,.92); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.user-email { color: var(--muted); font-size: 12px; }
.ghost-button { border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; background: white; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.areas-main { width: min(1120px, 90vw); margin: 0 auto; padding: 75px 0 80px; }
.areas-intro { margin-bottom: 38px; }
.areas-intro h1 { margin: 10px 0 8px; font-family: "Fraunces", Georgia, serif; font-size: clamp(36px, 4vw, 52px); }
.areas-intro p { color: var(--muted); }
.area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.area-card { position: relative; min-height: 360px; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
button.area-card { cursor: pointer; transition: transform .25s, box-shadow .25s, border-color .25s; }
button.area-card:hover { transform: translateY(-5px); border-color: var(--pink); box-shadow: 0 24px 60px rgba(99,52,78,.13); }
.area-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--pink-pale); color: var(--pink-deep); font-size: 27px; }
.area-icon.muted { background: #f3f1f2; color: #aa9fa5; }
.area-content { position: relative; z-index: 2; margin-top: 42px; max-width: 370px; }
.area-kicker { color: var(--success); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.muted-text { color: #9d9399; }
.area-content h2 { margin: 8px 0 12px; font-family: "Fraunces", Georgia, serif; font-size: 33px; }
.area-content p { min-height: 50px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.area-link { display: inline-flex; gap: 12px; margin-top: 26px; color: var(--pink-deep); font-weight: 700; font-size: 13px; }
.area-spark { position: absolute; right: 32px; bottom: 26px; display: flex; align-items: flex-end; gap: 7px; opacity: .22; }
.area-spark i { display: block; width: 13px; border-radius: 8px 8px 2px 2px; background: var(--pink-strong); }
.area-spark i:nth-child(1) { height: 22px; }.area-spark i:nth-child(2) { height: 48px; }.area-spark i:nth-child(3) { height: 35px; }.area-spark i:nth-child(4) { height: 75px; }.area-spark i:nth-child(5) { height: 58px; }
.operations-card { opacity: .78; box-shadow: var(--shadow-soft); }
.construction-pill { display: inline-block; margin-top: 26px; padding: 8px 13px; border-radius: 99px; background: #f3f1f2; color: #897c84; font-size: 11px; font-weight: 700; }
.construction-pattern { position: absolute; right: -50px; bottom: -80px; width: 240px; height: 240px; border: 34px solid #f8f1f5; border-radius: 50%; }
.simple-footer { padding: 24px; text-align: center; color: #a09199; font-size: 11px; }

/* Dashboard shell */
.dashboard-screen { display: flex; background: var(--canvas); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 238px; display: flex; flex-direction: column; padding: 28px 18px 18px; color: white; background: #2a1d26; }
.sidebar::before { content: ""; position: absolute; left: -70px; top: -90px; width: 220px; height: 220px; border: 1px solid rgba(239,143,194,.15); border-radius: 50%; }
.sidebar-brand { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 8px; }
.light-brand .logo-crop img { filter: brightness(1.12); }
.light-brand > span { color: rgba(255,255,255,.55); }
.side-nav { display: flex; flex-direction: column; gap: 7px; margin-top: 48px; }
.nav-label { padding: 0 13px 7px; color: rgba(255,255,255,.37); font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.nav-label.lower { margin-top: 22px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border: 0; border-radius: 12px; text-align: left; color: rgba(255,255,255,.62); background: transparent; font-size: 13px; cursor: pointer; transition: .2s; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: #2a1d26; background: var(--pink); font-weight: 700; }
.nav-icon { width: 22px; text-align: center; font-size: 17px; }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: 34px 1fr 26px; gap: 9px; align-items: center; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-avatar, .avatar-button { display: grid; place-items: center; border-radius: 50%; color: #44293a; background: var(--pink); font-size: 10px; font-weight: 800; }
.sidebar-avatar { width: 34px; height: 34px; }
.sidebar-footer strong { display: block; font-size: 11px; }
.sidebar-footer small { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,.45); font-size: 9px; white-space: nowrap; }
.sidebar-logout { border: 0; color: rgba(255,255,255,.5); background: transparent; cursor: pointer; }
.mobile-close { display: none; }
.sidebar-overlay { display: none; }
.dashboard-shell { width: calc(100% - 238px); min-height: 100vh; margin-left: 238px; }
.dashboard-header { min-height: 98px; display: flex; align-items: center; gap: 20px; padding: 20px 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(14px); }
.dashboard-header h1 { margin: 5px 0 0; font-family: "Fraunces", Georgia, serif; font-size: clamp(25px, 3vw, 34px); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.data-status { padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--muted); font-size: 11px; white-space: nowrap; }
.data-status span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--success); }
.avatar-button { width: 38px; height: 38px; border: 0; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.dashboard-content { padding: 26px 30px 48px; }

/* Shared panels and KPIs */
.loading-state { min-height: 55vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader { width: 38px; height: 38px; border: 3px solid var(--pink-pale); border-top-color: var(--pink-strong); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { margin-top: 14px; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { position: relative; min-height: 138px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow-soft); }
.kpi-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -34px; top: -34px; border-radius: 50%; background: var(--pink-pale); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-label { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.kpi-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--pink-deep); background: var(--pink-pale); font-size: 13px; }
.kpi-value { margin: 16px 0 5px; font-family: "Fraunces", Georgia, serif; font-size: clamp(27px, 2.6vw, 36px); line-height: 1; letter-spacing: -.04em; }
.kpi-foot { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.trend-pill { padding: 3px 7px; border-radius: 99px; font-weight: 700; }
.trend-positive { color: var(--success); background: #e8f6f1; }.trend-negative { color: var(--danger); background: #fff0f2; }.trend-neutral { color: var(--ink-soft); background: #f4f2f3; }
.insight-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading h2 { margin: 5px 0 4px; font-size: 18px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.legend { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }.dot-pink { background: var(--pink-strong); }.dot-soft { background: #eadfe5; }

/* Charts */
.year-chart { min-height: 260px; display: flex; align-items: stretch; gap: 14px; padding: 16px 4px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, #f2edf0 64px); }
.year-bar-group { flex: 1; min-width: 44px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-value { margin-bottom: 6px; color: var(--ink-soft); font-size: 9px; font-weight: 700; white-space: nowrap; }
.year-bar { width: min(58px, 86%); min-height: 4px; border-radius: 9px 9px 2px 2px; background: linear-gradient(180deg, var(--pink), var(--pink-strong)); transition: height .5s ease; }
.year-label { height: 28px; display: flex; align-items: center; color: var(--muted); font-size: 10px; font-weight: 600; }
.month-chart { min-height: 260px; display: flex; gap: 8px; align-items: stretch; padding-top: 17px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, #f2edf0 64px); }
.month-group { flex: 1; min-width: 20px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.month-bars { width: 100%; height: 220px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.month-bar { width: 42%; min-height: 2px; border-radius: 5px 5px 1px 1px; }.month-bar.previous { background: #eadfe5; }.month-bar.current { background: var(--pink-strong); }
.month-label { height: 23px; display: flex; align-items: center; color: var(--muted); font-size: 8px; text-transform: uppercase; }

/* Tables */
.table-panel { margin-bottom: 16px; padding: 0; overflow: hidden; }
.table-heading { align-items: center; padding: 22px 22px 0; }
.status-badge, .count-pill { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 99px; color: var(--success); background: #e8f6f1; font-size: 10px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.data-table thead th { padding: 10px 14px; text-align: right; color: #8a7682; background: var(--pink-wash); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.data-table thead th:first-child, .data-table tbody td:first-child { text-align: left; }
.data-table tbody td { padding: 11px 14px; text-align: right; border-bottom: 1px solid #f0e9ed; }
.data-table tbody tr:hover { background: #fffbfd; }
.data-table tfoot td { padding: 12px 14px; text-align: right; color: var(--ink); background: #fff3f8; font-weight: 700; }
.data-table tfoot td:first-child { text-align: left; }
.cell-positive { color: var(--success); font-weight: 700; }.cell-negative { color: var(--danger); font-weight: 700; }.cell-muted { color: #aa9ea5; }
.locations-panel { margin-top: 16px; }
.locations-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 24px; }
.location-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; }
.location-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.location-row > span { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.progress { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 99px; background: #f2eaee; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--pink-strong)); }

/* Clients */
.client-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.filter-row { display: flex; gap: 9px; }
.search-box { width: 220px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--muted); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.filter-row select { height: 38px; max-width: 170px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: white; color: var(--ink-soft); font-size: 10px; }
.client-tabs { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: white; white-space: nowrap; }
.client-tab { padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: #51464d; font-size: 10px; font-weight: 650; cursor: pointer; }
.client-tab.active { color: #fff; background: var(--pink-strong); font-weight: 800; }
.client-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.client-table-panel { margin-bottom: 0; }
.client-table-scroll { min-height: 400px; max-height: calc(100vh - 390px); }
.clients-table { table-layout: auto; }
.clients-table td:first-child, .clients-table th:first-child { position: sticky; left: 0; z-index: 1; max-width: 240px; overflow: hidden; text-overflow: ellipsis; background: white; }
.clients-table thead th:first-child { z-index: 2; background: var(--pink-wash); }
.client-name { max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.client-state { display: inline-block; padding: 4px 7px; border: 1px solid #efd4e2; border-radius: 99px; color: var(--pink-deep); background: var(--pink-wash); font-size: 8px; font-weight: 700; }
.state-risk { color: var(--danger); border-color: #f2c5cc; background: #fff2f4; }.state-star { color: var(--success); border-color: #bee7d8; background: #effaf6; }
.table-footer { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.page-button { width: 31px; height: 29px; margin-left: 6px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.page-button:disabled { opacity: .35; cursor: default; }
.count-pill { color: var(--pink-deep); background: var(--pink-pale); }

/* Toast */
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; border-radius: 12px; color: white; background: #34252f; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
  .client-toolbar { align-items: stretch; flex-direction: column; }
  .client-tabs { align-self: flex-start; }
}

@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding: 42px 24px; }
  .area-grid { grid-template-columns: 1fr; }
  .area-card { min-height: 320px; }
  .user-email { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { position: fixed; z-index: 19; inset: 0; display: block; background: rgba(36,27,34,.42); }
  .mobile-close { display: block; border: 0; color: white; background: transparent; font-size: 26px; cursor: pointer; }
  .dashboard-shell { width: 100%; margin-left: 0; }
  .menu-button { display: block; }
  .dashboard-header { padding: 17px 18px; }
  .dashboard-content { padding: 18px 14px 35px; }
  .data-status { display: none; }
  .locations-list { grid-template-columns: 1fr; }
  .filter-row { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .filter-row select { flex: 1; max-width: none; }
  .client-tabs { width: 100%; overflow-x: auto; }
  .client-tab { flex: 1; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 18px; }
  .areas-main { width: calc(100% - 32px); padding-top: 52px; }
  .area-card { padding: 27px; }
  .kpi-grid, .client-kpis { grid-template-columns: 1fr; }
  .kpi-card { min-height: 124px; }
  .panel { padding: 16px; border-radius: 16px; }
  .year-chart, .month-chart { min-width: 560px; }
  .panel-wide, .insight-grid > .panel { overflow-x: auto; }
  .panel-heading { min-width: 420px; }
  .table-panel .panel-heading, .locations-panel .panel-heading { min-width: 0; }
  .dashboard-header h1 { font-size: 24px; }
  .avatar-button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
