/* SOVRA Rooms — shared design system */
:root {
  --orange: #F97316;
  --orange-dark: #C2590A;
  --orange-light: #FED7AA;
  --orange-faint: #FFF4EB;
  --navy: #0A0F1E;
  --navy-2: #111827;
  --navy-3: #1E2A45;
  --ink: #1A2233;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --line: #E5E7EB;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --green: #10B981;
  --green-faint: #ECFDF5;
  --red: #EF4444;
  --red-faint: #FEF2F2;
  --blue: #3B82F6;
  --blue-faint: #EFF6FF;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
textarea { resize: vertical; min-height: 80px; }
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; padding: 9px 15px; border-radius: 8px; transition: all .12s; white-space: nowrap; }
.btn:hover { border-color: var(--faint); background: #fafafa; text-decoration: none; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-dark { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-dark:hover { background: var(--navy-3); }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-faint); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(0,0,0,.05); }

/* top nav (employee) */
.topnav { background: var(--navy); color: #fff; padding: 0 28px; height: 58px; display: flex; align-items: center; gap: 22px; position: sticky; top: 0; z-index: 50; }
.topnav .brand { font-weight: 800; font-size: 17px; letter-spacing: .06em; color: #fff; display: flex; align-items: center; gap: 9px; }
.topnav .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); display: inline-block; }
.topnav .brand span.sub { color: var(--faint); font-weight: 500; letter-spacing: 0; font-size: 14px; }
.topnav .nav-links { display: flex; gap: 4px; margin-left: 10px; }
.topnav .nav-links a { color: #C7CDD9; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 7px; }
.topnav .nav-links a:hover, .topnav .nav-links a.active { color: #fff; background: rgba(255,255,255,.09); text-decoration: none; }
.topnav .spacer { flex: 1; }
.topnav .userchip { display: flex; align-items: center; gap: 9px; color: #C7CDD9; font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
.avatar.blue { background: var(--blue); }
.avatar.navy { background: var(--navy-3); }

/* layout */
.page { max-width: 1180px; margin: 0 auto; padding: 30px 28px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .k { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.stat .k .unit { font-size: 15px; color: var(--faint); font-weight: 600; }

/* pills & chips */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.pill-active { background: var(--green-faint); color: #047857; }
.pill-won { background: var(--blue-faint); color: #1D4ED8; }
.pill-archived, .pill-lost { background: #F3F4F6; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2.5px 9px; border-radius: 6px; }
.chip-sovra { background: var(--orange-faint); color: var(--orange-dark); }
.chip-customer { background: var(--blue-faint); color: #1D4ED8; }
.chip-overdue { background: var(--red-faint); color: #B91C1C; }

/* progress bar */
.progress { height: 8px; background: #EDEFF2; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--orange), #FB923C); border-radius: 99px; transition: width .4s ease; }
.progress.green > div { background: linear-gradient(90deg, #10B981, #34D399); }

/* room cards grid (dashboard) */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.room-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s, transform .15s; }
.room-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.room-card .rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.room-card h3 { font-size: 16px; }
.room-card .company { color: var(--muted); font-size: 13px; margin-top: 1px; }
.room-card .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.room-card .meta b { color: var(--ink); }
.room-card .actions { display: flex; gap: 8px; margin-top: 2px; }

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
table.data td { padding: 11px 14px; border-bottom: 1px solid #F0F1F3; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #FAFBFC; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 11px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--orange-dark); border-bottom-color: var(--orange); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(10, 15, 30, .55); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 60px 20px; overflow-y: auto; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; padding: 26px; }
.modal h3 { font-size: 18px; margin-bottom: 18px; }
.modal .row { margin-bottom: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* toast */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy-2); color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* empty state */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ============ customer room ============ */
.dsr-top { background: var(--navy); color: #fff; padding: 0 30px; height: 60px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 50; }
.dsr-top .brand { font-weight: 800; letter-spacing: .08em; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.dsr-top .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.dsr-top .x { color: var(--faint); font-weight: 400; }
.dsr-top .cust { font-weight: 700; font-size: 15px; }
.dsr-hero { background: linear-gradient(135deg, var(--navy) 0%, #16213D 60%, #1E2A45 100%); color: #fff; padding: 54px 30px 100px; position: relative; overflow: hidden; }
.dsr-hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(249,115,22,.22), transparent 65%); }
.dsr-hero-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.dsr-hero .eyebrow { color: var(--orange); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; margin-bottom: 12px; }
.dsr-hero h1 { font-size: 34px; letter-spacing: -.02em; max-width: 720px; }
.dsr-hero p.msg { color: #C7CDD9; max-width: 680px; margin-top: 14px; font-size: 15.5px; }
.dsr-hero .owner { display: flex; align-items: center; gap: 11px; margin-top: 26px; }
.dsr-hero .owner .who { font-size: 13.5px; }
.dsr-hero .owner .who b { display: block; font-size: 14px; }
.dsr-hero .owner .who span { color: var(--faint); }
.dsr-body { max-width: 1080px; margin: -56px auto 0; padding: 0 30px 90px; display: grid; grid-template-columns: 200px 1fr; gap: 30px; position: relative; }
.dsr-nav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 3px; padding-top: 72px; }
.dsr-nav a { color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 8px 13px; border-radius: 8px; border-left: 3px solid transparent; }
.dsr-nav a:hover { color: var(--ink); text-decoration: none; background: rgba(0,0,0,.04); }
.dsr-nav a.active { color: var(--orange-dark); background: var(--orange-faint); border-left-color: var(--orange); }
.dsr-main { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.dsr-section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; scroll-margin-top: 80px; }
.dsr-section > h2 { font-size: 19px; margin-bottom: 4px; }
.dsr-section > .sec-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }

/* MAP */
.map-summary { display: flex; align-items: center; gap: 18px; background: var(--orange-faint); border: 1px solid #FDE3CC; border-radius: 12px; padding: 16px 20px; margin-bottom: 22px; flex-wrap: wrap; }
.map-summary .pct { font-size: 30px; font-weight: 800; color: var(--orange-dark); }
.map-summary .bar { flex: 1; min-width: 160px; }
.map-summary .cap { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 5px; }
.stage { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.stage-head { display: flex; align-items: center; gap: 13px; padding: 15px 18px; background: #FAFBFC; border-bottom: 1px solid var(--line); }
.stage-num { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.stage-num.done { background: var(--green); }
.stage-head h3 { font-size: 15px; }
.stage-head .sdesc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.stage-head .scount { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.task { display: flex; align-items: flex-start; gap: 13px; padding: 13px 18px; border-bottom: 1px solid #F0F1F3; }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--green); cursor: pointer; flex: none; }
.task .t-title { font-weight: 600; font-size: 14px; }
.task.done .t-title { color: var(--faint); text-decoration: line-through; }
.task .t-meta { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.task .t-body { flex: 1; min-width: 0; }

/* resources */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.res-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px; display: flex; flex-direction: column; gap: 9px; transition: all .13s; background: #fff; color: var(--ink); }
.res-card:hover { border-color: var(--orange); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.res-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--orange-faint); }
.res-card h4 { font-size: 13.5px; }
.res-card p { font-size: 12px; color: var(--muted); }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 13px; }
.team-card { border: 1px solid var(--line); border-radius: 11px; padding: 15px; display: flex; gap: 12px; align-items: center; }
.team-card .who b { font-size: 14px; display: block; }
.team-card .who span { font-size: 12.5px; color: var(--muted); }
.team-card .who a { font-size: 12px; display: block; }

/* discussion */
.comment { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid #F0F1F3; }
.comment:last-child { border-bottom: 0; }
.comment .c-body { flex: 1; }
.comment .c-head { font-size: 13px; display: flex; align-items: baseline; gap: 8px; }
.comment .c-head b { font-size: 13.5px; }
.comment .c-head time { color: var(--faint); font-size: 11.5px; }
.comment .c-text { font-size: 14px; margin-top: 3px; white-space: pre-wrap; }
.composer { display: flex; gap: 10px; margin-top: 16px; align-items: flex-start; }
.composer textarea { min-height: 44px; }

/* editor lists */
.edit-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.edit-item .ei-head { display: flex; align-items: center; gap: 10px; }
.edit-item .ei-head .grow { flex: 1; min-width: 0; }
.drag { color: var(--faint); cursor: grab; font-size: 15px; user-select: none; }
.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.inline-fields > div { flex: 1; min-width: 130px; }
.inline-fields > div.sm { flex: 0 0 130px; }

/* bar chart (admin) */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 8px; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; background: linear-gradient(180deg, #FB923C, var(--orange)); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .bar.zero { background: #EDEFF2; }
.chart-labels { display: flex; gap: 3px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 9.5px; color: var(--faint); }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-left { background: linear-gradient(150deg, var(--navy) 0%, #16213D 70%, var(--navy-3) 100%); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-left::after { content: ''; position: absolute; left: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(249,115,22,.25), transparent 65%); }
.login-left h1 { font-size: 34px; letter-spacing: -.02em; position: relative; }
.login-left p { color: #C7CDD9; margin-top: 14px; max-width: 420px; font-size: 15.5px; position: relative; }
.login-left ul { margin-top: 26px; list-style: none; position: relative; }
.login-left li { display: flex; gap: 11px; margin-bottom: 13px; color: #C7CDD9; font-size: 14px; align-items: flex-start; }
.login-left li .tick { color: var(--orange); font-weight: 800; }
.login-right { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 22px; margin-bottom: 6px; }
.login-box .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login-err { background: var(--red-faint); color: #B91C1C; border: 1px solid #FECACA; border-radius: 9px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; font-weight: 600; }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .dsr-body { grid-template-columns: 1fr; }
  .dsr-nav { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dsr-hero h1 { font-size: 26px; }
}
