:root {
  --ink: #102b35;
  --muted: #60737b;
  --line: #dfe8e8;
  --paper: #ffffff;
  --canvas: #f4f8f7;
  --brand: #0b3b4a;
  --brand-2: #125a68;
  --teal: #1f9f91;
  --teal-dark: #14776e;
  --mint: #e5f6f2;
  --gold: #c8964e;
  --gold-soft: #fff4df;
  --danger: #b43d4b;
  --danger-soft: #fdebed;
  --warning: #a86417;
  --warning-soft: #fff1d9;
  --success: #19735f;
  --success-soft: #e7f6f0;
  --info: #2e6db2;
  --info-soft: #e9f1fb;
  --shadow: 0 16px 44px rgba(12, 47, 57, .10);
  --shadow-sm: 0 7px 20px rgba(12, 47, 57, .08);
  --radius: 20px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--brand);
}
.boot-screen strong { font-size: 21px; }
.boot-screen span { color: var(--muted); font-size: 14px; }

/* Shared controls */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: white; box-shadow: 0 8px 20px rgba(31,159,145,.23); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-dark { background: var(--brand); color: white; }
.btn-light { background: white; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: inherit; }
.btn-danger { background: var(--danger); color: white; }
.btn-small { padding: 8px 11px; font-size: 13px; border-radius: 9px; }
.icon { width: 19px; height: 19px; display: inline-block; flex: 0 0 auto; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid #cbd9d9;
  border-radius: 11px;
  background: white;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,159,145,.12); }
.textarea { min-height: 100px; resize: vertical; }
.label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #415a63; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.checkbox-line { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.45; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: capitalize;
  background: #edf2f2;
  color: #536970;
}
.badge.success, .badge.active, .badge.accepted, .badge.completed, .badge.delivered, .badge.available, .badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warning, .badge.attention, .badge.scheduled, .badge.in-progress, .badge.try-in, .badge.review, .badge.partially-paid, .badge.monitoring, .badge.quote { background: var(--warning-soft); color: var(--warning); }
.badge.danger, .badge.low, .badge.failed, .badge.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.info, .badge.pre-treatment, .badge.draft, .badge.proposed, .badge.planning, .badge.external-review, .badge.reference-ready, .badge.namespace-ready, .badge.room-ready { background: var(--info-soft); color: var(--info); }
.badge.neutral, .badge.pending, .badge.new, .badge.quotation { background: #edf2f2; color: #536970; }

.card { background: var(--paper); border: 1px solid rgba(205,221,220,.85); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-head h2, .section-head h3 { margin: 0; }
.section-head p { margin: 5px 0 0; color: var(--muted); }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Public website */
.public-page { background: #fff; min-height: 100vh; }
.public-nav-wrap { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.93); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(214,226,225,.8); }
.public-nav { max-width: 1220px; margin: 0 auto; padding: 13px 24px; display: flex; align-items: center; gap: 26px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; font-weight: 850; color: var(--brand); }
.brand-lockup img { width: 42px; height: 42px; }
.brand-lockup span { display: grid; line-height: 1.05; }
.brand-lockup small { font-size: 10px; color: var(--teal-dark); letter-spacing: .13em; text-transform: uppercase; margin-top: 5px; }
.public-links { margin-left: auto; display: flex; align-items: center; gap: 25px; font-size: 14px; font-weight: 700; color: #36505a; }
.public-links a:hover { color: var(--teal-dark); }
.public-nav-actions { display: flex; gap: 10px; }
.mobile-menu-btn { display: none; }

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 10%, rgba(48,179,162,.26), transparent 30%),
    radial-gradient(circle at 10% 100%, rgba(198,150,78,.15), transparent 34%),
    linear-gradient(135deg, #082d39, #0d4654 60%, #0b3945);
  color: white;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.027) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.027) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to right, black, transparent);
  pointer-events: none;
}
.hero-inner { max-width: 1220px; margin: 0 auto; padding: 82px 24px 74px; display: grid; grid-template-columns: 1.18fr .82fr; gap: 64px; position: relative; z-index: 2; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #a8e8df; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; font-weight: 850; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: #66d6c6; }
.hero h1 { font-size: clamp(43px, 6vw, 72px); letter-spacing: -.045em; line-height: 1.02; margin: 20px 0 22px; max-width: 820px; }
.hero-copy { font-size: 18px; line-height: 1.7; color: #d4e6e8; max-width: 710px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 43px; }
.hero-proof div { border-left: 1px solid rgba(255,255,255,.25); padding-left: 14px; }
.hero-proof strong { display: block; font-size: 21px; }
.hero-proof span { color: #bdd2d5; font-size: 12px; line-height: 1.4; display: block; margin-top: 3px; }

.quote-card { align-self: center; background: rgba(255,255,255,.98); color: var(--ink); padding: 25px; border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.quote-card h2 { margin: 0 0 7px; font-size: 23px; }
.quote-card > p { margin: 0 0 19px; color: var(--muted); font-size: 14px; }
.quote-card .form-grid { gap: 11px; }
.quote-card .label { font-size: 12px; }
.quote-card .input, .quote-card .select { padding: 10px 11px; }
.quote-card .btn { width: 100%; margin-top: 3px; }

.public-section { max-width: 1220px; margin: 0 auto; padding: 82px 24px; }
.public-section-head { max-width: 760px; margin-bottom: 35px; }
.public-section-head .eyebrow { color: var(--teal-dark); }
.public-section-head h2 { font-size: clamp(32px, 4vw, 50px); letter-spacing: -.035em; margin: 14px 0 13px; }
.public-section-head p { color: var(--muted); line-height: 1.7; font-size: 16px; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.service-card { padding: 24px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f9fbfa); transition: transform .2s ease, box-shadow .2s ease; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.service-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--mint); display: grid; place-content: center; color: var(--teal-dark); }
.service-card h3 { margin: 18px 0 9px; }
.service-card p { color: var(--muted); line-height: 1.6; margin: 0; font-size: 14px; }

.tech-band { background: #edf7f5; }
.tech-inner { max-width: 1220px; margin: 0 auto; padding: 70px 24px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 54px; align-items: center; }
.tech-visual { min-height: 390px; border-radius: 28px; position: relative; overflow: hidden; background: radial-gradient(circle at 45% 40%, #5fd1c2, #125765 48%, #082f3a 73%); box-shadow: var(--shadow); }
.tech-visual::before { content: ""; position: absolute; width: 210px; height: 260px; border: 3px solid rgba(255,255,255,.84); border-radius: 44% 44% 50% 50%; left: 50%; top: 48%; transform: translate(-50%,-50%); box-shadow: inset 0 0 45px rgba(255,255,255,.18), 0 0 60px rgba(255,255,255,.17); }
.tech-visual::after { content: "CBCT · DICOM · DIGITAL SCAN"; position: absolute; bottom: 24px; left: 24px; font-size: 11px; color: white; font-weight: 850; letter-spacing: .16em; }
.tech-list { display: grid; gap: 12px; }
.tech-item { padding: 18px; background: rgba(255,255,255,.76); border: 1px solid rgba(190,218,214,.8); border-radius: 15px; display: grid; grid-template-columns: 42px 1fr; gap: 13px; align-items: start; }
.tech-item .service-icon { width: 42px; height: 42px; }
.tech-item h3 { margin: 1px 0 5px; font-size: 16px; }
.tech-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.tourism-section { background: #0b3946; color: white; }
.tourism-inner { max-width: 1220px; margin: 0 auto; padding: 82px 24px; }
.tourism-inner .public-section-head p { color: #c7dcdf; }
.process-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: process; }
.process-card { counter-increment: process; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.13); border-radius: 17px; padding: 20px 16px; min-height: 190px; }
.process-card::before { content: "0" counter(process); display: grid; place-content: center; width: 39px; height: 39px; border-radius: 50%; background: #49bfae; color: #07323d; font-weight: 900; margin-bottom: 18px; }
.process-card h3 { font-size: 15px; margin: 0 0 8px; }
.process-card p { font-size: 13px; color: #c6dade; line-height: 1.55; margin: 0; }

.public-footer { background: #071f27; color: #c4d6d9; }
.footer-inner { max-width: 1220px; margin: 0 auto; padding: 48px 24px; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 45px; }
.footer-inner h4 { color: white; margin: 0 0 13px; }
.footer-inner p, .footer-inner li { font-size: 13px; line-height: 1.7; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; }
.footer-bottom { max-width: 1220px; margin: 0 auto; padding: 18px 24px 28px; border-top: 1px solid rgba(255,255,255,.09); font-size: 12px; color: #8ea8ad; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-visual { padding: 55px; background: radial-gradient(circle at 70% 20%, rgba(60,188,171,.3), transparent 35%), linear-gradient(145deg, #082f3b, #0b4b58); color: white; display: flex; flex-direction: column; justify-content: space-between; }
.login-visual h1 { font-size: clamp(38px, 5vw, 67px); line-height: 1.02; letter-spacing: -.045em; max-width: 670px; margin: 30px 0 20px; }
.login-visual p { max-width: 600px; color: #cbe0e3; line-height: 1.7; }
.login-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 650px; }
.login-feature { padding: 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.06); font-size: 13px; color: #dcecee; }
.login-panel { background: #f7faf9; display: grid; place-content: center; padding: 45px 7vw; }
.login-box { width: min(520px, 100%); }
.login-box h2 { font-size: 32px; margin: 0 0 8px; }
.login-box > p { margin: 0 0 24px; color: var(--muted); }
.account-grid { display: grid; gap: 10px; }
.account-card { width: 100%; border: 1px solid var(--line); background: white; border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 13px; text-align: left; color: var(--ink); }
.account-card:hover { border-color: var(--teal); box-shadow: var(--shadow-sm); }
.account-avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--mint); color: var(--teal-dark); display: grid; place-content: center; font-weight: 900; }
.account-card strong { display: block; }
.account-card span { color: var(--muted); font-size: 12px; }
.account-card .icon { margin-left: auto; }
.login-note { margin-top: 18px; padding: 13px; border-radius: 12px; background: var(--warning-soft); color: #774913; font-size: 12px; line-height: 1.5; }

/* Staff application */
.staff-shell { min-height: 100vh; display: grid; grid-template-columns: 258px 1fr; background: var(--canvas); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #092f3b; color: #c9dadd; padding: 20px 14px; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .brand-lockup { color: white; padding: 3px 8px 21px; }
.sidebar .brand-lockup small { color: #7fd9cc; }
.sidebar-section-label { margin: 12px 10px 7px; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: #6e929a; font-weight: 850; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar-link { border: 0; background: transparent; color: #c9dadd; border-radius: 10px; padding: 10px 11px; display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 680; text-align: left; }
.sidebar-link:hover { background: rgba(255,255,255,.07); color: white; }
.sidebar-link.active { background: #176c70; color: white; box-shadow: inset 3px 0 #65d4c4; }
.sidebar-spacer { flex: 1; }
.sidebar-user { border-top: 1px solid rgba(255,255,255,.11); padding: 16px 8px 2px; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; }
.user-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-content: center; background: rgba(255,255,255,.12); color: white; font-weight: 900; }
.sidebar-user strong { font-size: 12px; display: block; color: white; }
.sidebar-user span { font-size: 10px; color: #85a8af; display: block; margin-top: 3px; text-transform: capitalize; }

.staff-main { min-width: 0; }
.topbar { height: 68px; display: flex; align-items: center; gap: 18px; padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.mobile-sidebar-btn { display: none; }
.global-search { flex: 1; max-width: 560px; position: relative; }
.global-search .input { padding-left: 39px; background: #f4f8f7; border-color: transparent; }
.global-search .icon { position: absolute; left: 13px; top: 11px; color: #749098; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { border: 1px solid var(--line); background: white; width: 39px; height: 39px; border-radius: 11px; display: grid; place-content: center; color: #48626b; }
.staff-content { padding: 27px 28px 52px; max-width: 1650px; margin: 0 auto; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-title h1 { margin: 0; font-size: 28px; letter-spacing: -.025em; }
.page-title p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.metric-card .metric-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-content: center; background: var(--mint); color: var(--teal-dark); }
.metric-label { font-size: 12px; color: var(--muted); font-weight: 750; }
.metric-value { font-size: 28px; font-weight: 850; letter-spacing: -.035em; margin-top: 7px; }
.metric-foot { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 17px; align-items: start; }
.dashboard-stack { display: grid; gap: 17px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 11px 13px; color: #71858c; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 13px; border-bottom: 1px solid #edf2f1; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfa; }
.table-primary { font-weight: 770; color: var(--ink); }
.table-secondary { font-size: 11px; color: var(--muted); margin-top: 3px; }
.table-link { color: var(--teal-dark); font-weight: 800; }
.avatar-name { display: flex; gap: 10px; align-items: center; }
.mini-avatar { width: 35px; height: 35px; border-radius: 11px; display: grid; place-content: center; background: #e5f1f0; color: #0d645d; font-size: 12px; font-weight: 850; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.toolbar .input { max-width: 380px; }
.toolbar .select { max-width: 190px; }

.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 11px; position: relative; padding-bottom: 17px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 17px; bottom: 0; width: 1px; background: var(--line); }
.timeline-dot { width: 15px; height: 15px; border: 4px solid #dff2ee; background: var(--teal); border-radius: 50%; margin-top: 2px; z-index: 1; }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.timeline-item time { color: #8da0a6; font-size: 10px; }

/* Patient workspace */
.patient-banner { background: linear-gradient(135deg, #0b3b4a, #146875); color: white; border-radius: 22px; padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.patient-ident { display: flex; gap: 16px; align-items: center; }
.patient-avatar { width: 67px; height: 67px; border-radius: 20px; background: rgba(255,255,255,.14); display: grid; place-content: center; font-size: 22px; font-weight: 900; }
.patient-banner h1 { margin: 0 0 6px; font-size: 25px; }
.patient-meta { display: flex; gap: 9px 18px; flex-wrap: wrap; color: #cbe0e3; font-size: 12px; }
.patient-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.patient-alert { margin-top: 13px; display: inline-flex; gap: 8px; align-items: center; background: rgba(255,217,139,.14); border: 1px solid rgba(255,217,139,.28); color: #ffe4ac; border-radius: 10px; padding: 8px 10px; font-size: 11px; }
.tabs { display: flex; gap: 3px; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.tab-btn { border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; font-size: 12px; font-weight: 760; color: #5f747b; white-space: nowrap; }
.tab-btn.active { background: var(--brand); color: white; }
.patient-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; align-items: start; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.info-box { background: #f7faf9; border: 1px solid #e6eeee; border-radius: 12px; padding: 12px; }
.info-box label { display: block; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; color: #809299; font-weight: 850; margin-bottom: 5px; }
.info-box strong { font-size: 13px; line-height: 1.4; }
.alert-panel { border-left: 4px solid var(--warning); background: var(--warning-soft); padding: 14px; border-radius: 10px; margin-top: 13px; }
.alert-panel strong { display: block; font-size: 12px; color: #764913; margin-bottom: 5px; }
.alert-panel p { margin: 0; color: #80551e; font-size: 12px; line-height: 1.55; }

.odontogram { padding: 20px; }
.staff-odontogram-scroll { overflow-x: auto; padding-bottom: 5px; }
.arch-label { text-align: center; font-size: 10px; color: #84969d; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; margin: 8px 0 12px; }
.tooth-row { display: grid; grid-template-columns: repeat(16, minmax(48px, 1fr)); gap: 5px; align-items: end; min-width: 850px; }
.tooth-row.lower { align-items: start; }
.tooth-btn { min-width: 0; min-height: 106px; border: 1px solid #cddcdd; background: #fff; border-radius: 12px; padding: 6px 3px; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--ink); cursor: pointer; }
.tooth-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tooth-btn .real-tooth-image { width: 43px; height: 78px; }
.tooth-btn.incisor .real-tooth-image { width: 38px; }
.tooth-btn.canine .real-tooth-image { width: 40px; }
.tooth-btn.premolar .real-tooth-image { width: 44px; }
.tooth-btn.molar .real-tooth-image { width: 48px; }
.tooth-row.lower .real-tooth-image { transform: rotate(180deg); }
.tooth-number { font-size: 9px; font-weight: 850; }
.patient-tooth-picker { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #f8fbfa; overflow-x: auto; }
.patient-tooth-picker .section-head { margin-bottom: 8px; }
.patient-tooth-picker .section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.swipe-notice { position: sticky; left: 0; width: fit-content; margin: 8px auto 12px; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 999px; background: #e5f5f2; color: var(--teal-dark); font-size: 11px; z-index: 2; }
.swipe-notice span { font-size: 20px; line-height: 1; }
.patient-arch { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; min-width: 850px; }
.patient-quadrant { min-width: 0; }
.patient-quadrant-label { display: block; text-align: center; margin-bottom: 6px; color: #667f7d; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.patient-quadrant-teeth { display: grid; grid-template-columns: repeat(8, minmax(46px, 1fr)); gap: 5px; }
.patient-tooth { min-height: 106px; border: 1px solid #cbd9d8; border-radius: 12px; padding: 6px 3px; background: white; color: #60787b; display: grid; place-items: center; align-content: center; gap: 3px; cursor: pointer; }
.patient-tooth:hover { border-color: var(--teal); transform: translateY(-2px); }
.patient-tooth.selected { background: var(--mint); border: 2px solid var(--teal); color: var(--teal-dark); box-shadow: 0 3px 12px rgba(18,112,105,.16); }
.real-tooth-image { width: 43px; height: 78px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(31,61,57,.18)); transition: transform .15s ease, filter .15s ease; }
.patient-tooth.incisor .real-tooth-image { width: 38px; }
.patient-tooth.canine .real-tooth-image { width: 40px; }
.patient-tooth.premolar .real-tooth-image { width: 44px; }
.patient-tooth.molar .real-tooth-image { width: 48px; }
.patient-arch.lower .real-tooth-image { transform: rotate(180deg); }
.patient-tooth.selected .real-tooth-image { filter: drop-shadow(0 0 5px rgba(18,112,105,.65)); }
.patient-mouth-line { min-width: 850px; margin: 13px 0; height: 18px; display: flex; align-items: center; gap: 8px; color: #8ca09d; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.patient-mouth-line::before, .patient-mouth-line::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, #b9cecb); }
.patient-mouth-line::after { background: linear-gradient(90deg, #b9cecb, transparent); }
.intake-section { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.intake-section:first-child { border-top: 0; padding-top: 0; }
.intake-section h3 { margin: 0; font-size: 15px; }
.intake-section > p { margin: -4px 0 0; color: var(--muted); font-size: 11px; }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.choice-chip { display: flex; align-items: flex-start; gap: 8px; border: 1px solid #d5e2e0; border-radius: 10px; padding: 9px; background: #fbfdfc; font-size: 11px; line-height: 1.35; cursor: pointer; }
.choice-chip:has(input:checked) { border-color: var(--teal); background: var(--mint); color: var(--teal-dark); font-weight: 700; }
.choice-chip input { margin-top: 1px; accent-color: var(--teal); }
.choice-chip.attestation { font-size: 12px; padding: 12px; }
.intake-review { margin: 15px 0; padding: 15px; border: 1px solid #d7e5e2; border-radius: 14px; background: #f8fbfa; }
.tooth-btn.healthy { color: #6f858d; }
.tooth-btn.missing { color: #b43d4b; background: #fdebed; border-style: dashed; }
.tooth-btn.caries, .tooth-btn.residual_root { color: #ad6718; background: #fff0d8; }
.tooth-btn.implant, .tooth-btn.planned_implant { color: #2d69ad; background: #e9f1fb; }
.tooth-btn.crown, .tooth-btn.veneer, .tooth-btn.temporary { color: #7c58a6; background: #f2eafa; }
.tooth-btn.discoloration, .tooth-btn.orthodontic_movement { color: #22766e; background: #e5f6f2; }
.tooth-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; background: #dbe3e4; }
.legend-dot.missing { background: #ed9da7; }
.legend-dot.caries { background: #e7b66e; }
.legend-dot.implant { background: #91b5df; }
.legend-dot.prosthetic { background: #bea3d7; }
.legend-dot.ortho { background: #80c8bd; }

.plan-summary { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 18px; align-items: center; padding: 17px; background: #f4f9f8; border-radius: 14px; margin-bottom: 14px; }
.plan-total { text-align: right; }
.plan-total span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 800; }
.plan-total strong { display: block; margin-top: 4px; }
.integration-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.integration-map-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfdfc; }
.integration-map-item strong { display: block; text-transform: capitalize; font-size: 12px; }
.integration-map-item code { display: block; font-size: 9px; color: var(--muted); margin: 7px 0; overflow-wrap: anywhere; }

/* Module boards */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 5px; }
.kanban-col { background: #eef4f3; border-radius: 15px; padding: 12px; min-height: 320px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; font-size: 12px; font-weight: 850; text-transform: capitalize; }
.kanban-count { background: white; border-radius: 999px; padding: 3px 7px; font-size: 10px; color: var(--muted); }
.kanban-card { background: white; border: 1px solid #dae5e4; border-radius: 12px; padding: 13px; margin-bottom: 9px; box-shadow: 0 4px 10px rgba(14,57,66,.05); }
.kanban-card strong { font-size: 12px; display: block; }
.kanban-card p { margin: 6px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.kanban-card footer { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: #71858c; }

.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.integration-card { padding: 18px; }
.integration-card-head { display: flex; align-items: center; gap: 12px; }
.integration-logo { width: 43px; height: 43px; border-radius: 13px; background: #edf5f4; display: grid; place-content: center; color: var(--teal-dark); font-weight: 900; text-transform: uppercase; }
.integration-card h3 { margin: 0; text-transform: capitalize; }
.integration-card p { color: var(--muted); font-size: 12px; line-height: 1.5; min-height: 36px; }
.integration-meta { display: flex; justify-content: space-between; font-size: 10px; color: #81949a; padding-top: 11px; border-top: 1px solid var(--line); }

.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 35px; gap: 10px; align-items: center; font-size: 12px; }
.bar-track { height: 9px; background: #eaf0ef; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), #54c9b8); border-radius: inherit; }
.financial-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.financial-total div { background: #f5f9f8; border-radius: 12px; padding: 14px; }
.financial-total span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 800; }
.financial-total strong { display: block; font-size: 21px; margin-top: 6px; }

/* Portal */
.portal-page { min-height: 100vh; background: linear-gradient(180deg, #eaf6f4 0, #f5f9f8 270px, #f5f9f8 100%); }
.portal-nav { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; }
.portal-nav .brand-lockup { color: var(--brand); }
.portal-nav-actions { margin-left: auto; display: flex; gap: 9px; }
.portal-main { max-width: 1180px; margin: 0 auto; padding: 30px 24px 60px; }
.portal-welcome { display: grid; grid-template-columns: 1fr auto; gap: 25px; align-items: center; margin-bottom: 22px; }
.portal-welcome h1 { font-size: 36px; letter-spacing: -.04em; margin: 0 0 8px; }
.portal-welcome p { color: var(--muted); margin: 0; }
.portal-id { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; box-shadow: var(--shadow-sm); }
.portal-id span { display: block; font-size: 9px; text-transform: uppercase; color: var(--muted); font-weight: 850; }
.portal-id strong { display: block; margin-top: 5px; font-family: ui-monospace, monospace; }
.portal-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 17px; align-items: start; }
.portal-stack { display: grid; gap: 17px; }
.next-appointment { padding: 22px; background: linear-gradient(135deg, #0d4655, #137568); color: white; position: relative; overflow: hidden; }
.next-appointment::after { content: ""; position: absolute; width: 150px; height: 150px; border: 25px solid rgba(255,255,255,.07); border-radius: 50%; right: -30px; top: -40px; }
.next-appointment .eyebrow { color: #9fe1d8; }
.next-appointment h2 { margin: 15px 0 6px; font-size: 25px; }
.next-appointment p { margin: 0; color: #c8dfe1; }
.next-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; font-size: 12px; }
.progress-track { height: 10px; border-radius: 99px; background: #e7efee; overflow: hidden; margin: 14px 0 8px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--teal), #62cdbd); border-radius: inherit; }
.portal-action-list { display: grid; gap: 8px; }
.portal-action { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 11px; background: #fbfdfc; }
.portal-action .service-icon { width: 38px; height: 38px; border-radius: 11px; }
.portal-action strong { display: block; font-size: 12px; }
.portal-action span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.portal-action .icon:last-child { margin-left: auto; color: #8ba0a6; }

/* Modal and notifications */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,22,29,.55); backdrop-filter: blur(3px); z-index: 100; display: grid; place-content: center; padding: 22px; }
.modal { width: min(620px, 95vw); max-height: 90vh; overflow-y: auto; background: white; border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 20px; }
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 430px; background: #102f38; color: white; border-radius: 13px; padding: 13px 15px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .22s ease; }
.toast.error { background: #7d2734; }
.toast.success { background: #176658; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.loading-panel { padding: 70px 20px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid #d5e4e2; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-panel { padding: 25px; background: var(--danger-soft); border: 1px solid #f2c4ca; border-radius: 14px; color: #812d38; }

@media (max-width: 1120px) {
  .hero-inner { grid-template-columns: 1fr; }
  .quote-card { max-width: 700px; }
  .process-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .patient-grid, .portal-grid { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: repeat(2, 1fr); }
  .tooth-row { min-width: 730px; }
  .odontogram { overflow-x: auto; }
}

@media (max-width: 860px) {
  .public-links { display: none; }
  .mobile-menu-btn { display: grid; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-inner { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 460px; }
  .staff-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 60; width: 258px; transition: left .2s ease; box-shadow: 15px 0 40px rgba(0,0,0,.25); }
  .sidebar.open { left: 0; }
  .mobile-sidebar-btn { display: grid; }
  .topbar { padding: 0 15px; }
  .staff-content { padding: 21px 15px 45px; }
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .public-nav { padding: 10px 14px; }
  .public-nav-actions .btn-light { display: none; }
  .brand-lockup span { font-size: 13px; }
  .hero-inner { padding: 60px 17px; }
  .hero h1 { font-size: 42px; }
  .hero-proof { grid-template-columns: 1fr; }
  .hero-proof div { border-left: 0; border-top: 1px solid rgba(255,255,255,.2); padding: 10px 0 0; }
  .quote-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .public-section, .tourism-inner { padding: 62px 17px; }
  .service-grid, .process-grid { grid-template-columns: 1fr; }
  .tech-inner { padding: 62px 17px; }
  .footer-inner { grid-template-columns: 1fr; padding: 42px 17px; }
  .login-visual { padding: 30px 22px; }
  .login-feature-grid { grid-template-columns: 1fr; }
  .login-panel { padding: 38px 18px; }
  .metric-grid { grid-template-columns: 1fr; }
  .page-title { display: grid; }
  .patient-banner { grid-template-columns: 1fr; }
  .patient-actions { justify-content: flex-start; }
  .patient-ident { align-items: flex-start; }
  .patient-avatar { width: 54px; height: 54px; border-radius: 16px; }
  .info-grid { grid-template-columns: 1fr; }
  .integration-grid, .integration-map { grid-template-columns: 1fr; }
  .portal-main { padding: 20px 15px 45px; }
  .portal-welcome { grid-template-columns: 1fr; }
  .portal-welcome h1 { font-size: 30px; }
  .financial-total { grid-template-columns: 1fr; }
  .topbar .global-search { display: none; }
  .toast-root { left: 12px; right: 12px; }
  .toast { min-width: 0; max-width: none; }
}

.form-divider { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 2px; }
.portal-action[onclick] { width: 100%; text-align: left; border: 0; font: inherit; }

.video-session-card {
  padding: 24px;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(38, 123, 107, .24);
  background: linear-gradient(145deg, rgba(236, 249, 246, .96), rgba(255, 255, 255, .98));
}
.video-session-card .btn { justify-self: start; }
.success-panel {
  margin-top: 16px;
  border: 1px solid rgba(34, 139, 94, .25);
  background: rgba(232, 248, 239, .9);
  border-radius: 14px;
  padding: 14px 16px;
}
.success-panel p { margin: 5px 0 0; color: var(--muted); }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 210px; }

.badge.live, .badge.succeeded, .badge.operational { background: var(--success-soft); color: var(--success); }
.badge.disabled, .badge.not-configured { background: #eef2f3; color: #64777c; }
.badge.queued, .badge.running { background: #fff6dc; color: #8b6410; }
.badge.dead, .badge.failed, .badge.configuration-error { background: #fdecec; color: #ad3232; }
.integration-detail { display: grid; gap: 5px; margin: 12px 0; }
.integration-detail strong { font-size: 12px; }
.integration-detail span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.video-workspace{position:fixed;inset:0;z-index:2000;background:#071a1d;display:flex;flex-direction:column}
.video-workspace-head{min-height:68px;padding:10px 18px;display:flex;align-items:center;justify-content:space-between;gap:16px;color:#fff}
.video-workspace-head div{display:flex;flex-direction:column;gap:3px}.video-workspace-head span{color:#38b8a5;font-size:11px;font-weight:800;letter-spacing:1px}.video-workspace-head strong{font-size:18px}
.video-leave{background:#8c2932;color:#fff;border:0}.video-test-notice{background:#493a14;color:#ffe39a;padding:8px 14px;text-align:center;font-size:12px;font-weight:700}
.video-frame{flex:1;width:100%;border:0;background:#071a1d}
