/* Ringing Portal — shared admin UI, same brand system as ringing.pro */
:root {
  --ink: #0d0d0f;
  --ink-800: #17161a;
  --ink-700: #211f24;
  --paper: #ffffff;
  --paper-alt: #f7f6f7;
  --line: #e8e6e8;
  --line-soft: #f1f0f1;
  --text: #121114;
  --text-muted: #5c5960;
  --text-faint: #8b8890;
  --red: #e31221;
  --red-dark: #9c0d1a;
  --red-light: #ff4757;
  --red-soft: #fdeaec;
  --grad-brand: linear-gradient(135deg, var(--red-light) 0%, var(--red) 55%, var(--red-dark) 100%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(10,8,10,.06), 0 2px 6px rgba(10,8,10,.05);
  --shadow-md: 0 10px 30px rgba(10,8,10,.10);
  --sidebar-w: 240px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  color: var(--text); background: var(--paper-alt);
}
h1,h2,h3,h4 { font-family: 'Sora','Inter',sans-serif; margin: 0 0 .4em; letter-spacing: -0.02em; font-weight: 700; }
a { color: inherit; text-decoration: none; }
p { color: var(--text-muted); margin: 0 0 1em; }

/* ---------- login page ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink); position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(760px 420px at 10% 0%, rgba(227,18,33,.22), transparent 60%),
              radial-gradient(760px 420px at 90% 100%, rgba(227,18,33,.14), transparent 60%),
              radial-gradient(rgba(255,255,255,.05) 1.4px, transparent 1.4px);
  background-size: auto, auto, 28px 28px;
}
.login-card {
  position: relative; width: 100%; max-width: 380px; background: var(--paper);
  border-radius: var(--radius-lg); padding: 40px 36px; box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.login-brand .dot { width: 36px; height: 36px; border-radius: 11px; background: var(--grad-brand); display:flex; align-items:center; justify-content:center; }
.login-brand .dot svg { width: 18px; height: 18px; color: #fff; }
.login-brand span { font-family: 'Sora',sans-serif; font-weight: 800; font-size: 20px; }
.login-org { text-align:center; color: var(--text-faint); font-size: 13px; margin-bottom: 28px; text-transform: uppercase; letter-spacing: .06em; }
.login-error { background: var(--red-soft); color: var(--red-dark); font-size: 13.5px; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; }

/* ---------- form fields ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; background: var(--paper-alt); color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red); background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill); font-weight: 700; font-size: 14.5px;
  font-family: 'Sora',sans-serif; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 20px rgba(227,18,33,.3); width: 100%; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; }
.sidebar .brand .dot { width: 32px; height: 32px; border-radius: 10px; background: var(--grad-brand); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sidebar .brand .dot svg { width: 16px; height: 16px; color: #fff; }
.sidebar .brand span { font-family:'Sora',sans-serif; font-weight: 800; font-size: 17px; }
.sidebar .org-tag { padding: 0 20px 18px; font-size: 11.5px; color: #a89e9f; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.sidebar nav { flex: 1; padding: 4px 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: #c7c5c9; font-size: 14.5px; font-weight: 600; margin-bottom: 2px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--grad-brand); color: #fff; }
.sidebar .foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar .foot a { color: #c7c5c9; display:flex; align-items:center; gap:8px; }
.sidebar .foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 68px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .user { display:flex; align-items:center; gap:10px; font-size: 13.5px; color: var(--text-muted); }
.content { padding: 32px; max-width: 1200px; }

/* ---------- cards / stats ---------- */
.grid-3 { display:grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-2 { display:grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); }
.stat-tile .label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 10px; }
.stat-tile .value { font-family:'Sora',sans-serif; font-size: 30px; font-weight: 800; }
.stat-tile .value.accent { background: var(--grad-brand); -webkit-background-clip:text; background-clip:text; color:transparent; }

.section-title { display:flex; align-items:center; justify-content:space-between; margin: 32px 0 16px; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { font-size: 17px; }

/* ---------- table ---------- */
.table-wrap { background:#fff; border:1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align:left; font-size: 12px; text-transform: uppercase; letter-spacing:.04em; color: var(--text-faint); padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--paper-alt); }
table.data td { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--paper-alt); }
.badge { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding: 4px 10px; border-radius: var(--radius-pill); }
.badge.on { background: var(--red-soft); color: var(--red-dark); }
.badge.off { background: var(--line-soft); color: var(--text-faint); }
.empty-state { padding: 60px 20px; text-align:center; color: var(--text-faint); }

/* modal-ish inline add form */
.panel { background:#fff; border:1px solid var(--line); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.form-row { display:grid; grid-template-columns: repeat(3,1fr); gap: 14px; align-items:end; }
@media (max-width: 760px) { .form-row { grid-template-columns: 1fr; } }
