/* ==========================================================================
   PREMIUM DESIGN SYSTEM — SMS Delivery Console
   Loaded after w3.css, so it overrides the legacy look.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8b94a7;
  --border: #e3e7f0;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef0ff;
  --ring: rgba(79, 70, 229, 0.28);
  --success: #12b76a;
  --success-soft: #e7f8f0;
  --warning: #f79009;
  --warning-soft: #fff4e0;
  --danger: #f04438;
  --danger-soft: #feeceb;
  --info: #2e90fa;
  --info-soft: #e8f3fe;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22);
}

/* App-specific accents */
body.app-smsfree   { --brand: #4f46e5; --brand-2: #7c3aed; --brand-soft: #eef0ff; --ring: rgba(79, 70, 229, 0.28); }
body.app-amharic   { --brand: #1d6fe0; --brand-2: #0891b2; --brand-soft: #e8f1fe; --ring: rgba(29, 111, 224, 0.28); }

/* ---------- Base ---------- */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: "Plus Jakarta Sans", "Inter", -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }

/* ---------- Top bar ---------- */
.premium-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 66px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.premium-topbar-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.premium-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.premium-burger:hover { background: var(--surface-2); color: var(--brand); border-color: var(--brand); }

.premium-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: 8px;
  flex-shrink: 0;
}
.premium-brand-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 14px -4px var(--ring);
}
.premium-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.premium-brand-name { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.premium-brand-sub { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.premium-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.premium-nav a {
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.premium-nav a:hover { background: var(--surface-2); color: var(--text); }
.premium-nav a.active { background: var(--brand-soft); color: var(--brand); }

.premium-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.premium-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px -3px var(--ring);
}
.premium-user-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.premium-logout {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s ease;
}
.premium-logout:hover { border-color: #fecaca; color: var(--danger); background: var(--danger-soft); }

/* ---------- Sidebar drawer ---------- */
.premium-sidebar {
  width: 286px !important;
  background: var(--surface) !important;
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-md) !important;
  z-index: 100 !important;
  display: none;
  padding: 16px 14px;
}
.premium-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.premium-sidebar-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-family: "Plus Jakarta Sans", sans-serif; font-size: 15px; }
.premium-sidebar-title .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.premium-sidebar-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.premium-sidebar-close:hover { color: var(--danger); border-color: #fecaca; background: var(--danger-soft); }
.premium-sidebar-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.premium-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin: 2px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s ease;
}
.premium-sidebar nav a svg { flex-shrink: 0; opacity: 0.85; }
.premium-sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.premium-sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
.premium-sidebar nav a.external::after {
  content: "\2197";
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.premium-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 90;
  display: none;
  backdrop-filter: blur(2px);
}

/* ---------- Layout ---------- */
.premium-layout { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; }

/* ---------- KPI summary strip ---------- */
.premium-summary { margin-bottom: 26px; }
.premium-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.premium-summary-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.premium-summary-head span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.premium-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d7dcec; }
.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex-shrink: 0; }
.kpi-value {
  display: block;
  margin-top: 6px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.kpi-card.success .kpi-label i { background: var(--success); }
.kpi-card.success .kpi-value { color: var(--success); }
.kpi-card.warning .kpi-label i { background: var(--warning); }
.kpi-card.warning .kpi-value { color: var(--warning); }
.kpi-card.danger .kpi-label i { background: var(--danger); }
.kpi-card.danger .kpi-value { color: var(--danger); }
.kpi-card.brand .kpi-label i { background: var(--brand); }
.kpi-card.brand .kpi-value { color: var(--brand); }

.premium-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.premium-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.premium-actions a.warn { background: var(--warning-soft); color: #b45309; border-color: #fde6b8; }
.premium-actions a.warn:hover { background: #ffe8c2; }
.premium-actions a.good { background: var(--success-soft); color: #067647; border-color: #bfe9d4; }
.premium-actions a.good:hover { background: #d3f2e3; }
.premium-actions a.bad { background: var(--danger-soft); color: #b42318; border-color: #f8c4c0; }
.premium-actions a.bad:hover { background: #fbd5d2; }

/* ---------- Main content ---------- */
.main_content.wrap.inner-doc {
  width: auto;
  float: none;
  position: static;
  left: auto;
  background: transparent;
  min-height: 380px;
}
.sub_content_div {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  float: none;
  font-family: inherit;
  overflow: visible;
  position: static;
  text-align: left;
}

/* ---------- Page headers ---------- */
.page-header { margin-bottom: 20px; }
.page-title {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title::before {
  content: "";
  width: 5px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.page-subtitle { margin: 6px 0 0 15px; font-size: 13.5px; color: var(--text-2); }

/* ---------- Cards ---------- */
.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.page-card h3.card-title { margin: 0 0 16px; font-size: 15px; font-weight: 700; color: var(--text); }

/* ---------- Forms ---------- */
.text_css, .text_area_css, .select_input, .text_cssx,
.w3-input, .w3-select, input[type="text"], input[type="password"], input[type="file"], select, textarea {
  font-family: "Inter", sans-serif !important;
  font-size: 14px !important;
  color: var(--text);
  background: var(--surface) !important;
  border: 1px solid #d0d6e4 !important;
  border-radius: 10px !important;
  padding: 10px 13px !important;
  height: auto !important;
  width: 100%;
  max-width: 420px;
  box-shadow: none !important;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { width: 100%; max-width: 520px; }
.text_css:focus, .text_area_css:focus, .select_input:focus,
.text_cssx:focus, .w3-input:focus, .w3-select:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px var(--ring) !important;
}
.premium-field { margin-bottom: 18px; }
.premium-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.form_error { color: var(--danger) !important; font-style: normal !important; font-size: 12px; font-weight: 600; }
select {
  appearance: auto;
  background-image: none;
  cursor: pointer;
}
.w3-border { border: 1px solid #d0d6e4 !important; }

/* ---------- Buttons ---------- */
.btn_css {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Inter", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 16px -6px var(--ring), var(--shadow-xs);
  cursor: pointer;
  text-shadow: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn_css:hover { filter: brightness(1.06); box-shadow: 0 10px 22px -8px var(--ring); transform: translateY(-1px); }
.btn_css:active { transform: translateY(0); filter: brightness(0.97); }
.btn_css.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
  box-shadow: none;
}
.btn_css.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn_css.btn-success { background: linear-gradient(135deg, #16a34a, #12b76a); box-shadow: 0 6px 16px -6px rgba(18, 183, 106, 0.5); }
.btn_css.btn-warning { background: linear-gradient(135deg, #f59e0b, #f79009); color: #fff; box-shadow: 0 6px 16px -6px rgba(247, 144, 9, 0.5); }
.btn_css.btn-danger { background: linear-gradient(135deg, #ef4444, #f04438); box-shadow: 0 6px 16px -6px rgba(240, 68, 56, 0.5); }
.w3-button { border-radius: 10px !important; font-weight: 700 !important; }

/* ---------- Tables ---------- */
.dataTables_wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 14px;
  overflow-x: auto;
}
.dataTables_wrapper .dataTables_filter { float: right; margin: 2px 0 14px; }
.dataTables_wrapper .dataTables_filter label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.dataTables_wrapper .dataTables_filter input {
  margin-left: 8px;
  width: 220px;
  border: 1px solid #d0d6e4;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.dataTables_wrapper .dataTables_length { float: left; margin: 2px 0 14px; }
.dataTables_wrapper .dataTables_length label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.dataTables_wrapper .dataTables_length select {
  width: auto;
  display: inline-block;
  margin: 0 6px;
  padding: 6px 10px !important;
  border-radius: 8px !important;
}
.dataTables_wrapper table {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}
.dataTables_wrapper table thead th {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.dataTables_wrapper table thead th.sorting,
.dataTables_wrapper table thead th.sorting_asc,
.dataTables_wrapper table thead th.sorting_desc {
  background-image: none;
  padding-right: 24px;
}
.dataTables_wrapper table thead th.sorting::after,
.dataTables_wrapper table thead th.sorting_asc::after,
.dataTables_wrapper table thead th.sorting_desc::after {
  content: "";
  float: right;
  margin-top: 3px;
  width: 8px;
  height: 12px;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.55;
}
.dataTables_wrapper table thead th.sorting::after { background-image: url('../Images/sort_both.png'); background-size: 8px 12px; }
.dataTables_wrapper table thead th.sorting_asc::after { background-image: url('../Images/sort_asc.png'); background-size: 8px 12px; }
.dataTables_wrapper table thead th.sorting_desc::after { background-image: url('../Images/sort_desc.png'); background-size: 8px 12px; }
.dataTables_wrapper table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f6;
  font-size: 13.5px;
  color: var(--text);
}
.dataTables_wrapper table tbody tr:last-child td { border-bottom: none; }
.dataTables_wrapper table tbody tr.odd { background: var(--surface); }
.dataTables_wrapper table tbody tr.even { background: #fafbfe; }
.dataTables_wrapper table tbody tr:hover { background: var(--brand-soft); }
.dataTables_wrapper .dataTables_empty { padding: 18px 14px !important; color: var(--muted); font-style: normal; text-align: center; }
.dataTables_wrapper .dataTables_info {
  float: left;
  padding-top: 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.dataTables_wrapper .dataTables_paginate { float: right; padding-top: 12px; }
.dataTables_wrapper .paginate_button {
  display: inline-block;
  margin: 0 2px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2) !important;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dataTables_wrapper .paginate_button:hover { border-color: var(--brand); color: var(--brand) !important; }
.dataTables_wrapper .paginate_button.current {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff !important;
  box-shadow: 0 4px 12px -4px var(--ring);
}
.dataTables_wrapper .paginate_button.disabled { opacity: 0.45; cursor: default; }
.dataTables_wrapper .paginate_button.disabled:hover { border-color: var(--border); color: var(--text-2) !important; }

/* Plain (non-dataTables) tables */
table.premium-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.premium-table thead th {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.premium-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #eef0f6;
  font-size: 13.5px;
}
table.premium-table tbody tr:last-child td { border-bottom: none; }
table.premium-table tbody tr:nth-child(even) { background: #fafbfe; }
table.premium-table tbody tr:hover { background: var(--brand-soft); }

/* w3-table fallback */
table.w3-table { border-collapse: separate; border-spacing: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-info { background: var(--info-soft); color: #175cd3; }
.badge-success { background: var(--success-soft); color: #067647; }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-danger { background: var(--danger-soft); color: #b42318; }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

/* ---------- Cards & sections (extra) ---------- */
.card-section-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.01em;
  margin: 4px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.card-divider { height: 1px; background: var(--border); margin: 22px 0; }

.format-note {
  background: var(--surface-2);
  border: 1px dashed #cdd5e6;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  max-width: 480px;
}
.format-note strong { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.format-note code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--brand);
  width: fit-content;
}
.format-note span { font-size: 12px; }

.alert {
  padding: 13px 18px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-info {
  background: var(--info-soft);
  color: #175cd3;
  border: 1px solid #c8e2fb;
}
.alert-info::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--info);
  flex-shrink: 0;
}

/* ---------- Legacy content fixes ---------- */
#register_div {
  margin: 0 !important;
  width: auto !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  text-align: left;
}
#send_bulk_form .form-row .premium-field { margin-bottom: 18px; }
#send_bulk_form .form-row .premium-field:first-child { margin-right: 0; }
#send_bulk_form .premium-field .text_css,
#send_bulk_form .premium-field .select_input { max-width: 560px; }
#send_bulk_form .text_area_css { width: 100%; max-width: 720px; min-height: 140px; resize: vertical; }
.register_table { width: 100%; max-width: 640px; }

/* Send Bulk SMS: inline row + message counter */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: end;
}
@media (max-width: 400px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
}
.msg-counter-wrap { max-width: 720px; }
.msg-progress {
  height: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.msg-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 99px;
  transition: width 0.15s ease;
}
.msg-progress span.over { background: var(--warning); }
.msg-counter {
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.msg-counter.over { color: var(--warning); }
.register_table td {
  font-family: inherit !important;
  font-size: 13.5px !important;
  color: var(--text-2);
  padding: 7px 10px;
  vertical-align: middle;
}
.larg_txt {
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  display: block;
  margin: 4px 0 12px !important;
}
.small_txt { font-family: inherit !important; font-size: 13px !important; font-weight: 600 !important; color: var(--text-2); }

/* Inline status messages */
center i { font-style: normal; font-weight: 600; font-size: 13.5px; }
center { margin: 8px 0; }

/* ---------- Login page ---------- */
.premium-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  background:
    radial-gradient(700px 420px at 12% 8%, rgba(124, 58, 237, 0.16), transparent 60%),
    radial-gradient(640px 400px at 88% 92%, rgba(79, 70, 229, 0.14), transparent 60%),
    linear-gradient(160deg, #f6f7fd 0%, #eef1f8 100%);
}
.premium-login-card {
  width: 100%;
  max-width: 424px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(227, 231, 240, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 40px 38px 34px;
  animation: loginIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.premium-login-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 12px 26px -8px var(--ring);
  margin-bottom: 22px;
}
.premium-login-card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.premium-login-card .login-sub { margin: 0 0 26px; font-size: 14px; color: var(--text-2); }
.premium-login-card .login-sub strong { color: var(--brand); }
.premium-login-actions { display: flex; gap: 10px; margin-top: 26px; }
.premium-login-actions .btn_css { flex: 1; padding: 12px 20px; font-size: 14.5px; }
.premium-login-foot { margin-top: 24px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Dashboard page ---------- */
.dash-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin-bottom: 22px;
  box-shadow: 0 18px 40px -16px var(--ring);
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}
.dash-hero::before {
  content: "";
  position: absolute;
  right: 46px;
  bottom: -90px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.dash-hero-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.dash-hero > div:last-child { position: relative; z-index: 1; }
.dash-hero h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.dash-hero h2 span { opacity: 0.88; }
.dash-hero p { margin: 5px 0 0; font-size: 13.5px; opacity: 0.86; }

/* ---------- Upload Mobile Numbers page ---------- */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 920px) {
  .upload-grid { grid-template-columns: 1fr; }
}
.upload-card { margin-bottom: 0; }
.upload-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.upload-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.upload-card-head .card-title { margin: 2px 0 4px; }
.upload-card-head p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.upload-card .format-note { margin-top: 2px; padding: 11px 14px; }

/* Premium file input */
input[type="file"].text_css {
  padding: 7px 9px;
  background: var(--surface-2);
  cursor: pointer;
  max-width: 420px;
}
input[type="file"]::file-selector-button {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 12px;
  transition: background 0.15s ease;
}
input[type="file"]::file-selector-button:hover { background: #dde2ff; }

/* ---------- Fitted stats & action grids ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.stats-grid.two { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.btn-grid .btn_css, .btn-grid a.btn_css { width: 100%; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.form-error-area { margin-top: 14px; }

/* ---------- Footer ---------- */
.premium-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.premium-footer strong { color: var(--text-2); font-weight: 600; }

/* ---------- home.php legacy dashboard ---------- */
table.nav_list { border-collapse: separate; border-spacing: 14px; width: 100% !important; }
table.nav_list td {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px !important;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
table.nav_list td:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
table.nav_list img { border-radius: 10px; opacity: 0.9; }
table.nav_list a { display: block; margin-top: 10px; font-weight: 700; font-size: 14px; color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .premium-nav { display: none; }
}
@media (max-width: 720px) {
  .premium-topbar-inner { padding: 0 12px; gap: 10px; }
  .premium-brand-sub { display: none; }
  .premium-user-name { display: none; }
  .premium-layout { padding: 18px 14px 32px; }
  .page-card, #register_div { padding: 20px 16px; }
  .premium-kpis { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
