.admin-page { background: #f3f6fa; color: #0a2342; min-height: 100dvh; }
.admin-header { align-items: center; background: #fff; border-bottom: 1px solid #d8e1eb; display: flex; justify-content: space-between; min-height: 76px; padding: 12px clamp(20px, 4vw, 64px); }
.admin-brand { align-items: center; display: flex; gap: 12px; }
.admin-brand .brand-logo { height: 43px; width: 43px; }
.admin-brand > span:last-child { display: flex; flex-direction: column; }
.admin-brand strong { font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.admin-brand small { color: #637389; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.admin-back { align-items: center; border: 1px solid #c9d4e0; border-radius: 3px; display: inline-flex; font-size: 13px; font-weight: 600; gap: 8px; min-height: 44px; padding: 0 16px; }
.admin-header-actions { align-items: center; display: flex; gap: 10px; }
.admin-header-actions form { margin: 0; }
.admin-logout { align-items: center; background: #fff; border: 1px solid #c9d4e0; border-radius: 3px; color: #7b2a25; cursor: pointer; display: inline-flex; font-size: 13px; font-weight: 650; gap: 8px; min-height: 44px; padding: 0 16px; }
.admin-content { margin: 0 auto; max-width: 1440px; padding: 48px clamp(20px, 4vw, 64px) 80px; }
.admin-intro { align-items: flex-end; display: flex; gap: 30px; justify-content: space-between; margin-bottom: 34px; }
.admin-kicker { color: #0055a4; display: block; font-size: 10px; font-weight: 750; letter-spacing: .1em; margin-bottom: 10px; text-transform: uppercase; }
.admin-intro h1 { font-size: clamp(38px, 4vw, 58px); letter-spacing: -.045em; line-height: 1; margin: 0; }
.admin-intro p { color: #607086; font-size: 14px; margin: 14px 0 0; }
.admin-actions { display: flex; gap: 10px; }
.admin-actions button,.admin-actions a,.copy-button { align-items: center; border: 1px solid #c7d2df; border-radius: 3px; cursor: pointer; display: inline-flex; font-size: 13px; font-weight: 650; gap: 8px; justify-content: center; min-height: 44px; padding: 0 16px; }
.admin-actions button,.admin-actions .admin-refresh { background: #fff; color: #0a2342; }
.admin-actions a { background: #0055a4; border-color: #0055a4; color: #fff; }
.admin-actions button:disabled { cursor: wait; opacity: .58; }
.admin-error { background: #fff1f0; border-left: 4px solid #d52b1e; color: #8b211a; margin-bottom: 22px; padding: 14px 16px; }
.metric-grid { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 22px; }
.metric-grid article { background: #fff; border: 1px solid #d8e1eb; min-height: 150px; padding: 22px; position: relative; }
.metric-icon { align-items: center; background: #edf4fb; color: #0055a4; display: inline-flex; height: 38px; justify-content: center; position: absolute; right: 20px; top: 20px; width: 38px; }
.metric-grid small { color: #66768a; display: block; font-size: 12px; font-weight: 600; margin-bottom: 25px; }
.metric-grid strong { display: block; font-size: 36px; letter-spacing: -.04em; line-height: 1; }
.metric-grid .metric-date { font-size: 18px; letter-spacing: -.02em; line-height: 1.3; max-width: 150px; }
.admin-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .7fr); margin-bottom: 22px; }
.admin-panel { background: #fff; border: 1px solid #d8e1eb; }
.panel-heading { align-items: center; border-bottom: 1px solid #e1e7ee; display: flex; justify-content: space-between; padding: 20px 22px; }
.panel-heading span { color: #6b7a8d; display: block; font-size: 9px; font-weight: 700; letter-spacing: .1em; margin-bottom: 4px; text-transform: uppercase; }
.panel-heading h2 { font-size: 20px; letter-spacing: -.025em; margin: 0; }
.count-badge { align-items: center; background: #0a2342; color: #fff !important; display: inline-flex !important; font-size: 12px !important; height: 30px; justify-content: center; margin: 0 !important; min-width: 30px; padding: 0 8px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 680px; width: 100%; }
th { color: #68788b; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 13px 18px; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid #edf0f4; color: #43546a; font-size: 12px; padding: 16px 18px; vertical-align: middle; }
td > strong { color: #0a2342; display: block; font-size: 13px; margin-bottom: 3px; }
td > a { color: #0055a4; }
.status-badge { align-items: center; background: #edf8f2; color: #176b42; display: inline-flex; font-size: 10px; font-weight: 700; gap: 6px; padding: 5px 8px; text-transform: uppercase; }
.status-badge span { background: #20945c; border-radius: 50%; height: 6px; width: 6px; }
.empty-state { align-items: center; color: #6a798b; display: flex; flex-direction: column; gap: 7px; justify-content: center; min-height: 190px; text-align: center; }
.empty-state strong { color: #263b55; font-size: 14px; }
.empty-state span { font-size: 12px; }
.empty-state.compact { flex-direction: row; min-height: 100px; }
.email-panel { border-top: 4px solid #0055a4; padding: 26px; }
.email-icon { align-items: center; background: #0a2342; color: #fff; display: flex; height: 42px; justify-content: center; margin-bottom: 24px; width: 42px; }
.email-panel h2 { font-size: 25px; letter-spacing: -.035em; line-height: 1.12; margin: 0 0 22px; }
.email-preview { background: #f5f7fa; border-left: 3px solid #ef4135; padding: 16px; }
.email-preview p { font-size: 12px; margin: 0 0 14px; }
.email-preview pre { color: #405167; font-family: var(--font-geist-sans), sans-serif; font-size: 12px; line-height: 1.55; margin: 0; white-space: pre-wrap; }
.copy-button { background: #0055a4; border-color: #0055a4; color: #fff; margin-top: 16px; width: 100%; }
.visits-panel { margin-bottom: 20px; }
.visits-panel table { min-width: 600px; }
.leads-panel table { min-width: 1160px; }
.visits-panel table { min-width: 1280px; }
.user-agent-cell { line-height: 1.45; max-width: 300px; min-width: 240px; }
.location-cell { min-width: 190px; }
.location-cell strong { margin-bottom: 2px; }
.location-cell span,.location-cell small { color: #65758a; display: block; font-size: 10px; line-height: 1.4; }
td code {
  color: #405167;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.spin { animation: admin-spin .85s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }

.admin-auth-body { background: #edf2f7; color: #0a2342; min-height: 100dvh; }
.admin-auth-shell { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 100dvh; padding: 34px 20px; }
.auth-brand { margin-bottom: 24px; }
.admin-auth-card { background: #fff; border: 1px solid #d6e0ea; border-top: 5px solid #0055a4; box-shadow: 0 24px 70px rgba(7,27,56,.12); max-width: 520px; padding: clamp(28px,5vw,48px); width: 100%; }
.admin-auth-card h1 { font-size: clamp(30px,5vw,42px); letter-spacing: -.04em; line-height: 1.04; margin: 0 0 15px; }
.admin-auth-card > p { color: #607086; font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.admin-auth-form { display: grid; gap: 9px; }
.admin-auth-form label { font-size: 12px; font-weight: 700; margin-top: 8px; }
.admin-auth-form input { border: 1px solid #bdc9d7; border-radius: 3px; color: #0a2342; min-height: 48px; padding: 0 13px; width: 100%; }
.admin-auth-form input:focus { border-color: #0055a4; box-shadow: 0 0 0 3px rgba(0,85,164,.12); outline: 0; }
.admin-auth-form small { color: #64758a; font-size: 11px; line-height: 1.45; }
.auth-submit { align-items: center; background: #0055a4; border: 0; border-radius: 3px; color: #fff; cursor: pointer; display: flex; font-weight: 700; gap: 9px; justify-content: center; margin-top: 14px; min-height: 50px; padding: 0 18px; width: 100%; }
.auth-return { align-items: center; color: #52657b; display: inline-flex; font-size: 12px; font-weight: 650; gap: 7px; margin-top: 22px; }

@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1000px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .admin-header { padding-left: 16px; padding-right: 16px; }
  .admin-brand small { display: none; }
  .admin-back { font-size: 0; padding: 0 13px; }
  .admin-back svg { margin: 0; }
  .admin-logout { font-size: 0; padding: 0 13px; }
  .admin-content { padding: 32px 16px 60px; }
  .admin-intro { align-items: stretch; flex-direction: column; }
  .admin-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article { min-height: 130px; padding: 18px; }
  .metric-grid strong { font-size: 30px; }
  .metric-icon { right: 16px; top: 16px; }
}
