/* Shared design tokens for admin panel and webmail – GOOT Theme (https://goot.co.in) */
:root {
  /* GOOT brand palette */
  --goot-navy: #1c3957;
  --goot-sky: #5bc8f5;
  --goot-blue: #29abe2;
  --goot-light-blue: #7fd9ff;
  --goot-deep: #0d2035;

  --brand: #29abe2;
  --brand-2: #1b8ec4;
  --brand-rgb: 41, 171, 226;
  --on-brand: #ffffff;

  --bg: #f0f6fb;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #e3eff8;
  --surface-3: #d6e8f5;
  --text: #0d1e2e;
  --text-2: #224160;
  --text-3: #4d7493;
  --border: #d2e4f2;
  --primary: var(--brand);
  --primary-2: var(--brand-2);
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --grad: linear-gradient(135deg, #1b8ec4 0%, #29abe2 50%, #5bc8f5 100%);
  --grad-soft: rgba(41, 171, 226, .10);
  --shadow: 0 8px 24px rgba(13, 32, 53, .07);
  --shadow-lg: 0 20px 50px rgba(13, 32, 53, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Quicksand', 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #5bc8f5;
  --brand-2: #29abe2;
  --brand-rgb: 91, 200, 245;
  --on-brand: #07101c;

  --bg: #0b1929;
  --bg-2: #07101c;
  --surface: #0e2038;
  --surface-2: #132840;
  --surface-3: #183352;
  --text: #edf5ff;
  --text-2: #a8cce6;
  --text-3: #6a96b4;
  --border: rgba(91, 200, 245, 0.18);
  --primary: var(--brand);
  --primary-2: var(--brand-2);
  --grad: linear-gradient(135deg, #1b8ec4 0%, #29abe2 50%, #5bc8f5 100%);
  --grad-soft: rgba(91, 200, 245, .12);
  --shadow: 0 10px 32px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .65);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; transition: .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); color: #ffffff; border: 0; box-shadow: 0 4px 18px rgba(var(--brand-rgb), .32); }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(var(--brand-rgb), .42); }
.btn.danger { color: var(--red); border-color: rgba(239,68,68,.35); }
.btn.danger:hover { background: rgba(239,68,68,.1); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: var(--text-2); transition: .15s; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; }
.btn.sm svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 14px; outline: none; transition: .15s; }
.input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(var(--brand-rgb),.15); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 12px 0 0 12px; }
.input-group .suffix { white-space: nowrap; border: 1.5px solid var(--border); border-left: 0; border-radius: 0 12px 12px 0; padding: 10px 14px; background: var(--surface-2); color: var(--text-2); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; transition: .15s; }
.chip:hover { border-color: var(--primary-2); }
.chip.active { background: var(--grad); color: #ffffff; border-color: transparent; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(16,185,129,.14); color: #059669; }
.badge.warn { background: rgba(245,158,11,.16); color: #b45309; }
.badge.bad { background: rgba(239,68,68,.14); color: #dc2626; }
.badge.info { background: rgba(var(--brand-rgb),.12); color: var(--primary); }
.badge.muted { background: var(--surface-2); color: var(--text-3); }
:root[data-theme="dark"] .badge.ok { color: #34d399; } :root[data-theme="dark"] .badge.warn { color: #fbbf24; } :root[data-theme="dark"] .badge.bad { color: #f87171; } 

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

.modal-back { position: fixed; inset: 0; background: rgba(11, 25, 41, .60); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; animation: pop .18s; border: 1px solid var(--border); }
.modal.wide { width: min(860px, 100%); }
.modal-head { padding: 20px 24px 8px; display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-body { padding: 8px 24px 8px; }
.modal-foot { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--grad); color: #ffffff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s; max-width: 90vw; }
.toast.error { background: #dc2626; }
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }

.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; overflow: hidden; font-size: 15px; background: var(--grad); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.progress.warn > span { background: linear-gradient(90deg, #f59e0b, #f97316); }
.progress.bad > span { background: linear-gradient(90deg, #ef4444, #dc2626); }

.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.muted { color: var(--text-3); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }

/* Login screens */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 600px at 15% 0%, rgba(var(--brand-rgb),.14), transparent 60%),
  radial-gradient(800px 600px at 100% 100%, rgba(41, 171, 226,.12), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); padding: 36px 32px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.auth-card h1 { margin: 14px 0 4px; font-size: 26px; }
.auth-card p.sub { margin: 0 0 24px; color: var(--text-2); }
.logo { width: 52px; height: 52px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; color: #ffffff; box-shadow: 0 10px 24px rgba(var(--brand-rgb),.24); overflow: hidden; }
.logo.img { background: transparent; box-shadow: none; border-radius: 0; width: auto; min-width: 42px; display: flex; align-items: center; }
.logo.img img { height: 38px; width: auto; max-width: 170px; object-fit: contain; display: block; }
.logo svg { width: 28px; height: 28px; }
.error-text { color: var(--red); font-weight: 600; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
