:root {
  --ink: #17212b;
  --muted: #66727e;
  --paper: #f5f6f7;
  --card: #ffffff;
  --line: #e2e6e9;
  --teal: #0f766e;
  --teal-dark: #0a5b55;
  --teal-soft: #e6f5f2;
  --lime: #c9f266;
  --amber: #d97706;
  --amber-soft: #fff7e8;
  --red: #bf4141;
  --red-soft: #fff0f0;
  --shadow: 0 20px 50px rgba(20, 38, 48, .09);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 46%) 1fr; background: #fff; }
.login-card { width: min(470px, 80%); margin: auto; padding: 50px 0; }
.brand { display: flex; align-items: center; gap: 11px; font-family: Inter, "Segoe UI", system-ui, sans-serif; font-weight: 800; font-size: 18px; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--teal); color: white; box-shadow: inset 0 -7px 16px rgba(0,0,0,.1); }
.brand-login { margin-bottom: 64px; }
.eyebrow, .breadcrumb { color: var(--teal); font-size: 11px; letter-spacing: .15em; font-weight: 700; }
.login-card h1 { font-family: Inter, "Segoe UI", system-ui, sans-serif; font-size: clamp(38px, 4vw, 58px); line-height: 1.06; letter-spacing: -.045em; margin: 16px 0 20px; }
.login-card h1 span { color: var(--teal); }
.login-copy { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0 0 34px; }
.login-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: #33414d; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; transition: .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.password-wrap { display: flex; position: relative; }
.password-wrap input { padding-right: 62px; }
.password-wrap button { position: absolute; right: 6px; top: 6px; }
.icon-btn { border: 0; background: #eef1f2; padding: 8px 10px; border-radius: 8px; color: #44515c; font-size: 12px; font-weight: 700; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-weight: 700; transition: transform .18s, background .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: white; box-shadow: 0 7px 15px rgba(15,118,110,.17); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: white; color: #40505c; border-color: var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; display: flex; justify-content: space-between; margin-top: 3px; padding: 13px 16px; }
.form-error { color: var(--red); font-size: 13px; margin: -7px 0 0; }
.login-note { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ba573; box-shadow: 0 0 0 4px rgba(43,165,115,.11); display: inline-block; }

.login-aside { position: relative; overflow: hidden; display: grid; place-items: center; background: #102e2d; }
.login-aside::before { content: ""; position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 52px 52px; }
.orb { position: absolute; width: 390px; height: 390px; border-radius: 50%; filter: blur(10px); }
.orb-one { background: rgba(74, 222, 128, .17); top: -130px; right: -100px; }
.orb-two { background: rgba(45, 212, 191, .15); bottom: -170px; left: -90px; }
.preview-window { position: relative; z-index: 2; width: min(680px, 78%); padding: 24px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; color: white; background: rgba(255,255,255,.08); box-shadow: 0 30px 90px rgba(0,0,0,.32); backdrop-filter: blur(15px); transform: rotate(-2deg); }
.preview-top { display: flex; gap: 7px; align-items: center; color: rgba(255,255,255,.55); font-size: 11px; margin-bottom: 28px; }
.preview-top i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.38); }
.preview-top span { margin-left: 8px; }
.preview-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.preview-metrics div { background: rgba(8,29,28,.43); padding: 18px; border-radius: 13px; }
.preview-metrics small { display: block; color: rgba(255,255,255,.55); }
.preview-metrics strong { font: 800 30px Inter, "Segoe UI", system-ui, sans-serif; display: block; margin: 8px 0; }
.preview-metrics em { color: var(--lime); font-size: 11px; font-style: normal; }
.preview-chart { height: 110px; margin: 14px 0; background: rgba(8,29,28,.43); border-radius: 13px; display: flex; align-items: end; gap: 9px; padding: 18px; }
.preview-chart span { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(var(--lime), #38b59f); opacity: .86; }
.preview-chart span:nth-child(1) { height: 30%; }.preview-chart span:nth-child(2) { height: 56%; }.preview-chart span:nth-child(3) { height: 44%; }.preview-chart span:nth-child(4) { height: 76%; }.preview-chart span:nth-child(5) { height: 63%; }.preview-chart span:nth-child(6) { height: 89%; }.preview-chart span:nth-child(7) { height: 70%; }
.preview-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; background: rgba(8,29,28,.43); border-radius: 10px; margin-top: 8px; font-size: 12px; }
.preview-row span { color: var(--lime); }

.app-shell { display: grid; grid-template-columns: 238px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 18px 20px; background: #142d2c; color: white; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand-mark { background: var(--lime); color: #14302e; }
.sidebar nav { display: grid; gap: 5px; padding-top: 24px; }
.nav-item { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.62); display: flex; align-items: center; gap: 11px; border-radius: 9px; padding: 10px 12px; font-size: 13px; font-weight: 600; text-align: left; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 var(--lime); }
.nav-icon { width: 19px; text-align: center; font-size: 16px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.provider-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 11px; padding: 14px; }
.provider-title { font-size: 12px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.provider-card p { color: rgba(255,255,255,.48); font-size: 11px; line-height: 1.45; margin: 9px 0 0; }
.mobile-topbar { display: none; }
.content-shell { min-width: 0; }
.topbar { min-height: 97px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 20px 36px; }
.breadcrumb { margin: 0 0 5px; color: #88939c; font-size: 9px; }
.breadcrumb span { color: var(--teal); }
.topbar h2 { margin: 0; font: 800 24px Inter, "Segoe UI", system-ui, sans-serif; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; margin-left: 4px; background: #d7efe9; color: var(--teal-dark); font-size: 11px; font-weight: 800; }
.page-content { padding: 30px 36px 54px; max-width: 1500px; margin: auto; }
.notice { background: #ebf6f3; border: 1px solid #cfe9e2; color: #355953; border-radius: 11px; padding: 11px 14px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 22px; }
.notice strong { color: var(--teal-dark); }
.notice button { border: 0; background: transparent; color: var(--teal); text-decoration: underline; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.stat-card, .panel { background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 5px 18px rgba(25,44,54,.035); }
.stat-card { padding: 20px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-card small { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); }
.stat-value { font: 800 29px Inter, "Segoe UI", system-ui, sans-serif; margin: 13px 0 5px; }
.stat-meta { color: #84909a; font-size: 11px; }
.stat-meta.good { color: #278463; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 17px; margin-top: 17px; }
.panel { overflow: hidden; }
.panel-head { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h3 { font: 800 14px Inter, "Segoe UI", system-ui, sans-serif; margin: 0; }
.panel-head p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.panel-body { padding: 18px 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: #7c8790; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid #edf0f2; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.email-cell { font-weight: 700; color: #283640; }
.subtext { display: block; font-size: 10px; color: #929ba3; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 30px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.badge.active, .badge.verified { background: var(--teal-soft); color: var(--teal); }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.suspended, .badge.expired { background: var(--red-soft); color: var(--red); }
.action-btn { border: 0; border-radius: 7px; padding: 6px 8px; background: #f0f3f4; color: #4a5964; font-size: 11px; font-weight: 700; }
.action-btn + .action-btn { margin-left: 3px; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 29px 1fr; gap: 11px; padding: 11px 0; border-bottom: 1px solid #eef0f1; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 27px; height: 27px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.activity-item p { margin: 0; font-size: 11px; line-height: 1.45; }
.activity-item time { display: block; color: #98a1a8; font-size: 9px; margin-top: 3px; }
.section-head { display: flex; justify-content: space-between; gap: 15px; align-items: end; margin: 3px 0 18px; }
.section-head h3 { font: 800 19px Inter, "Segoe UI", system-ui, sans-serif; margin: 0; }
.section-head p { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.searchbar { display: flex; gap: 8px; }
.searchbar input { min-width: 245px; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; }
.mail-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.5fr); min-height: 530px; }
.mail-list { border-right: 1px solid var(--line); }
.mailbox-select { padding: 16px; border-bottom: 1px solid var(--line); }
.message-item { display: block; width: 100%; border: 0; border-bottom: 1px solid #edf0f1; background: white; padding: 14px 17px; text-align: left; }
.message-item:hover, .message-item.active { background: #f1f8f6; }
.message-item strong { display: block; font-size: 12px; }
.message-item span { color: var(--muted); display: block; font-size: 10px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-detail { padding: 25px 28px; }
.message-detail h3 { font: 800 21px Inter, "Segoe UI", system-ui, sans-serif; margin: 5px 0 17px; }
.message-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.message-body { white-space: pre-line; color: #40505b; line-height: 1.7; font-size: 13px; padding-top: 18px; }

.modal { width: min(520px, calc(100% - 28px)); border: 0; border-radius: 16px; padding: 0; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(12,25,30,.58); backdrop-filter: blur(3px); }
.modal-close { position: absolute; right: 15px; top: 13px; border: 0; background: #eef1f2; width: 30px; height: 30px; border-radius: 50%; font-size: 19px; color: #5c6972; }
.modal-body { padding: 27px; }
.modal-body h3 { font: 800 21px Inter, "Segoe UI", system-ui, sans-serif; margin: 0 40px 7px 0; }
.modal-body > p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 20px; }
.architecture { display: grid; gap: 10px; }
.arch-layer { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.arch-layer strong { font-size: 12px; }
.arch-layer span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.toast-region { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { background: #173c39; color: white; border-radius: 10px; padding: 12px 15px; box-shadow: var(--shadow); font-size: 12px; animation: toastIn .25s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 50; left: -250px; transition: left .2s; width: 238px; }
  .sidebar.open { left: 0; box-shadow: 10px 0 40px rgba(0,0,0,.25); }
  .mobile-topbar { display: flex; padding: 13px 17px; justify-content: space-between; align-items: center; background: #142d2c; color: white; }
  .mobile-topbar .brand-mark { background: var(--lime); color: #14302e; }
  .topbar { padding: 18px; align-items: flex-end; }
  .topbar-actions .btn-secondary, .avatar { display: none; }
  .page-content { padding: 20px 16px 45px; }
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 310px; overflow-y: auto; }
  .searchbar { width: 100%; }
  .searchbar input { min-width: 0; }
}
@media (max-width: 520px) {
  .login-card { width: auto; margin: 0; padding: 30px 22px; }
  .brand-login { margin-bottom: 50px; }
  .stats-grid { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .topbar-actions .btn { font-size: 11px; }
}
