:root {
  --primary: #635bff;
  --primary-dark: #4d45e5;
  --primary-soft: #eeedff;
  --ink: #172033;
  --muted: #6d768a;
  --line: #e8eaf0;
  --surface: #ffffff;
  --canvas: #f5f6fa;
  --success: #18865f;
  --success-soft: #e9f8f1;
  --warning: #a86509;
  --warning-soft: #fff5df;
  --danger: #c53d52;
  --danger-soft: #fff0f2;
  --shadow-sm: 0 6px 20px rgba(31, 38, 62, .06);
  --shadow-lg: 0 24px 70px rgba(31, 38, 62, .18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

svg { width: 1em; height: 1em; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark svg { fill: currentColor; stroke: none; }

.eyebrow { margin: 0 0 7px; font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .14em; color: var(--primary); }
.eyebrow-light { color: rgba(255,255,255,.72); }

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: var(--primary); box-shadow: 0 10px 28px rgba(99,91,255,.32); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-light .brand-mark { color: #15132e; background: #fff; box-shadow: none; }
.brand-light { color: #fff; }


.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 10%, rgba(99,91,255,.12), transparent 34%),
    radial-gradient(circle at 85% 90%, rgba(81,216,189,.10), transparent 32%),
    #f5f6fa;
}
.login-card {
  width: min(100%, 420px);
  padding: 38px;
  border: 1px solid rgba(225,228,237,.95);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 24px 70px rgba(31,38,62,.13);
}
.login-brand { margin-bottom: 34px; }
.login-card h1 { margin: 0; font-size: 29px; letter-spacing: -.04em; }
.form-intro { margin: 10px 0 28px; color: var(--muted); line-height: 1.65; }
.security-note { margin: 17px 0 0; font-size: 11px; line-height: 1.6; text-align: center; color: #9299a8; }

.field-label { display: block; margin: 0 0 9px; font-size: 13px; font-weight: 750; color: #343c50; }
.field-label em { font-style: normal; font-weight: 500; color: #9aa1b0; }
.field-group { display: block; margin-bottom: 22px; }
.field-group small, .file-dropzone small, .toggle-row small { display: block; margin-top: 8px; font-size: 12px; line-height: 1.55; color: #8a92a3; }
input, textarea { width: 100%; border: 1px solid #dfe2e9; border-radius: 11px; outline: none; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s, background .2s; }
input { height: 48px; padding: 0 14px; }
textarea { padding: 13px 14px; resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #a7adbb; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,91,255,.11); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; right: 5px; top: 5px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 17px; border: 0; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .18s, box-shadow .18s, background .18s, opacity .18s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.button svg { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 18px rgba(99,91,255,.23); }
.button-primary:hover { background: var(--primary-dark); box-shadow: 0 11px 24px rgba(99,91,255,.3); }
.button-secondary { border: 1px solid var(--line); color: #4d566b; background: #fff; box-shadow: none; }
.button-secondary:hover { background: #f7f8fb; }
.button-white { position: relative; z-index: 2; color: var(--primary-dark); background: #fff; box-shadow: 0 12px 30px rgba(31,28,91,.18); }
.button-danger { color: var(--danger); background: var(--danger-soft); box-shadow: none; }
.button-large { height: 50px; border-radius: 12px; }
.button-full { width: 100%; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; cursor: pointer; color: #667084; background: transparent; transition: background .18s, color .18s; }
.icon-button:hover { color: var(--ink); background: #f0f1f5; }
.icon-button svg { width: 20px; height: 20px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; color: var(--primary); background: transparent; font-size: 13px; font-weight: 750; }
.text-button svg { width: 16px; }

.app-view { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 27px 18px 20px; border-right: 1px solid #eceef3; background: #fff; z-index: 30; }
.sidebar-brand { padding: 0 12px; }
.sidebar-nav { display: grid; gap: 5px; margin-top: 42px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 45px; padding: 0 13px; border: 0; border-radius: 10px; cursor: pointer; color: #71798b; background: transparent; font-size: 13px; font-weight: 700; text-align: left; transition: color .18s, background .18s; }
.nav-item:hover { color: var(--ink); background: #f6f7fa; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }
.nav-icon { width: 20px; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-guide { margin: auto 6px 20px; padding: 17px; border: 1px solid #e8e6ff; border-radius: 14px; background: linear-gradient(145deg, #f7f6ff, #eeedff); }
.sidebar-guide .guide-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 13px; border-radius: 10px; color: #fff; background: var(--primary); }
.sidebar-guide strong { font-size: 13px; }
.sidebar-guide p { margin: 7px 0 0; font-size: 11px; line-height: 1.6; color: #737b91; }
.sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 6px 8px;
  padding: 13px 12px;
  border: 1px solid #eceef3;
  border-radius: 12px;
  background: #fafbfc;
}
.sidebar-account small { display: block; margin-bottom: 3px; color: #969dac; font-size: 10px; }
.sidebar-account strong { display: block; max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sidebar-account .text-button { flex: 0 0 auto; font-size: 11px; }
.logout-button { margin-top: 0; }
.main-content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 88px; padding: 17px 34px; border-bottom: 1px solid rgba(231,233,239,.9); background: rgba(245,246,250,.88); backdrop-filter: blur(18px); }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.service-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #667084; }
.service-status span { width: 8px; height: 8px; border-radius: 50%; background: #27b17c; box-shadow: 0 0 0 4px rgba(39,177,124,.12); }
.mobile-menu-button { display: none; }
.content-wrap { max-width: 1500px; margin: 0 auto; padding: 30px 34px 56px; }
.page-section { animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.welcome-card { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 205px; padding: 38px 42px; border-radius: var(--radius-lg); overflow: hidden; color: #fff; background: linear-gradient(125deg, #30296e 0%, #554ce1 52%, #726bff 100%); box-shadow: 0 22px 48px rgba(72,64,178,.19); }
.welcome-card h2 { position: relative; z-index: 2; margin: 0 0 10px; font-size: 31px; letter-spacing: -.045em; }
.welcome-card p:last-child { position: relative; z-index: 2; margin: 0; color: rgba(255,255,255,.72); }
.welcome-pattern { position: absolute; width: 310px; height: 310px; right: 90px; top: -130px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 48px rgba(255,255,255,.035), 0 0 0 96px rgba(255,255,255,.025), 0 0 0 144px rgba(255,255,255,.018); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 17px; margin: 0 0 34px; }
.metric-card { min-height: 148px; padding: 22px; border: 1px solid #ebecef; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card-top { display: flex; align-items: center; justify-content: space-between; }
.metric-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.metric-icon.success { color: var(--success); background: var(--success-soft); }
.metric-icon.warning { color: var(--warning); background: var(--warning-soft); }
.metric-icon.neutral { color: #50617c; background: #edf1f6; }
.metric-icon svg { width: 19px; height: 19px; }
.metric-value { margin-top: 22px; font-size: 29px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.metric-foot { margin-top: 10px; font-size: 11px; color: #969dac; }
.skeleton-card { background: linear-gradient(100deg,#fff 20%,#f4f5f8 40%,#fff 60%); background-size: 200% 100%; animation: skeleton 1.3s infinite; }
@keyframes skeleton { to { background-position-x: -200%; } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 2px 16px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.code-card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 17px; }
.code-card { position: relative; min-width: 0; padding: 19px; border: 1px solid #e8eaf0; border-radius: var(--radius); cursor: pointer; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.code-card:hover { transform: translateY(-3px); border-color: #d9d5ff; box-shadow: 0 15px 38px rgba(31,38,62,.1); }
.code-card-head { display: flex; gap: 13px; align-items: flex-start; }
.qr-mini { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; color: var(--primary); background: var(--primary-soft); }
.qr-mini svg { width: 24px; height: 24px; }
.code-card-copy { min-width: 0; flex: 1; }
.code-card h3 { margin: 1px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.code-card-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #8c94a5; }
.code-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eff0f4; }
.scan-count { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; color: #5b6477; }
.scan-count svg { width: 15px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--success); background: var(--success-soft); }
.status-disabled { color: #858d9c; background: #f0f1f4; }

.toolbar-card { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px; border: 1px solid #e8eaf0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.search-field { position: relative; flex: 1; min-width: 180px; }
.search-field > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #929aaa; pointer-events: none; }
.search-field svg { width: 18px; height: 18px; }
.search-field input { height: 42px; padding-left: 42px; border-color: #eceef2; background: #f8f9fb; }
.segmented-control { display: inline-flex; gap: 3px; padding: 4px; border-radius: 10px; background: #f3f4f7; }
.filter-button { height: 34px; padding: 0 13px; border: 0; border-radius: 8px; cursor: pointer; color: #757d8e; background: transparent; font-size: 11px; font-weight: 750; }
.filter-button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(31,38,62,.08); }
.table-card { border: 1px solid #e7e9ef; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
.code-table { width: 100%; border-collapse: collapse; text-align: left; }
.code-table th { height: 48px; padding: 0 18px; border-bottom: 1px solid #eceef2; color: #9299a8; background: #fafbfc; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.code-table td { height: 73px; padding: 10px 18px; border-bottom: 1px solid #f0f1f4; font-size: 12px; color: #596275; white-space: nowrap; }
.code-table tr:last-child td { border-bottom: 0; }
.code-table tbody tr { cursor: pointer; transition: background .16s; }
.code-table tbody tr:hover { background: #fafaff; }
.table-code-cell { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.table-code-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.table-code-icon svg { width: 20px; }
.table-code-name { max-width: 250px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 750; color: var(--ink); }
.table-code-slug { margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: #969dac; }
.type-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 8px; color: #596275; background: #f4f5f8; font-size: 10px; font-weight: 750; }
.type-badge svg { width: 14px; }
.row-action { width: 33px; height: 33px; }
.pagination { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 10px 16px; border-top: 1px solid #eff0f4; }
.pagination-info { font-size: 11px; color: #8c94a4; }
.pagination-buttons { display: flex; gap: 7px; }
.empty-state { grid-column: 1 / -1; padding: 58px 22px; border: 1px dashed #dfe2ea; border-radius: var(--radius); text-align: center; color: #8a92a3; background: rgba(255,255,255,.62); }
.empty-state-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.empty-state-icon svg { width: 27px; height: 27px; }
.empty-state h3 { margin: 0 0 7px; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 0; font-size: 12px; }

.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(25,31,47,.42); backdrop-filter: blur(4px); animation: backdrop-in .2s ease; }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; width: min(640px, calc(100vw - 30px)); max-height: min(850px, calc(100vh - 30px)); transform: translate(-50%,-50%); border-radius: 20px; overflow: hidden; background: #fff; box-shadow: var(--shadow-lg); animation: modal-in .25s ease; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%,-48%) scale(.98); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.modal-header, .drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 25px; border-bottom: 1px solid var(--line); }
.modal-header h2, .drawer-header h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.modal-body { padding: 23px 25px 4px; overflow-y: auto; }
.modal-small { width: min(480px, calc(100vw - 30px)); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 25px; border-top: 1px solid var(--line); background: #fafbfc; }
.destination-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.destination-tab { display: flex; align-items: center; justify-content: center; gap: 8px; height: 45px; border: 1px solid #e2e5eb; border-radius: 10px; cursor: pointer; color: #697286; background: #fff; font-size: 12px; font-weight: 750; transition: all .18s; }
.destination-tab:hover { border-color: #cfcaff; color: var(--primary); }
.destination-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(99,91,255,.07); }
.destination-tab svg { width: 17px; }
.slug-field {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid #dfe2e9;
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.slug-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,91,255,.11);
}
.slug-prefix {
  display: flex;
  align-items: center;
  max-width: 58%;
  padding: 0 12px;
  border-right: 1px solid #eceef2;
  color: #7c8496;
  background: #f7f8fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slug-field input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase;
}
.alias-list { display: grid; gap: 7px; margin-top: 9px; }
.alias-item {
  padding: 9px 11px;
  border: 1px solid #eceef2;
  border-radius: 9px;
  color: #71798b;
  background: #fafbfc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.file-dropzone { display: grid; place-items: center; min-height: 155px; padding: 25px; border: 1.5px dashed #cacfe0; border-radius: 13px; cursor: pointer; text-align: center; background: #fafbff; transition: border .18s, background .18s; }
.file-dropzone:hover, .file-dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.file-dropzone input { display: none; }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 11px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.upload-icon svg { width: 21px; }
.file-dropzone strong { font-size: 13px; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 2px 0 22px; padding: 15px 0; border-top: 1px solid #eef0f4; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { margin-top: 4px; }
.toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-ui { position: relative; flex: 0 0 auto; width: 43px; height: 24px; border-radius: 99px; cursor: pointer; background: #ccd1da; transition: background .18s; }
.toggle-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(31,38,62,.23); transition: transform .18s; }
.toggle-input:checked + .toggle-ui { background: var(--primary); }
.toggle-input:checked + .toggle-ui::after { transform: translateX(19px); }

.drawer-backdrop { z-index: 70; }
.detail-drawer { position: fixed; right: 0; top: 0; z-index: 90; display: flex; flex-direction: column; width: min(500px, 100vw); height: 100vh; background: #fff; box-shadow: -24px 0 70px rgba(31,38,62,.18); transform: translateX(105%); transition: transform .28s cubic-bezier(.25,.8,.25,1); }
.detail-drawer.open { transform: translateX(0); }
.drawer-content { flex: 1; padding: 23px 25px 42px; overflow-y: auto; }
.drawer-hero { display: grid; grid-template-columns: 175px 1fr; gap: 20px; align-items: center; padding: 20px; border: 1px solid #e9e7ff; border-radius: 17px; background: linear-gradient(145deg,#faf9ff,#f0efff); }
.qr-preview { display: grid; place-items: center; width: 175px; height: 175px; padding: 12px; border: 1px solid #e5e4ee; border-radius: 14px; background: #fff; box-shadow: 0 9px 28px rgba(31,38,62,.08); }
.qr-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-skeleton { width: 100%; height: 100%; border-radius: 8px; background: linear-gradient(100deg,#f1f2f5 20%,#fff 40%,#f1f2f5 60%); background-size: 200% 100%; animation: skeleton 1.3s infinite; }
.drawer-hero-copy { min-width: 0; }
.drawer-hero-copy h3 { margin: 10px 0 6px; font-size: 18px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.drawer-hero-copy p { margin: 0 0 16px; font-size: 11px; line-height: 1.55; color: #7e879a; overflow-wrap: anywhere; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.info-section { margin-top: 24px; }
.info-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.info-section-heading h3 { margin: 0; font-size: 14px; }
.info-grid { border: 1px solid #eceef2; border-radius: 13px; overflow: hidden; }
.info-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 13px 15px; border-bottom: 1px solid #f0f1f4; font-size: 12px; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: #939baa; }
.info-row dd { margin: 0; min-width: 0; color: #424b5e; font-weight: 650; overflow-wrap: anywhere; }
.target-preview { padding: 15px; border: 1px solid #e8eaf0; border-radius: 13px; color: #4f586c; background: #fafbfc; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.stats-card { padding: 17px; border: 1px solid #e8eaf0; border-radius: 14px; background: #fff; }
.stats-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.stats-number { font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.stats-caption { margin-top: 5px; font-size: 10px; color: #969dac; }
.chart-wrap { position: relative; width: 100%; height: 165px; }
.chart-wrap canvas { width: 100%; height: 100%; }
.history-list { display: grid; gap: 9px; }
.history-item { display: flex; gap: 11px; padding: 12px; border: 1px solid #eceef2; border-radius: 11px; }
.history-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.history-item strong { display: block; font-size: 11px; }
.history-item small { display: block; margin-top: 4px; color: #929aaa; font-size: 10px; }
.drawer-bottom-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }

.toast-root { position: fixed; right: 22px; top: 22px; z-index: 200; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid #e5e7ed; border-radius: 12px; color: #3f485b; background: rgba(255,255,255,.96); box-shadow: 0 16px 42px rgba(31,38,62,.16); backdrop-filter: blur(16px); animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toast-icon { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; color: var(--success); background: var(--success-soft); }
.toast.error .toast-icon { color: var(--danger); background: var(--danger-soft); }
.toast strong { display: block; margin-bottom: 2px; font-size: 12px; }
.toast p { margin: 0; font-size: 11px; line-height: 1.5; color: #7d8597; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(25,31,47,.35); }

@media (max-width: 1120px) {
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .code-card-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 900px) {
  .login-view { padding: 20px; }
  .login-card { padding: 32px 26px; }
  .app-view { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 244px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 18px 0 50px rgba(31,38,62,.16); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-button { display: grid; margin-right: 12px; }
  .topbar { justify-content: flex-start; padding: 15px 20px; }
  .topbar-actions { margin-left: auto; }
  .service-status { display: none; }
  .content-wrap { padding: 24px 20px 46px; }
  .toolbar-card { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .toolbar-card > .button { margin-left: auto; }
}

@media (max-width: 640px) {
  .login-view { padding: 14px; }
  .login-card { padding: 28px 22px; border-radius: 18px; }
  .login-card h1 { font-size: 25px; }
  .slug-prefix { max-width: 48%; padding: 0 9px; }
  .topbar { min-height: 76px; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 20px; }
  .topbar-actions .create-code-button { width: 40px; padding: 0; font-size: 0; }
  .topbar-actions .create-code-button svg { width: 18px; height: 18px; }
  .content-wrap { padding: 18px 14px 40px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .metric-card { min-height: 132px; padding: 17px; }
  .metric-value { font-size: 25px; }
  .code-card-grid { grid-template-columns: 1fr; }
  .toolbar-card { padding: 10px; }
  .segmented-control { flex: 1; }
  .filter-button { flex: 1; padding: 0 7px; }
  .modal { width: 100vw; max-height: 92vh; left: 0; top: auto; bottom: 0; transform: none; border-radius: 20px 20px 0 0; animation: modal-mobile-in .25s ease; }
  @keyframes modal-mobile-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .destination-tabs { grid-template-columns: 1fr; }
  .destination-tab { justify-content: flex-start; padding: 0 15px; }
  .drawer-hero { grid-template-columns: 1fr; }
  .qr-preview { width: min(210px,100%); height: auto; aspect-ratio: 1; margin: auto; }
  .drawer-bottom-actions { grid-template-columns: 1fr; }
  .toast-root { right: 16px; top: 16px; }
}
