:root {
  --cloud: #f3f8fc;
  --paper: #ffffff;
  --ink: #18334d;
  --muted: #6e8295;
  --line: #dce8f1;
  --blue: #2f80ed;
  --blue-dark: #1d5fb8;
  --blue-wash: #eaf3ff;
  --teal: #159c78;
  --teal-wash: #e7f7f1;
  --amber: #e89a26;
  --amber-wash: #fff5dd;
  --red: #d85466;
  --red-wash: #fff0f2;
  --purple: #7357c6;
  --shadow: 0 16px 42px rgba(28, 69, 103, .10);
  --shadow-sm: 0 6px 20px rgba(28, 69, 103, .08);
  --radius: 18px;
  --display: Bahnschrift, "Aptos Display", "Segoe UI", sans-serif;
  --body: Aptos, "Segoe UI", Arial, sans-serif;
  --utility: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cloud); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cloud); font-family: var(--body); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(47, 128, 237, .34); outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(520px, 1.25fr);
  background: var(--paper);
}
.login-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(32px, 6vw, 76px);
  color: white;
  background: #2f80ed;
}
.login-story::before {
  content: "";
  position: absolute;
  width: 52vw;
  height: 52vw;
  right: -26vw;
  top: -20vw;
  border: clamp(38px, 7vw, 100px) solid rgba(255,255,255,.12);
  border-radius: 50%;
}
.login-story::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  left: -110px;
  bottom: 10%;
  border: 44px solid rgba(255,255,255,.08);
  border-radius: 50%;
}
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--blue); background: white; border-radius: 12px 12px 12px 3px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.login-thesis { position: relative; z-index: 1; max-width: 620px; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font: 700 12px/1 var(--utility); letter-spacing: .13em; text-transform: uppercase; }
.login-story .eyebrow { color: rgba(255,255,255,.76); }
.login-thesis h1 { margin: 0; font: 650 clamp(45px, 6vw, 82px)/.98 var(--display); letter-spacing: -.055em; }
.login-thesis p { max-width: 500px; margin: 24px 0 0; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.6; }
.route-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.75); font-size: 13px; }
.route-line span { display: inline-flex; align-items: center; gap: 7px; }
.route-dot { width: 8px; height: 8px; border-radius: 50%; background: white; box-shadow: 0 0 0 5px rgba(255,255,255,.13); }
.route-stroke { width: 54px; height: 1px; background: rgba(255,255,255,.28); }
.login-panel { display: grid; place-items: center; padding: 30px; background: var(--paper); }
.login-card { width: min(460px, 100%); }
.login-card h2 { margin: 0 0 8px; font: 650 34px/1.1 var(--display); letter-spacing: -.035em; }
.login-card > p { margin: 0 0 30px; color: var(--muted); line-height: 1.5; }
.social-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 14px; color: #29445b; background: white; border: 1px solid #cadbe8; border-radius: 12px; cursor: pointer; font-weight: 750; transition: border-color .18s, background .18s, transform .18s; }
.social-btn:hover { transform: translateY(-1px); border-color: #93b6d1; background: #fafdff; }
.social-btn.google { grid-column: 1 / -1; }
.provider-mark { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 7px; font: 800 14px/1 var(--display); }
.provider-mark.google { color: #4285f4; border: 1px solid #e0e5ea; }
.provider-mark.facebook { color: white; background: #1877f2; }
.provider-mark.apple { color: white; background: #111; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: #8b9caa; font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-note { margin: -7px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { color: #425c72; font-size: 13px; font-weight: 700; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; color: var(--ink); background: white;
  border: 1px solid #cadbe8; border-radius: 12px; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,128,237,.10); outline: 0; }
.textarea { min-height: 96px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 750; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: white; background: var(--blue); box-shadow: 0 8px 22px rgba(47,128,237,.24); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { color: var(--ink); background: var(--blue-wash); }
.btn-ghost { color: #526a7e; background: transparent; border: 1px solid var(--line); }
.btn-success { color: white; background: var(--teal); }
.btn-danger { color: white; background: var(--red); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.login-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.demo-note { margin-top: 24px; padding: 14px 16px; color: #50687d; background: var(--cloud); border-radius: 12px; font-size: 13px; line-height: 1.45; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px 18px;
  background: rgba(255,255,255,.94); border-right: 1px solid var(--line); z-index: 20;
}
.sidebar .brand { padding: 0 8px 24px; font-size: 19px; }
.sidebar .brand-mark { color: white; background: var(--blue); }
.nav-label { margin: 18px 10px 8px; color: #98a8b6; font: 700 10px/1 var(--utility); letter-spacing: .12em; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 10px 12px; color: #5c7183; background: transparent; border: 0; border-radius: 12px; cursor: pointer; text-align: left; font-size: 14px; font-weight: 650; }
.nav-item:hover { color: var(--blue); background: #f2f7fc; }
.nav-item.active { color: var(--blue-dark); background: var(--blue-wash); }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-count { margin-left: auto; min-width: 22px; padding: 3px 7px; color: var(--red); background: var(--red-wash); border-radius: 99px; font: 700 10px/1.4 var(--utility); text-align: center; }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.user-chip { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 8px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; color: #1c648f; background: #dff2fb; border-radius: 14px; font-family: var(--display); font-weight: 750; }
.avatar.amber { color: #956014; background: var(--amber-wash); }
.avatar.green { color: #0c7055; background: var(--teal-wash); }
.avatar.purple { color: #5f45a8; background: #eee9ff; }
.user-name { overflow: hidden; font-weight: 750; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--muted); font-size: 11px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: #6b8194; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { color: var(--blue); background: var(--blue-wash); }
.icon-btn svg { width: 19px; height: 19px; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 30px; background: rgba(243,248,252,.86); border-bottom: 1px solid rgba(220,232,241,.85); backdrop-filter: blur(14px); }
.mobile-menu { display: none; }
.top-title { min-width: 0; }
.top-title h1 { margin: 0; font: 650 21px/1.1 var(--display); letter-spacing: -.025em; }
.top-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.language-select { width: auto; min-height: 38px; padding: 7px 30px 7px 10px; font-size: 12px; }
.content { width: min(1520px, 100%); margin: 0 auto; padding: 28px 30px 46px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font: 650 24px/1.15 var(--display); letter-spacing: -.035em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 18px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { position: relative; overflow: hidden; padding: 21px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.metric-card::after { content: ""; position: absolute; width: 58px; height: 4px; left: 21px; bottom: 0; border-radius: 4px 4px 0 0; background: var(--metric-color, var(--blue)); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--metric-color, var(--blue)); background: color-mix(in srgb, var(--metric-color, var(--blue)) 10%, white); border-radius: 11px; }
.metric-icon svg { width: 18px; height: 18px; }
.metric-value { margin-top: 16px; font: 700 31px/1 var(--display); letter-spacing: -.04em; }
.metric-foot { margin-top: 9px; color: var(--muted); font-size: 11px; }
.metric-foot strong { color: var(--teal); }
.layout-main { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); align-items: start; margin-top: 18px; }
.approvals-layout { grid-template-columns: minmax(0, 2.4fr) minmax(250px, .75fr); align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font: 650 16px/1.2 var(--display); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 20px; }
.link-btn { padding: 0; color: var(--blue); background: none; border: 0; cursor: pointer; font-size: 12px; font-weight: 750; }

.activity-list { display: grid; margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 14px 20px; border-bottom: 1px solid #edf3f7; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--blue); background: var(--blue-wash); border-radius: 12px; }
.activity-icon svg { width: 17px; height: 17px; }
.activity-title { font-size: 13px; font-weight: 750; }
.activity-copy { margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-time { color: #90a2b0; font: 500 10px/1 var(--utility); }

.queue-strip { display: grid; gap: 10px; }
.queue-row { display: grid; grid-template-columns: 6px 1fr auto; gap: 13px; align-items: center; padding: 13px 0; }
.queue-row + .queue-row { border-top: 1px solid #edf3f7; }
.queue-rail { width: 6px; height: 42px; border-radius: 99px; background: var(--blue); }
.queue-rail.amber { background: var(--amber); }
.queue-rail.green { background: var(--teal); }
.queue-title { font-size: 13px; font-weight: 750; }
.queue-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; color: #8296a7; transform: translateY(-50%); pointer-events: none; }
.search-wrap .input { padding-left: 40px; min-height: 42px; }
.filter-select { width: auto; min-width: 150px; min-height: 42px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 12px 16px; color: #718597; background: #f7fafc; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #edf3f7; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdff; }
.customer-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.customer-cell .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.cell-main { font-weight: 750; }
.cell-sub { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 5px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.pending, .status.in-progress { color: #2b73c7; background: var(--blue-wash); }
.status.approved, .status.completed, .status.appointment-booked { color: #0a7b5a; background: var(--teal-wash); }
.status.no-answer, .status.busy, .status.need-approval, .status.on-hold { color: #9a6516; background: var(--amber-wash); }
.status.rejected, .status.cancelled, .status.wrong-number { color: #b63d50; background: var(--red-wash); }
.status.draft { color: #6c7c8c; background: #eef2f5; }
.provider-list { display: flex; gap: 5px; flex-wrap: wrap; }
.provider-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 4px 8px; color: #536a7c; background: #f1f5f8; border-radius: 8px; font-size: 10px; font-weight: 750; text-transform: capitalize; }
.provider-badge .provider-mark { width: 15px; height: 15px; border-radius: 5px; font-size: 9px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.permission-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; background: #f7fafc; border-radius: 11px; cursor: pointer; }
.permission-row input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--blue); }
.permission-row strong { display: block; font-size: 12px; }
.permission-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.row-actions .icon-btn { width: 33px; height: 33px; }

.call-workspace { max-width: 880px; margin: 0 auto; }
.call-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.call-hero h2 { margin: 0; font: 650 clamp(28px, 4vw, 43px)/1 var(--display); letter-spacing: -.045em; }
.call-hero p { margin: 9px 0 0; color: var(--muted); }
.progress-ring { display: grid; place-items: center; width: 76px; height: 76px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--teal) var(--progress), #e5edf3 0); }
.progress-ring::after { content: attr(data-label); display: grid; place-items: center; width: 61px; height: 61px; background: var(--cloud); border-radius: 50%; font: 700 15px/1 var(--display); }
.call-list { display: grid; gap: 14px; }
.call-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 8px minmax(0, 1fr); background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); }
.call-rail { background: var(--blue); }
.call-rail.priority { background: var(--amber); }
.call-card-body { padding: 20px; }
.call-card-top { display: flex; align-items: flex-start; gap: 12px; }
.call-card-top .avatar { width: 47px; height: 47px; border-radius: 15px; }
.call-identity { min-width: 0; flex: 1; }
.call-identity h3 { margin: 1px 0 4px; font: 650 18px/1.1 var(--display); letter-spacing: -.02em; }
.call-identity p { margin: 0; color: var(--muted); font-size: 12px; }
.attempt { flex: 0 0 auto; padding: 6px 9px; color: #60778a; background: #f1f6f9; border-radius: 9px; font: 700 10px/1 var(--utility); }
.call-purpose { margin: 17px 0; padding: 12px 14px; color: #35516a; background: #f7fafc; border-radius: 12px; font-size: 12px; line-height: 1.45; }
.call-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.call-fact { min-width: 0; }
.call-fact span { display: block; margin-bottom: 4px; color: #91a2b0; font: 700 9px/1 var(--utility); letter-spacing: .06em; text-transform: uppercase; }
.call-fact strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.call-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; }
.quick-call { color: white; background: var(--blue); }
.quick-whatsapp { color: white; background: #21a76f; }
.empty { padding: 52px 24px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; color: var(--blue); background: var(--blue-wash); border-radius: 18px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font: 650 18px/1.2 var(--display); }
.empty p { max-width: 400px; margin: auto; font-size: 13px; line-height: 1.5; }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding: 18px 8px 4px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; min-width: 24px; }
.bar { width: min(36px, 70%); min-height: 3px; height: var(--height); background: linear-gradient(180deg, #65a6f7, var(--blue)); border-radius: 8px 8px 3px 3px; }
.bar-col span { color: #8498a8; font: 600 9px/1 var(--utility); }
.leader-list { display: grid; gap: 14px; }
.leader-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.leader-rank { color: #8ca0af; font: 700 11px/1 var(--utility); }
.leader-score { color: var(--teal); font: 700 12px/1 var(--utility); }
.meter { height: 7px; margin-top: 7px; overflow: hidden; background: #eaf0f4; border-radius: 99px; }
.meter > span { display: block; width: var(--value); height: 100%; background: var(--blue); border-radius: inherit; }
.points-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 28px; color: white; background: linear-gradient(125deg, #2f80ed 0%, #4c8fe6 58%, #73a9eb 100%); border-radius: 24px; box-shadow: 0 18px 38px rgba(47,128,237,.24); }
.points-hero h2 { margin: 0; font: 650 26px/1.15 var(--display); }
.points-total { font: 700 clamp(46px, 8vw, 72px)/.9 var(--display); letter-spacing: -.05em; }
.points-total span { display: block; margin-top: 7px; font: 700 10px/1 var(--utility); letter-spacing: .1em; text-align: right; text-transform: uppercase; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(14,35,52,.45); backdrop-filter: blur(5px); animation: fadeIn .18s ease-out; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 22px; box-shadow: 0 24px 80px rgba(10,37,60,.28); animation: modalIn .22s ease-out; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 22px; background: white; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 650 20px/1.2 var(--display); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field.full { grid-column: 1 / -1; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; color: #60758a; background: #f3f7fa; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 700; }
.check-chip input:checked + span { color: var(--blue-dark); background: var(--blue-wash); border-color: #bcd8f7; }
.selection-list { max-height: 270px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.selection-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid #edf3f7; cursor: pointer; }
.selection-item:last-child { border-bottom: 0; }
.selection-item input { width: 17px; height: 17px; accent-color: var(--blue); }
.selection-copy { flex: 1; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; pointer-events: none; }
.toast { min-width: 260px; padding: 13px 16px; color: white; background: #173f5f; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; animation: toastIn .25s ease-out; }

.mobile-bottom { display: none; }
.overlay { display: none; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-main { grid-template-columns: 1fr; }
  .approvals-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .login-shell { display: block; min-height: 100vh; background: var(--cloud); }
  .login-story { min-height: auto; padding: 28px 24px 92px; border-radius: 0 0 34px 34px; }
  .login-thesis { margin-top: 72px; }
  .login-thesis h1 { font-size: 43px; }
  .login-thesis p { font-size: 15px; }
  .route-line { display: none; }
  .login-panel { margin-top: -58px; padding: 0 16px 28px; background: transparent; position: relative; z-index: 3; }
  .login-card { padding: 24px 20px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
  .permission-grid { grid-template-columns: 1fr; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .overlay.open { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(22,50,73,.32); }
  .topbar { height: 64px; padding: 0 16px; }
  .mobile-menu { display: grid; }
  .top-title p { display: none; }
  .top-actions .btn { display: none; }
  .content { padding: 20px 14px 94px; }
  .section-head { align-items: flex-start; }
  .section-head h2 { font-size: 22px; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .filter-select { flex: 1; min-width: 0; }
  .mobile-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
  .bottom-item { display: grid; justify-items: center; gap: 3px; padding: 5px 2px; color: #8598a8; background: transparent; border: 0; font-size: 9px; font-weight: 750; }
  .bottom-item.active { color: var(--blue); }
  .bottom-item svg { width: 20px; height: 20px; }
  .call-card-body { padding: 17px 14px; }
  .call-facts { grid-template-columns: 1fr 1fr; }
  .call-actions { grid-template-columns: 1fr 1fr; }
  .call-actions .btn:last-child { grid-column: 1 / -1; }
  .call-actions .btn-ghost { grid-column: 1 / -1; }
  .call-facts { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .points-hero { padding: 22px 20px; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 16px 14px; border-radius: 15px; }
  .metric-card::after { left: 14px; }
  .metric-value { margin-top: 11px; font-size: 25px; }
  .metric-foot { min-height: 26px; }
  .section-actions .btn-ghost { display: none; }
  .panel { border-radius: 16px; }
  .panel-head { padding: 16px; }
  .data-table th, .data-table td { padding-left: 12px; padding-right: 12px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
  .modal-body { padding: 18px; }
  .modal-foot { padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); }
}

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