/* ═══════════════════════════════════════════════════════════
   Carib Live Reseller Portal — World-Class Design System
   Matches Omni Dealer & Platform Dark Purple/Slate Theme
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --res-primary: #A855F7;
  --res-primary-hover: #9333EA;
  --res-primary-bg: rgba(168, 85, 247, 0.22);
  --res-secondary: #00D2FF;
  --res-accent: #EC4899;
  --res-green: #00E676;
  --res-green-bg: rgba(0, 230, 118, 0.22);
  --res-amber: #FFB300;
  --res-amber-bg: rgba(255, 179, 0, 0.22);
  --res-red: #FF2A55;
  --res-red-bg: rgba(255, 42, 85, 0.22);
  
  --res-bg-dark: #080C15;
  --res-card-bg: rgba(15, 23, 42, 0.82);
  --res-card-border: 1px solid rgba(148, 163, 184, 0.18);
  --res-card-border-glow: 1px solid rgba(139, 92, 246, 0.28);
  --res-input-bg: rgba(2, 6, 23, 0.72);
  --res-input-border: 1px solid rgba(148, 163, 184, 0.22);
  
  --res-gray-50: #F8FAFC;
  --res-gray-100: #F1F5F9;
  --res-gray-200: #E2E8F0;
  --res-gray-300: #CBD5E1;
  --res-gray-400: #94A3B8;
  --res-gray-500: #64748B;
  --res-gray-700: #334155;
  --res-gray-800: #1E293B;
  --res-gray-900: #0F172A;
  
  --res-border: 1px solid rgba(148, 163, 184, 0.18);
  --res-radius: 12px;
  --res-radius-lg: 16px;
  --res-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  --res-shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 24px rgba(139, 92, 246, 0.18);
  
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #F8FAFC;
  background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.12) 0%, rgba(15, 23, 42, 1) 50%, #080c15 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Left-Hand Sidebar ───────────────────────────────────── */
.res-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0B0F19 0%, #060911 100%);
  border-right: 1px solid rgba(99, 102, 241, 0.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.res-sidebar__logo {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.14);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
}

.res-sidebar__logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #06B6D4, #8B5CF6 55%, #EC4899);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
}

.res-sidebar__logo-img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.res-sidebar__logo-text {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.res-sidebar__logo-sub {
  font-size: 11px;
  font-weight: 600;
  color: #A5B4FC;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.res-sidebar__nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.res-sidebar__section {
  font-size: 10px;
  font-weight: 800;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 10px 4px;
  margin-top: 6px;
}

.res-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #94A3B8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.res-nav-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #F8FAFC;
  border-color: rgba(99, 102, 241, 0.22);
}

.res-nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.24), rgba(139, 92, 246, 0.2));
  color: #FFFFFF;
  font-weight: 700;
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.res-nav-item i, .res-nav-item svg {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #818CF8;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.res-nav-item.active i, .res-nav-item:hover i {
  color: #A5B4FC;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.7);
}

.res-sidebar__footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(99, 102, 241, 0.14);
  background: rgba(15, 23, 42, 0.6);
  font-size: 12px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.res-sidebar__footer a {
  color: #F87171;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.res-sidebar__footer a:hover {
  color: #EF4444;
  text-decoration: underline;
}

/* ── Top Header Bar ──────────────────────────────────────── */
.res-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 990;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.res-topbar__search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.res-topbar__search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  font-size: 13px;
  background: rgba(2, 6, 23, 0.6);
  color: #F8FAFC;
  font-family: inherit;
  transition: all 0.2s ease;
}

.res-topbar__search input:focus {
  outline: none;
  border-color: #8B5CF6;
  background: rgba(2, 6, 23, 0.9);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.res-topbar__search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  font-size: 13px;
}

.res-topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.res-topbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.res-topbar__name {
  font-size: 13px;
  font-weight: 600;
  color: #E2E8F0;
}

.res-topbar__role-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── Main Content & Window Fill ──────────────────────────── */
.res-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-w));
}

.res-content {
  padding: 28px 32px 48px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.res-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.res-page-header__title {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.res-page-header__sub {
  font-size: 13.5px;
  color: #94A3B8;
  margin-top: 4px;
}

.res-page-header__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.18s ease;
  line-height: 1.4;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.65);
  color: #CBD5E1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #FFFFFF;
  border-color: rgba(99, 102, 241, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: #B91C1C;
  color: #FFFFFF;
}

.btn-success {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  background: #047857;
  color: #FFFFFF;
}

/* ── Row Action Buttons & Links ──────────────────────────── */
.res-acts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.res-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.7);
  transition: all 0.16s ease;
  line-height: 1.3;
}

.res-act.blue {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}
.res-act.blue:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #FFFFFF;
  border-color: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.res-act.green {
  color: #34D399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}
.res-act.green:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #FFFFFF;
  border-color: #34D399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.res-act.red {
  color: #F87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}
.res-act.red:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #FFFFFF;
  border-color: #F87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.res-act.gray {
  color: #94A3B8;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
}
.res-act.gray:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #F1F5F9;
}

.res-act-sep {
  color: rgba(148, 163, 184, 0.3);
  font-size: 14px;
}

/* ── Telemetry Stat Cards ────────────────────────────────── */
.res-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.res-stat {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.res-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(139, 92, 246, 0.2);
}

.res-stat__label {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.res-stat__value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #FFFFFF;
}

.res-stat__sub {
  font-size: 11.5px;
  color: #64748B;
  margin-top: 6px;
}

.green { color: #34D399 !important; }
.amber { color: #FBBF24 !important; }
.red { color: #F87171 !important; }
.blue { color: #818CF8 !important; }

/* ── Cards & Shells ──────────────────────────────────────── */
.res-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  margin-bottom: 24px;
}

.res-card-body {
  padding: 22px 24px;
}

.res-card-head {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.08), rgba(139, 92, 246, 0.06));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Tables ──────────────────────────────────────────────── */
.res-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.res-table {
  width: 100%;
  border-collapse: collapse;
  color: #E2E8F0;
  background: transparent;
}

.res-table thead th {
  padding: 12px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(51, 65, 85, 0.8);
  background: rgba(15, 23, 42, 0.95);
  white-space: nowrap;
}

.res-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  transition: background 0.12s ease;
}

.res-table tbody tr:last-child {
  border-bottom: none;
}

.res-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.65);
}

.res-table td {
  padding: 13px 18px;
  font-size: 13px;
  color: #CBD5E1;
  vertical-align: middle;
}

.res-table td.bold {
  font-weight: 700;
  color: #FFFFFF;
}

/* Status Badges */
.res-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.res-badge.active, .res-badge.online, .res-badge--green {
  background: rgba(0, 230, 118, 0.22) !important;
  color: #00E676 !important;
  border: 1px solid #00E676 !important;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.35) !important;
}

.res-badge.expired, .res-badge.blocked, .res-badge--red {
  background: rgba(255, 42, 85, 0.22) !important;
  color: #FF2A55 !important;
  border: 1px solid #FF2A55 !important;
  box-shadow: 0 0 12px rgba(255, 42, 85, 0.35) !important;
}

.res-badge.expiring, .res-badge.pending, .res-badge--amber {
  background: rgba(255, 179, 0, 0.22) !important;
  color: #FFB300 !important;
  border: 1px solid #FFB300 !important;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.35) !important;
}

.res-badge.cyan, .res-badge--cyan, .res-badge--primary {
  background: rgba(0, 210, 255, 0.22) !important;
  color: #00D2FF !important;
  border: 1px solid #00D2FF !important;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.35) !important;
}

/* Tab Guidance Card for Reseller Portal */
.res-tab-guidance {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.85)) !important;
  border: 1px solid rgba(168, 85, 247, 0.4) !important;
  border-radius: var(--res-radius-lg) !important;
  padding: 16px 22px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.2) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.res-tab-guidance h3 {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  margin-bottom: 3px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.res-tab-guidance p {
  font-size: 0.84rem !important;
  color: #CBD5E1 !important;
  margin: 0 !important;
}

.res-badge.blocked {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.res-badge.owner {
  background: rgba(139, 92, 246, 0.2);
  color: #C084FC;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.res-badge.admin {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.res-badge.moderator {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.res-badge.viewer {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* ── Forms & Full-Width Inputs ───────────────────────────── */
.res-form-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.res-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.res-form-row.full {
  grid-template-columns: 1fr;
}

.res-form-row.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

.res-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.res-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #CBD5E1;
}

.res-input, .res-select, textarea.res-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  font-size: 13.5px;
  color: #F8FAFC;
  background: rgba(2, 6, 23, 0.72);
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.res-input:focus, .res-select:focus, textarea.res-input:focus {
  outline: none;
  border-color: #8B5CF6;
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.res-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.res-hint {
  font-size: 11.5px;
  color: #64748B;
  line-height: 1.4;
}

.res-section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Alerts ──────────────────────────────────────────────── */
.res-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.res-alert.success {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.res-alert.error {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.res-alert.info {
  background: rgba(99, 102, 241, 0.18);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ── Modals ──────────────────────────────────────────────── */
.res-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.res-modal-bg.open {
  display: flex;
}

.res-modal {
  background: #0B0F19;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  color: #F8FAFC;
}

.res-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
}

.res-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
}

.res-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.res-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.res-modal-body {
  padding: 24px;
}

.res-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(99, 102, 241, 0.18);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
}

/* ── Impersonation Bar ───────────────────────────────────── */
.res-impersonate-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: linear-gradient(90deg, #D97706, #B45309);
  color: #FEF3C7;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.res-impersonate-bar a {
  color: #FFFFFF;
  font-weight: 800;
  text-decoration: underline;
}

/* ── Mobile Off-Canvas Sidebar ───────────────────────────── */
@media (max-width: 991.98px) {
  .res-sidebar {
    transform: translateX(-100%);
  }
  .res-sidebar.open {
    transform: translateX(0);
  }
  .res-main {
    margin-left: 0;
    width: 100%;
  }
  .res-topbar {
    left: 0;
  }
  .res-form-row, .res-form-row.thirds {
    grid-template-columns: 1fr;
  }
}
