:root {
  --blue: #2163ed;
  --blue-dark: #1546bb;
  --blue-soft: #edf4ff;
  --ink: #10203c;
  --muted: #64748b;
  --line: #e2e8f0;
  --canvas: #f5f7fb;
  --white: #fff;
  --green: #059669;
  --green-soft: #eafaf3;
  --amber: #b45309;
  --amber-soft: #fff7e8;
  --red: #dc2626;
  --red-soft: #fff0f0;
  --shadow: 0 12px 40px rgba(27, 46, 88, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
[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;
}

.brand-logo { display: block; width: 154px; height: auto; }
.brand-logo-large { width: 190px; }
.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.muted { color: var(--muted); }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 47%) 1fr;
  background: var(--white);
}
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 64px clamp(42px, 7vw, 110px);
  color: var(--white);
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.22), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(92,171,255,.42), transparent 30%),
    linear-gradient(145deg, #123ea8 0%, #2163ed 55%, #4387f5 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  right: -220px;
  top: 10%;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.045), 0 0 0 140px rgba(255,255,255,.035);
}
.brand-copy { position: relative; z-index: 1; max-width: 540px; }
.brand-copy .brand-logo {
  margin-bottom: clamp(86px, 14vh, 150px);
  filter: brightness(0) invert(1);
}
.brand-copy .eyebrow { color: #cfe0ff; }
.brand-copy h1 {
  max-width: 520px;
  margin: 0 0 24px;
  font-size: clamp(42px, 5vw, 70px);
  line-height: 1.01;
  letter-spacing: -0.045em;
}
.login-intro {
  max-width: 510px;
  margin: 0;
  color: #dce8ff;
  font-size: 18px;
  line-height: 1.6;
}
.security-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #e7efff;
}
.security-note strong, .security-note span { display: block; }
.security-note strong { margin-bottom: 3px; color: white; font-size: 13px; }
.security-note span { font-size: 12px; }
.security-icon {
  display: grid !important;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(255,255,255,.11);
  font-weight: 800;
}
.login-card-wrap {
  display: grid;
  place-items: center;
  padding: 38px;
  background: #fbfcff;
}
.login-card { width: min(100%, 420px); }
.login-card h2 {
  margin: 0 0 9px;
  font-size: 36px;
  letter-spacing: -0.035em;
}
.login-card > .muted { margin: 0 0 35px; font-size: 15px; }
.login-card label {
  display: block;
  margin: 19px 0 8px;
  color: #34425a;
  font-size: 13px;
  font-weight: 700;
}
.login-card input, .search-field input {
  width: 100%;
  border: 1px solid #d8e0ec;
  outline: none;
  color: var(--ink);
  background: var(--white);
  transition: border-color .16s, box-shadow .16s;
}
.login-card input {
  height: 52px;
  padding: 0 15px;
  border-radius: 10px;
}
.login-card input:focus, .search-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33,99,237,.12);
}
.mobile-logo { display: none; margin-bottom: 50px; }
.privacy-copy { margin: 17px 12px 0; color: #8290a6; font-size: 11px; line-height: 1.5; text-align: center; }
.form-error {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  color: #b91c1c;
  background: var(--red-soft);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  transition: transform .12s, background .12s, border-color .12s;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(33,99,237,.18); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: #d9e1ec; color: #34425a; background: white; }
.button-secondary:hover { border-color: #bcc9dc; background: #f8fafc; }
.button-danger { color: white; background: var(--red); }
.button-danger:hover { background: #b91c1c; }
.button-success { color: white; background: var(--green); }
.button-success:hover { background: #047857; }
.button-full { width: 100%; min-height: 50px; margin-top: 24px; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  padding: 30px 22px 24px;
  border-right: 1px solid var(--line);
  background: var(--white);
}
.sidebar-logo { display: inline-block; padding: 4px 9px 18px; }
.sidebar-label { margin: 12px 12px 10px; color: #9aa6b8; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #506077;
  background: transparent;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover { color: var(--ink); background: #f6f8fb; }
.nav-item.active { color: var(--blue); background: var(--blue-soft); }
.nav-icon { display: grid; place-items: center; width: 23px; height: 23px; font-size: 18px; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 12px; color: #7b899e; font-size: 12px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px #dcfce7; }
.main-column { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  padding: 22px clamp(24px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.owner-menu { display: flex; align-items: center; gap: 11px; }
.owner-avatar {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, #1649be, #3d83f3);
  font-weight: 800;
}
.owner-text { display: grid; min-width: 190px; }
.owner-text strong { overflow: hidden; max-width: 210px; font-size: 12px; text-overflow: ellipsis; }
.owner-text span { margin-top: 2px; color: #8a97aa; font-size: 11px; }
.content { width: min(100%, 1400px); margin: 0 auto; padding: 34px clamp(22px, 4vw, 52px) 60px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 106px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 6px 20px rgba(26,45,84,.035);
}
.stat-card span { display: block; margin-bottom: 6px; color: #7a879a; font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; font-size: 28px; letter-spacing: -.035em; }
.stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 45px; height: 45px; border-radius: 12px; font-size: 19px; font-weight: 800; }
.stat-total .stat-icon { color: var(--blue); background: var(--blue-soft); }
.stat-active .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-confirmed .stat-icon { color: #7c3aed; background: #f3efff; }
.stat-new .stat-icon { color: var(--amber); background: var(--amber-soft); }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; }
.panel-header h2 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.015em; }
.panel-header p { margin: 0; font-size: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 26px; border-top: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; background: #fbfcfe; }
.search-field { position: relative; width: min(100%, 420px); }
.search-field input { height: 41px; padding: 0 14px 0 39px; border-radius: 9px; }
.search-icon { position: absolute; left: 13px; top: 8px; z-index: 1; color: #8190a5; font-size: 19px; }
.check-field { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; font-weight: 650; white-space: nowrap; }
.check-field input { width: 16px; height: 16px; accent-color: var(--blue); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: #7d8a9e; background: #f8fafc; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 16px 18px; border-top: 1px solid #edf1f6; color: #445269; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fbfcff; }
.account-cell { display: flex; align-items: center; gap: 11px; min-width: 240px; }
.account-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: white; background: linear-gradient(135deg, #255dd4, #4c8df7); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.account-avatar.system { color: #59677c; background: #e9edf3; }
.account-name { display: grid; gap: 3px; }
.account-name strong { color: #1d2c45; font-size: 12px; }
.account-name code { max-width: 260px; overflow: hidden; color: #8b98aa; font-size: 9px; text-overflow: ellipsis; }
.tag { display: inline-flex; align-items: center; width: fit-content; min-height: 23px; padding: 0 9px; border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: capitalize; }
.tag-active, .tag-confirmed { color: #047857; background: #e7f8f0; }
.tag-suspended { color: #b91c1c; background: #feecec; }
.tag-deactivated, .tag-unconfirmed { color: #9a5a08; background: #fff4dd; }
.tag-system { color: #59677c; background: #edf1f5; }
.email-cell { display: grid; gap: 5px; min-width: 190px; }
.email-cell span:first-child { overflow-wrap: anywhere; }
.row-actions { display: flex; justify-content: flex-end; min-width: 100px; }
.empty-state { padding: 70px 24px; color: #8290a4; text-align: center; }
.panel-footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 26px; border-top: 1px solid #edf1f6; color: #8a97a9; font-size: 11px; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 17px 26px; border-top: 1px solid #edf1f6; }
.activity-item:first-child { border-top: 0; }
.activity-marker { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.activity-copy { display: grid; gap: 4px; min-width: 0; }
.activity-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.activity-copy span, .activity-time { color: #8491a4; font-size: 11px; }
.icon-button { border: 0; background: transparent; }
.mobile-menu { display: none; margin-right: 11px; }
.dialog { width: min(92vw, 450px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 25px 80px rgba(16,32,60,.24); }
.dialog::backdrop { background: rgba(10,23,47,.52); backdrop-filter: blur(3px); }
.dialog-card { position: relative; padding: 32px; text-align: center; }
.dialog-close { position: absolute; right: 15px; top: 12px; border: 0; color: #8996a8; background: transparent; font-size: 25px; }
.dialog-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%; color: var(--red); background: var(--red-soft); font-size: 22px; font-weight: 900; }
.dialog-card h2 { margin: 0 0 9px; font-size: 22px; }
.dialog-card p { margin: 0 auto; max-width: 350px; font-size: 13px; line-height: 1.55; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 27px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(380px, calc(100vw - 48px)); padding: 14px 17px; border-radius: 11px; color: white; background: #172a4a; box-shadow: 0 14px 40px rgba(12,28,55,.22); font-size: 12px; font-weight: 700; }
.toast.error { background: #b91c1c; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .owner-text { display: none; }
}

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card-wrap { min-height: 100vh; padding: 26px; }
  .mobile-logo { display: block; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -260px; width: 244px; transition: left .18s ease; box-shadow: 10px 0 35px rgba(22,42,78,.15); }
  .app-shell.menu-open .sidebar { left: 0; }
  .mobile-menu { display: inline-block; }
  .topbar > div:first-child { display: flex; align-items: center; flex-wrap: wrap; }
  .topbar .eyebrow { width: calc(100% - 42px); }
  .topbar h1 { margin-left: 42px; }
}

@media (max-width: 600px) {
  .topbar { min-height: 86px; padding: 17px 16px; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { margin-left: 0; font-size: 23px; }
  .owner-avatar { display: none; }
  .content { padding: 20px 13px 40px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 92px; padding: 14px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-card strong { font-size: 23px; }
  .panel-header { padding: 20px 18px; }
  .toolbar { align-items: stretch; flex-direction: column; padding: 13px 18px; }
  .search-field { width: 100%; }
  .panel-footer { padding: 13px 18px; }
  .activity-item { grid-template-columns: 36px minmax(0,1fr); padding: 15px 18px; }
  .activity-time { grid-column: 2; }
}
