/* ═══════════════════════════════════════════════════════════════════
   Tamil Nadu Admin Panel — Senior Editorial Control Desk (V6.0)
   Colors: Magenta #FC0F6E  •  Navy #1E2E4A  •  Paper #FFF5F7 / #FFFFFF
═══════════════════════════════════════════════════════════════════ */

:root {
  --magenta:      #FC0F6E;
  --magenta-dark: #E11D48;
  --magenta-light:rgba(252, 15, 110, 0.08);
  --navy:         #1E2E4A;
  --navy-light:   #263a5e;
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(92, 86, 82, 0.04);
  --shadow-md:    0 4px 16px rgba(92, 86, 82, 0.05), 0 1px 3px rgba(92, 86, 82, 0.02);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #FFF5F7;
  color: #1E2E4A;
  margin: 0;
}

h1, h2, h3, h4, .topbar-title, .card-title {
  font-family: 'Outfit', -apple-system, sans-serif;
  letter-spacing: -0.015em;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--magenta);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-name  { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub   { font-size: 11px; color: rgba(255,255,255,.45); }

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  color: rgba(255,255,255,.35);
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--magenta); color: #fff; box-shadow: var(--shadow); }
.nav-item i      { width: 18px; text-align: center; }
.nav-item-danger { color: rgba(255,100,100,.8) !important; margin-top: 8px; }
.nav-item-danger:hover { background: rgba(255,50,50,.12) !important; color: #ff6464 !important; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.avatar-sm {
  width: 32px; height: 32px;
  background: var(--magenta);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
}

/* ── Main wrapper ─────────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid rgba(30, 46, 74, 0.08);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-title  { font-size: 16px; font-weight: 700; flex: 1; color: var(--navy); }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { background: none; border: none; font-size: 18px; color: var(--navy); cursor: pointer; }

.badge-live {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F0FDF4; color: #2C6E49;
  border: 1px solid rgba(44, 110, 73, 0.2);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}

.badge-live .fa-circle { font-size: 7px; color: #2C6E49; }

/* ── Page content ─────────────────────────────────────────────────── */
.page-content { flex: 1; padding: 32px; }

/* ── Stat Cards ───────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  border-left: 4px solid var(--magenta);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.navy  { border-left-color: var(--navy); }
.stat-card.green { border-left-color: #10b981; }
.stat-card.amber { border-left-color: #f59e0b; }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.magenta { background: var(--magenta-light); color: var(--magenta); }
.stat-icon.navy    { background: #eef2ff; color: var(--navy); }
.stat-icon.green   { background: #ecfdf5; color: #10b981; }
.stat-icon.amber   { background: #fffbeb; color: #f59e0b; }

.stat-label { font-size: 12px; color: #888; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-sub   { font-size: 12px; color: #999; margin-top: 2px; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: none;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--navy); margin: 0; }
.card-body  { padding: 24px; }
.card-footer { background: transparent; border-top: 1px solid #f0f0f0; padding: 12px 20px; }

/* ── Tables ───────────────────────────────────────────────────────── */
.table-clean { border-collapse: separate; border-spacing: 0; width: 100%; }
.table-clean thead th {
  background: #f8f9fc;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: #888;
  padding: 12px 16px; border-bottom: 1px solid #eee;
}
.table-clean tbody td {
  padding: 14px 16px; border-bottom: 1px solid #f5f5f5;
  font-size: 13.5px; vertical-align: middle;
}
.table-clean tbody tr:hover td { background: #fafafa; }
.table-clean tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge-promoted { background: #fff3cd; color: #856404; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.badge-active   { background: #d1fae5; color: #065f46; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.badge-inactive { background: #fee2e2; color: #991b1b; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.badge-category { background: #fce7f3; color: #9d174d; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.badge-warning  { background: #fff7ed; color: #c2410c; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-magenta      { background: var(--magenta); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .2s, transform .1s; }
.btn-magenta:hover { background: var(--magenta-dark); color: #fff; }
.btn-navy         { background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .2s; }
.btn-navy:hover   { background: var(--navy-light); color: #fff; }
.btn-outline-sm   { background: none; border: 1px solid #ddd; border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; color: #555; transition: all .2s; }
.btn-outline-sm:hover { border-color: var(--magenta); color: var(--magenta); }
.btn-danger-sm    { background: #fee2e2; color: #dc2626; border: none; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; transition: background .2s; }
.btn-danger-sm:hover { background: #fecaca; }

/* ── Toggle switch ───────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle {
  position: relative;
  width: 44px; height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ddd; border-radius: 34px;
  transition: .3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: .3s;
}
.toggle input:checked + .toggle-slider { background: var(--magenta); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #e5e7eb; border-radius: 8px;
  font-size: 13.5px; font-family: 'Inter', sans-serif;
  color: #1a1a2e; background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(252,15,110,.1); }
.form-label { font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: block; }
.form-group { margin-bottom: 18px; }

/* ── Login page ───────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #0f1a2e 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
}

.login-logo {
  width: 56px; height: 56px;
  background: var(--magenta);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  margin: 0 auto 20px;
}

/* ── Alert boxes ──────────────────────────────────────────────────── */
.alert-custom {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 3px solid #dc2626; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 3px solid #10b981; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
.alert-warning { background: #fff7ed; color: #c2410c; border-left: 3px solid #f97316; }

/* ── Chat bubbles ─────────────────────────────────────────────────── */
.msg-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; align-items: flex-start; }
.msg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--magenta-light); color: var(--magenta); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.msg-sender { font-size: 12px; font-weight: 600; color: var(--navy); }
.msg-time   { font-size: 11px; color: #999; margin-left: 8px; }
.msg-text   { font-size: 13.5px; color: #333; margin-top: 3px; }

/* ── Comprehensive 100% Mobile Friendly Responsive System ────────── */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 999;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }
  .topbar {
    padding: 12px 16px;
  }
  .page-content {
    padding: 16px 14px;
  }
}

@media (max-width: 768px) {
  .topbar-title {
    font-size: 16px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stat-card {
    padding: 14px;
    gap: 12px;
  }
  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  .stat-value {
    font-size: 22px;
  }
  .card-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-body {
    padding: 16px;
  }
  .card-title {
    font-size: 14px;
  }
  .table-clean th, .table-clean td {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .btn-magenta, .btn-navy {
    padding: 6px 12px;
    font-size: 12px;
  }
  .alert-custom {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ── Separator ────────────────────────────────────────────────────── */
.section-title {
  font-size: 13px; font-weight: 600; color: #888;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: #eee; }
