:root {
  --ink: #172033;
  --muted: #647087;
  --line: #dfe5ef;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --primary: #3157d5;
  --primary-dark: #2444ad;
  --success: #087a55;
  --success-bg: #eaf8f2;
  --danger: #b4233a;
  --danger-bg: #fff0f2;
  --shadow: 0 14px 36px rgba(28, 43, 74, 0.08);
  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; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  justify-content: space-between; min-height: 72px; padding: 12px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(223, 229, 239, .85); background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
}
.brand, .auth-brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: white; background: linear-gradient(145deg, #5275ef, #2645b4); font-weight: 800; box-shadow: 0 7px 18px rgba(49,87,213,.28); }
.brand strong, .auth-brand strong { display: block; letter-spacing: -.02em; }
.brand small, .auth-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.header-actions, .card-actions, .form-actions { display: flex; align-items: center; gap: 10px; }
.header-actions form, .card-actions form { margin: 0; }

.page { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 80px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading.compact { align-items: flex-start; }
.page-heading h1 { margin: 4px 0 8px; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -.04em; }
.page-heading p, .section-heading p, .form-section-heading p, .configuration-panel p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--primary) !important; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--primary); }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 720; text-decoration: none; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(49,87,213,.2); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 16px rgba(49,87,213,.18); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.button-ghost { color: var(--muted); background: transparent; }
.button-danger { color: var(--danger); background: transparent; }
.button-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.button-wide { width: 100%; }
.icon-button { padding: 8px 10px; border-radius: 8px; color: var(--primary); font-size: 13px; font-weight: 700; text-decoration: none; }
.icon-button:hover { background: #edf1ff; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 44px; }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 5px 20px rgba(31,45,73,.035); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 8px 0 5px; font-size: 27px; letter-spacing: -.035em; }
.metric-success strong { color: var(--success); }
.metric-danger strong { color: var(--danger); }
.section-heading { display: flex; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2, .configuration-panel h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.02em; }
.global-pause-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; padding: 20px 22px; border: 1px solid #d7deeb; border-radius: 15px; background: #fff; box-shadow: 0 5px 20px rgba(31,45,73,.035); }
.global-pause-panel h2 { margin: 3px 0 5px; font-size: 19px; }
.global-pause-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.global-pause-active { border-color: #e8c67c; background: #fffaf0; }
.global-pause-actions, .timed-pause-form { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.global-pause-actions form { margin: 0; }
.timed-pause-form label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.timed-pause-form input { width: 82px; }
.timed-pause-form select { width: 105px; }
.timed-pause-form input, .timed-pause-form select { min-height: 42px; }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.account-card, .panel, .form-section, .empty-state { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.account-card { padding: 22px; }
.account-card-warning { border-color: #efbdc5; }
.account-card-header, .account-identity { display: flex; align-items: center; }
.account-card-header { justify-content: space-between; gap: 16px; }
.account-identity { min-width: 0; gap: 12px; }
.account-identity h3 { overflow: hidden; margin: 0 0 5px; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #2b4abb; background: #e9edff; font-weight: 800; }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status-success { color: var(--success); background: var(--success-bg); }
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-neutral { color: #566176; background: #edf1f6; }
.account-warning { margin: 18px 0; padding: 13px 14px; border-radius: 10px; color: #852036; background: var(--danger-bg); }
.account-warning p { margin: 4px 0; font-size: 13px; }
.account-warning small { color: #985466; }
.account-paused { margin: 18px 0; padding: 13px 14px; border-radius: 10px; color: #465166; background: #edf1f6; }
.account-paused p { margin: 4px 0 0; font-size: 13px; }
.account-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.account-details div { min-width: 0; }
.account-details dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.account-details dd { overflow-wrap: anywhere; margin: 0; font-size: 13px; font-weight: 650; }
.account-details small { display: block; margin-top: 3px; color: var(--muted); font-weight: 450; }
.card-actions { flex-wrap: wrap; padding-top: 17px; border-top: 1px solid var(--line); }

.configuration-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; margin-top: 34px; padding: 24px; }
.config-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0; }
.config-list div { padding-left: 14px; border-left: 2px solid #e6eaf2; }
.config-list dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.config-list dd { margin: 5px 0 0; font-size: 13px; font-weight: 650; }
.settings-button { margin-top: 20px; }

.alert { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 24px; padding: 14px 16px; border: 1px solid; border-radius: 12px; }
.alert-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: currentColor; }
.alert strong { font-size: 14px; }
.alert p { margin: 3px 0 0; font-size: 13px; }
.alert-success { color: #086747; border-color: #b7e3d2; background: var(--success-bg); }
.alert-danger { color: #98243c; border-color: #f0c2ca; background: var(--danger-bg); }

.account-form { display: grid; gap: 18px; }
.form-section { padding: 26px; }
.form-section-heading { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 24px; }
.form-section-heading h2 { margin: 0 0 4px; font-size: 18px; }
.step { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: var(--primary); background: #edf1ff; font-size: 11px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: #354158; font-size: 13px; font-weight: 700; }
.field b { color: var(--danger); }
.field small { color: var(--muted); font-size: 11px; font-weight: 450; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd7e5; border-radius: 9px; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #aab7cb; }
textarea { min-height: 112px; resize: vertical; }
.password-control { position: relative; }
.password-control input { padding-right: 66px; }
.password-toggle { position: absolute; top: 50%; right: 7px; min-width: 50px; padding: 6px 8px; transform: translateY(-50%); border: 0; border-radius: 7px; color: var(--primary); background: #edf1ff; cursor: pointer; font-size: 11px; font-weight: 800; }
.password-toggle:hover { background: #dfe6ff; }
.password-toggle:focus-visible { outline: 3px solid rgba(49,87,213,.2); outline-offset: 2px; }
.form-note { margin-top: 22px; padding: 14px 16px; border: 1px solid #d8e0ed; border-radius: 10px; background: #f7f9fc; }
.form-note strong { font-size: 13px; }
.form-note p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.form-actions { position: sticky; bottom: 16px; justify-content: flex-end; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(10px); }

.empty-state { padding: 60px 24px; text-align: center; }
.empty-state h1, .empty-state h2 { margin: 12px 0 8px; }
.empty-state p { max-width: 480px; margin: 0 auto 22px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: auto; border-radius: 14px; color: var(--primary); background: #edf1ff; font-size: 23px; }
.error-code { color: var(--primary); font-size: 54px; font-weight: 850; letter-spacing: -.05em; }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #e6ecff, transparent 35%), radial-gradient(circle at 85% 90%, #e7f7f1, transparent 32%), var(--canvas); }
.auth-page { width: min(440px, 100%); }
.auth-card { padding: 34px; border: 1px solid rgba(223,229,239,.9); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 24px 60px rgba(32,47,80,.13); }
.auth-heading { margin: 34px 0 24px; }
.auth-heading h1 { margin: 5px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.auth-heading p { color: var(--muted); }
.stack { display: grid; gap: 17px; }
code { padding: 2px 5px; border-radius: 5px; background: #edf1f6; font-size: .9em; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .account-grid { grid-template-columns: 1fr; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-pause-panel { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
  .site-header { padding: 10px 16px; }
  .brand small { display: none; }
  .header-actions .button-primary { display: none; }
  .page { width: min(100% - 28px, 1240px); padding-top: 32px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metrics, .form-grid, .form-grid.three, .configuration-panel, .config-list { grid-template-columns: 1fr; }
  .account-details { grid-template-columns: 1fr; }
  .form-section { padding: 20px; }
  .form-actions { bottom: 8px; }
  .auth-card { padding: 26px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
