/* American Smart Film — Franchise Back Office
   Design language: deep navy + clean white surfaces, flag red used
   sparingly as the action accent. Subtle Americana, modern SaaS feel. */
:root {
  --navy:#17334E; --navy-deep:#10253B; --navy-soft:#3E6390;
  --red:#B22234; --red-dark:#8E1B29;
  --ink:#1E2A36; --mut:#64748B; --line:#E3E9EF; --line-soft:#EDF1F5;
  --bg:#F2F4F7; --card:#FFFFFF;
  --shadow-sm:0 1px 2px rgba(16,37,59,.05), 0 1px 3px rgba(16,37,59,.05);
  --shadow-md:0 4px 12px rgba(16,37,59,.10);
  --radius:14px;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:"Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
       color:var(--ink); background:var(--bg); font-size:15px; line-height:1.5; }
a { color:var(--navy); }
a:hover { color:var(--red); }

/* ---------- app shell: sidebar + content ---------- */
.shell { display:flex; min-height:100vh; }
.sidebar { width:252px; flex:0 0 252px; position:sticky; top:0; height:100vh;
  display:flex; flex-direction:column; padding:20px 14px 16px;
  background:linear-gradient(180deg, #122A42 0%, var(--navy) 58%, #1B3A56 100%);
  color:#D7E3EE; }
.sidebar .brand { padding:2px 4px 0; }
.brand-badge { background:#fff; border-radius:12px; padding:7px 10px;
  box-shadow:0 2px 10px rgba(0,0,0,.28); }
.sidebar .brand img { width:100%; max-width:198px; height:auto; display:block; }
.brand-text { font-weight:700; color:#fff; font-size:15.5px; line-height:1.2; }
.brand-text span { display:block; font-weight:600; font-size:10.5px; letter-spacing:.11em;
  text-transform:uppercase; color:#93A9BE; margin-top:3px; }
.flag-rule { height:3px; border-radius:2px; margin:16px 4px 4px;
  background:linear-gradient(90deg, var(--red) 0 34%, #E8EDF2 34% 67%, var(--navy-soft) 67% 100%); }
.sidebar nav { overflow-y:auto; padding-bottom:8px; }
.nav-group { margin:18px 10px 6px; font-size:10.5px; font-weight:700;
  letter-spacing:.13em; text-transform:uppercase; color:#7E97AC; }
.sidebar nav a { display:block; padding:9px 12px; margin:2px 0; border-radius:9px;
  color:#C7D5E2; text-decoration:none; font-size:14.5px; font-weight:500;
  transition:background .13s ease, color .13s ease; }
.sidebar nav a:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar nav a.active { background:rgba(255,255,255,.10); color:#fff;
  box-shadow:inset 3px 0 0 var(--red); }
.side-foot { margin-top:auto; border-top:1px solid rgba(255,255,255,.13); padding:14px 6px 2px; }
.who-name { color:#fff; font-weight:600; font-size:14.5px; }
.who-role { color:#8FA6BB; font-size:12.5px; margin-top:1px; }
a.logout { display:inline-block; margin-top:9px; padding:6px 13px; font-size:13px;
  color:#E6EEF5; text-decoration:none; border:1px solid rgba(255,255,255,.28); border-radius:8px; }
a.logout:hover { background:rgba(255,255,255,.09); color:#fff; }
.content { flex:1; min-width:0; display:flex; flex-direction:column; }
main { width:100%; max-width:1160px; margin:0 auto; padding:30px 34px 12px; flex:1; }
footer { text-align:center; color:var(--mut); padding:20px 16px 24px; font-size:12.5px; }

/* ---------- typography ---------- */
h1 { color:var(--navy); font-size:25px; font-weight:700; letter-spacing:-.01em; margin:2px 0 14px; }
h2 { color:var(--navy); font-size:17.5px; font-weight:650; margin:26px 0 10px; }
h3 { color:var(--navy); font-size:15.5px; margin:16px 0 8px; }
.mut { color:var(--mut); } .right { text-align:right; }

/* ---------- cards & stats ---------- */
form.card, .card { background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:20px 22px; margin:16px 0; box-shadow:var(--shadow-sm); }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
.stat { background:var(--card); border:1px solid var(--line); border-top:4px solid var(--red);
  border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow-sm); }
.stat b { font-size:29px; font-weight:700; color:var(--navy); display:block; line-height:1.15; }

/* ---------- tables ---------- */
table { width:100%; border-collapse:separate; border-spacing:0; background:var(--card);
  border:1px solid var(--line); border-radius:12px; overflow:hidden;
  margin:12px 0 20px; box-shadow:var(--shadow-sm); }
th { background:#F6F8FA; color:#5A6B7B; font-size:11.5px; font-weight:700;
  text-transform:uppercase; letter-spacing:.07em; text-align:left;
  padding:11px 12px; border-bottom:1.5px solid var(--line); }
td { padding:10px 12px; font-size:14px; text-align:left; vertical-align:top;
  border-bottom:1px solid var(--line-soft); }
tr:last-child td { border-bottom:0; }
tbody tr:hover td { background:#F8FAFC; }

/* ---------- forms ---------- */
label { display:block; font-size:12px; font-weight:700; letter-spacing:.05em;
  text-transform:uppercase; color:#52616F; margin:13px 0 5px; }
input, select, textarea { width:100%; padding:10px 12px; font:inherit; font-size:14.5px;
  color:var(--ink); background:#fff; border:1px solid #CBD6DF; border-radius:10px;
  transition:border-color .13s ease, box-shadow .13s ease; }
textarea { min-height:64px; resize:vertical; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--navy);
  box-shadow:0 0 0 3px rgba(23,51,78,.14); }
input[type="file"] { padding:8px 10px; background:#F8FAFC; }
input[type="checkbox"], input[type="radio"] { width:auto; }

/* ---------- buttons ---------- */
button, .btn { background:linear-gradient(180deg, #BE2A3E, var(--red)); color:#fff;
  border:1px solid var(--red-dark); border-radius:10px; padding:10px 18px;
  font:inherit; font-size:14.5px; font-weight:600; cursor:pointer; text-decoration:none;
  display:inline-block; margin-top:12px; box-shadow:0 1px 2px rgba(16,37,59,.20);
  transition:transform .13s ease, box-shadow .13s ease, filter .13s ease; }
button:hover, .btn:hover { filter:brightness(1.06); transform:translateY(-1px);
  box-shadow:0 4px 10px rgba(16,37,59,.20); color:#fff; }
button:active, .btn:active { transform:translateY(0); }
button.secondary, .btn.secondary { background:#fff; color:var(--navy);
  border:1px solid #C3CFDA; box-shadow:var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { background:#F2F6FA; color:var(--navy); }
button.small, .btn.small { padding:6px 12px; font-size:13px; border-radius:8px; margin-top:0; }
.inline { display:inline; } .inline button { margin-top:0; }

/* ---------- notices ---------- */
.flash { background:#EAF6EC; border:1px solid #BFE3C4; border-left:5px solid #3D9950;
  color:#1E5B28; font-weight:500; padding:12px 16px; border-radius:10px; margin-bottom:16px; }
.warn { background:#FFF8E6; border:1px solid #F0D48A; color:#7A5510;
  padding:10px 14px; border-radius:10px; margin:8px 0; font-size:14px; }
.err { background:#FDECEC; border:1px solid #F0B4B4; color:var(--red-dark);
  padding:12px 16px; border-radius:10px; margin-bottom:14px; }
.hint { font-size:13px; color:var(--mut); margin:10px 0 0; }

/* ---------- dictation ---------- */
.mic-btn { background:var(--navy); color:#fff; border:0; border-radius:999px;
  padding:6px 13px; font-size:12.5px; font-weight:600; margin:6px 0 2px;
  box-shadow:var(--shadow-sm); }
.mic-btn:hover { background:#21486B; transform:none; filter:none; }
.mic-btn.listening { background:var(--red); animation:pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow:0 0 0 0 rgba(178,34,52,.45); }
  50% { box-shadow:0 0 0 6px rgba(178,34,52,0); } }

/* ---------- auth (sign-in / setup) ---------- */
body.auth { min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:28px 18px; background:linear-gradient(160deg, #0E2237 0%, var(--navy) 58%, #1E4066 100%); }
.auth-wrap { width:100%; max-width:432px; }
.auth-brand { text-align:center; color:#fff; }
.auth-brand img { height:84px; width:auto; }
.auth-name { font-size:21px; font-weight:700; margin-top:10px; }
.auth-sub { font-size:11.5px; font-weight:600; letter-spacing:.13em;
  text-transform:uppercase; color:#9FB6C9; margin-top:3px; }
.auth-card { background:#fff; border-radius:16px; padding:26px 28px 28px; margin-top:20px;
  box-shadow:0 18px 44px rgba(0,0,0,.38); }
.auth-card h1 { text-align:center; font-size:22px; }
.auth-foot { text-align:center; color:#8FA6BB; font-size:12.5px; margin-top:16px; }

/* ---------- public document (customer quote) ---------- */
body.doc { background:var(--bg); padding:28px 16px 40px; }
.doc-wrap { max-width:880px; margin:0 auto; background:#fff; border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow-md); padding:34px 42px; }

/* ---------- small screens: sidebar becomes a top bar ---------- */
@media (max-width:880px) {
  .shell { flex-direction:column; }
  .sidebar { width:100%; flex:none; height:auto; position:static; padding:14px 14px 10px; }
  .sidebar nav { display:flex; flex-wrap:wrap; align-items:center; gap:2px 4px; overflow:visible; }
  .nav-group { width:100%; margin:10px 8px 2px; }
  .sidebar nav a { padding:7px 10px; font-size:13.5px; }
  .side-foot { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  a.logout { margin-top:0; }
  main { padding:20px 16px 8px; }
  .doc-wrap { padding:24px 18px; }
}

/* ---------- print: paper only ---------- */
@media print {
  .sidebar, footer, .noprint { display:none !important; }
  body, body.doc { background:#fff; padding:0; }
  main { margin:0; max-width:none; padding:0; }
  .doc-wrap { box-shadow:none; border:0; border-radius:0; padding:0; }
}

/* --- v12: Command Center + Milestones --- */
.cc-stats .cc-stat b { font-size: 34px; }
.cc-stat-label { display:block; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--mut,#667); margin-bottom:2px; }
.cc-feed, #cc-feed { display:flex; flex-direction:column; gap:8px; }
.cc-item { background:var(--card); border:1px solid var(--line);
  border-left:5px solid var(--navy,#0b2545); border-radius:6px;
  padding:10px 14px; font-size:16px; }
.cc-item.cc-sale { border-left-color:#1a7f37; }
.cc-item.cc-milestone { border-left-color:#b8860b; }
.cc-item.cc-lead { border-left-color:#2563eb; }
.cc-item.cc-completion { border-left-color:#6d28d9; }
.cc-kind { display:inline-block; font-size:11px; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase; background:#eef2f7;
  border-radius:3px; padding:2px 7px; margin-right:6px; }
.cc-at { font-size:12px; color:var(--mut,#667); margin-top:2px; }
.cc-celebrate { position:relative; overflow:hidden; border-radius:10px;
  background:linear-gradient(135deg,#0b2545,#14365e); color:#fff;
  padding:26px 22px 20px; margin:14px 0 20px; text-align:center;
  box-shadow:0 8px 30px rgba(11,37,69,.35); }
.cc-pop-title { font-size:30px; font-weight:800; line-height:1.2; }
.cc-pop-sub { font-size:17px; opacity:.92; margin:6px 0 12px; }
.cc-celebrate textarea { width:min(560px,92%); font-size:16px; border-radius:6px;
  border:none; padding:9px 11px; }
.cc-pop-actions { margin-top:12px; display:flex; gap:10px;
  justify-content:center; flex-wrap:wrap; }
.balloon { position:absolute; bottom:-70px; width:26px; height:34px;
  border-radius:50% 50% 50% 50%/55% 55% 45% 45%; opacity:.85;
  animation:cc-rise 3.4s ease-in infinite; pointer-events:none; }
.balloon::after { content:""; position:absolute; left:50%; top:100%;
  width:1px; height:26px; background:rgba(255,255,255,.6); }
.balloon.b0 { background:#e63946; animation-delay:0s; }
.balloon.b1 { background:#f1fa8c; animation-delay:.5s; }
.balloon.b2 { background:#4cc9f0; animation-delay:1s; }
.balloon.b3 { background:#ffd166; animation-delay:.3s; }
.balloon.b4 { background:#06d6a0; animation-delay:1.4s; }
.balloon.b5 { background:#ef476f; animation-delay:.8s; }
.balloon.b6 { background:#118ab2; animation-delay:1.8s; }
.balloon.b7 { background:#ffffff; animation-delay:2.2s; }
@keyframes cc-rise { 0% { transform:translateY(0) } 100% { transform:translateY(-340px) } }
.cc-progress { height:14px; background:#e8edf3; border-radius:7px; overflow:hidden; }
.cc-progress span { display:block; height:100%; background:#1a7f37; }
