/* ═══════════════════════════════════════════════════════════════
   AI Creator OS — Design System
   Modern SaaS / Mobile-app aesthetic
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #818cf8;
  --secondary:      #8b5cf6;
  --accent:         #06b6d4;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;

  --bg-page:        #f1f5f9;
  --bg-card:        #ffffff;
  --bg-sidebar:     #0f172a;
  --bg-topbar:      rgba(255,255,255,0.85);

  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;
  --text-sidebar:   #94a3b8;
  --text-sidebar-active: #ffffff;

  --border:         #e2e8f0;
  --border-radius:  14px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.12);

  --sidebar-width:  240px;
  --topbar-height:  60px;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent:  linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-warm:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-page:    linear-gradient(160deg, #f1f5f9 0%, #e8edf5 100%);

  /* TikTok / Reels accent */
  --tiktok-red:        #fe2c55;
  --tiktok-red-dark:   #e0143d;
  --gradient-tiktok:   linear-gradient(135deg, #fe2c55 0%, #ff6f3c 100%);
  --gradient-creator:  linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
}

/* ── Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--gradient-page);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════ */
.app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  z-index: 1000;
  gap: 1rem;
}

.app-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.app-topbar .brand-icon {
  width: 32px; height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
}

.app-topbar .brand-name {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.topbar-search {
  flex: 1;
  max-width: 380px;
}

.topbar-search .form-control {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem 1rem .45rem 2.5rem;
  font-size: .85rem;
  transition: all .2s;
}

.topbar-search .form-control:focus {
  background: #fff;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.topbar-search .search-icon {
  position: absolute;
  left: .8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .8rem;
  pointer-events: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  position: relative;
}

.topbar-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.topbar-btn .notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 16px; height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: .6rem;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  font-weight: 700;
}

/* User avatar button */
.topbar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .3rem .7rem .3rem .4rem;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: var(--text-primary);
}

.topbar-user:hover { background: #fff; box-shadow: var(--shadow-sm); color: var(--text-primary); }

.topbar-user .user-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
}

.topbar-user .user-name {
  font-size: .82rem;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar toggler (mobile) */
.sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: .5rem;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.app-sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--bg-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 1rem 0 5rem;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.app-sidebar::-webkit-scrollbar { width: 3px; }
.app-sidebar::-webkit-scrollbar-thumb { background: #1e293b; }

/* Section heading */
.sidebar-section {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #475569;
  padding: 1.25rem 1.25rem .4rem;
  margin: 0;
}

/* Nav items */
.sidebar-nav { list-style: none; padding: 0; margin: 0; }

.sidebar-nav .nav-item { margin: 1px .6rem; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .85rem;
  border-radius: 10px;
  color: var(--text-sidebar);
  font-size: .84rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}

.sidebar-nav .nav-link .nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
  background: rgba(255,255,255,.04);
  transition: all .2s;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.sidebar-nav .nav-link:hover .nav-icon {
  background: rgba(99,102,241,.2);
  color: var(--primary-light);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(99,102,241,.15);
}

.sidebar-nav .nav-link.active .nav-icon {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: .6rem 1rem;
}

/* Sidebar workspace chip */
.sidebar-workspace {
  margin: .4rem .6rem;
  padding: .55rem .85rem;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  transition: background .2s;
}

.sidebar-workspace:hover { background: rgba(255,255,255,.08); }

.sidebar-workspace .ws-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-workspace .ws-name {
  font-size: .8rem;
  font-weight: 600;
  color: #e2e8f0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-workspace .ws-arrow {
  color: #475569;
  font-size: .7rem;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.app-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  padding: 1.75rem 1.75rem 5rem;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header-left {}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin: 0 0 .2rem;
}

.page-subtitle {
  font-size: .82rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(226,232,240,.6) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--border-radius) var(--border-radius) !important;
}

/* Stat cards */
.stat-card {
  border-radius: var(--border-radius) !important;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  border: none !important;
}

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: .85rem;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 .2rem;
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: .78rem;
  font-weight: 500;
  opacity: .7;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stat-card .stat-trend {
  font-size: .75rem;
  font-weight: 600;
  margin-top: .5rem;
}

/* Gradient stat cards */
.stat-card-primary  { background: var(--gradient-primary); color: #fff; }
.stat-card-accent   { background: var(--gradient-accent);  color: #fff; }
.stat-card-success  { background: var(--gradient-success); color: #fff; }
.stat-card-warm     { background: var(--gradient-warm);    color: #fff; }
.stat-card-plain    { background: var(--bg-card); }

.stat-card-primary .stat-icon  { background: rgba(255,255,255,.2); color: #fff; }
.stat-card-accent  .stat-icon  { background: rgba(255,255,255,.2); color: #fff; }
.stat-card-success .stat-icon  { background: rgba(255,255,255,.2); color: #fff; }
.stat-card-warm    .stat-icon  { background: rgba(255,255,255,.2); color: #fff; }

/* Decorative blob on stat cards */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: .55rem .9rem;
  font-size: .875rem;
  color: var(--text-primary);
  background: #fff;
  transition: all .2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: #fff;
}

.form-label { font-weight: 600; font-size: .84rem; color: var(--text-primary); margin-bottom: .4rem; }

.input-group .form-control:focus { z-index: 1; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: .84rem;
  padding: .5rem 1.1rem;
  transition: all .2s;
  letter-spacing: .01em;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-secondary { background: #f1f5f9; border-color: var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: #e2e8f0; color: var(--text-primary); }

.btn-sm { padding: .35rem .8rem; font-size: .78rem; border-radius: 7px; }
.btn-xs { padding: .2rem .55rem; font-size: .72rem; border-radius: 6px; }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  padding: .3em .65em;
  letter-spacing: .02em;
}

.badge-pill { border-radius: 50px; }

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table { font-size: .855rem; }
.table thead th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  background: #f8fafc;
}

.table tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(226,232,240,.5);
  vertical-align: middle;
  color: var(--text-primary);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbff; }

/* DataTables */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .85rem;
  font-size: .83rem;
  background: #fff;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
  outline: none;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .35rem .65rem;
  font-size: .83rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 7px !important;
  font-size: .8rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f1f5f9 !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */
.alert {
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: .855rem;
  border-left: 4px solid transparent;
}

.alert-success { background: #f0fdf4; color: #166534; border-left-color: var(--success); }
.alert-danger   { background: #fef2f2; color: #991b1b; border-left-color: var(--danger);  }
.alert-warning  { background: #fffbeb; color: #92400e; border-left-color: var(--warning); }
.alert-info     { background: #eff6ff; color: #1e40af; border-left-color: var(--info);    }

/* ═══════════════════════════════════════════════════════════════
   DROPDOWNS
   ═══════════════════════════════════════════════════════════════ */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .855rem;
  padding: .4rem;
}

.dropdown-item {
  border-radius: 7px;
  padding: .5rem .8rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: background .15s;
}

.dropdown-item:hover { background: #f1f5f9; color: var(--primary); }
.dropdown-item.text-danger:hover { background: #fef2f2; }

.dropdown-divider { border-color: var(--border); margin: .3rem 0; }
.dropdown-header { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding: .4rem .8rem .2rem; }

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
#notif-dropdown {
  border-radius: var(--border-radius) !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

#notif-dropdown .notif-header {
  padding: .85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════════
   LIST GROUPS
   ═══════════════════════════════════════════════════════════════ */
.list-group-item {
  border-color: rgba(226,232,240,.5);
  font-size: .875rem;
}

.list-group-flush .list-group-item:first-child { border-top: none; }
.list-group-flush .list-group-item:last-child  { border-bottom: none; }

.list-group-item-action:hover {
  background: #fafbff;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-content {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════ */
body.auth-page {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.auth-card {
  background: rgba(255,255,255,.97);
  border-radius: var(--border-radius-lg) !important;
  border: none !important;
  box-shadow: 0 25px 60px rgba(0,0,0,.35) !important;
  backdrop-filter: blur(20px);
}

.auth-brand-icon {
  width: 56px; height: 56px;
  background: var(--gradient-primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  margin: 0 auto .75rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
}

.auth-page .form-control {
  background: #f8fafc;
  border-color: #e8edf5;
  padding: .65rem 1rem;
}

.auth-page .form-control:focus {
  background: #fff;
  border-color: var(--primary-light);
}

.auth-page .btn-primary { padding: .7rem 1rem; font-size: .9rem; }

/* Auth decorative orbs */
.auth-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .25;
  pointer-events: none;
}

.auth-orb-1 {
  width: 400px; height: 400px;
  background: #6366f1;
  top: -100px; left: -100px;
}

.auth-orb-2 {
  width: 300px; height: 300px;
  background: #8b5cf6;
  bottom: -80px; right: -80px;
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM NAV (mobile only)
   ═══════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 1050;
  padding: 0 .5rem;
  gap: .25rem;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 52px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .6rem;
  font-weight: 600;
  gap: 3px;
  transition: all .2s;
  letter-spacing: .02em;
}

.bottom-nav-item i { font-size: 1.1rem; }

.bottom-nav-item.active {
  color: var(--primary);
  background: rgba(99,102,241,.08);
}

.bottom-nav-item:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   IMPERSONATION BANNER
   ═══════════════════════════════════════════════════════════════ */
.impersonate-bar {
  position: fixed;
  top: var(--topbar-height);
  left: 0; right: 0;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  text-align: center;
  padding: .45rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  z-index: 998;
}

.impersonate-bar ~ .app-sidebar { top: calc(var(--topbar-height) + 34px); }
.impersonate-bar ~ * .app-main  { margin-top: calc(var(--topbar-height) + 34px); }

/* ═══════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════ */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-icon {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-lift { transition: transform .2s, box-shadow .2s; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow) !important; }

.rounded-xl  { border-radius: var(--border-radius) !important; }
.rounded-2xl { border-radius: var(--border-radius-lg) !important; }
.rounded-sm  { border-radius: var(--border-radius-sm) !important; }

.bg-gradient-primary { background: var(--gradient-primary) !important; color: #fff !important; }
.bg-gradient-accent  { background: var(--gradient-accent)  !important; color: #fff !important; }
.bg-gradient-success { background: var(--gradient-success) !important; color: #fff !important; }
.bg-gradient-warm    { background: var(--gradient-warm)    !important; color: #fff !important; }

.shadow-primary { box-shadow: 0 8px 24px rgba(99,102,241,.3) !important; }

.text-primary   { color: var(--primary)  !important; }
.border-primary { border-color: var(--primary) !important; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  width: 72px; height: 72px;
  background: #f1f5f9;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.25rem;
  color: #cbd5e1;
}
.empty-state h6 { color: var(--text-secondary); font-weight: 700; margin: 0 0 .4rem; }
.empty-state p  { font-size: .84rem; margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.show {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    padding: 1rem 1rem 5rem;
  }

  .sidebar-toggle { display: flex; }

  .topbar-search { display: none; }

  .app-topbar .brand { width: auto; }

  .bottom-nav { display: flex; }

  /* Overlay behind open sidebar */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 998;
    backdrop-filter: blur(2px);
    display: none;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
  .app-main { padding: .85rem .85rem 5rem; }
  .page-title { font-size: 1.15rem; }
  .stat-card .stat-value { font-size: 1.35rem; }
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT-SPECIFIC TWEAKS
   ═══════════════════════════════════════════════════════════════ */

/* Chat bubbles (support) */
.chat-bubble-user { background: rgba(99,102,241,.1); border-radius: 14px 14px 4px 14px; }
.chat-bubble-staff { background: #f1f5f9; border-radius: 14px 14px 14px 4px; }

/* Form switch */
.form-switch .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* Nav tabs */
.nav-tabs { border-color: var(--border); gap: .25rem; }
.nav-tabs .nav-link { border-radius: 8px 8px 0 0; font-weight: 500; font-size: .84rem; color: var(--text-secondary); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--primary); border-color: var(--border) var(--border) #fff; font-weight: 600; }
.nav-tabs .nav-link:hover:not(.active) { background: #f8fafc; color: var(--text-primary); border-color: transparent; }

/* Pills */
.nav-pills .nav-link { border-radius: 8px; font-weight: 500; font-size: .84rem; color: var(--text-secondary); }
.nav-pills .nav-link.active { background: var(--primary); color: #fff; }

/* Progress bars */
.progress { border-radius: 50px; background: #e2e8f0; height: 6px; }
.progress-bar { background: var(--gradient-primary); border-radius: 50px; }

/* Pagination */
.page-item .page-link { border-radius: 7px !important; border-color: var(--border); color: var(--text-secondary); margin: 0 1px; font-size: .82rem; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-item .page-link:hover { background: #f1f5f9; color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   TIKTOK / REELS DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */

/* TikTok red button */
.btn-tiktok {
  background: var(--gradient-tiktok);
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(254,44,85,.35);
  transition: all .2s;
}
.btn-tiktok:hover {
  background: var(--tiktok-red-dark);
  box-shadow: 0 6px 20px rgba(254,44,85,.45);
  transform: translateY(-1px);
  color: #fff;
}
.btn-tiktok:active { transform: translateY(0); }

/* stat-card-tiktok */
.stat-card-tiktok { background: var(--gradient-tiktok); color: #fff; }
.stat-card-tiktok .stat-icon { background: rgba(255,255,255,.2); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   CREATOR HERO (dashboard)
   ═══════════════════════════════════════════════════════════════ */
.creator-hero {
  background: var(--gradient-creator);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  padding: 1.75rem 1.75rem 0;
  color: #fff;
  position: relative;
}

.creator-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: rgba(254,44,85,.15);
  border-radius: 50%;
  pointer-events: none;
}

.creator-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.creator-avatar-lg {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--gradient-tiktok);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  border: 3px solid rgba(255,255,255,.25);
  overflow: hidden;
  flex-shrink: 0;
}
.creator-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.creator-hero-name {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 .15rem;
  letter-spacing: -0.3px;
  color: #fff;
}

.creator-hero-handle {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  font-weight: 500;
}

/* Stat strip at bottom of hero card */
.creator-stat-strip {
  display: flex;
  gap: 0;
  margin: 1.25rem -1.75rem 0;
  border-top: 1px solid rgba(255,255,255,.08);
  position: relative;
  z-index: 1;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.creator-stat-strip::-webkit-scrollbar { display: none; }

.creator-stat-pill {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .9rem .5rem;
  border-right: 1px solid rgba(255,255,255,.07);
  text-align: center;
}
.creator-stat-pill:last-child { border-right: none; }

.cs-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.3px;
}
.cs-lbl {
  font-size: .65rem;
  color: rgba(255,255,255,.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .2rem;
}

/* ═══════════════════════════════════════════════════════════════
   SHORTS / REELS THUMBNAIL GRID (dashboard)
   ═══════════════════════════════════════════════════════════════ */
.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .75rem;
}

.short-card {
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.short-thumb {
  aspect-ratio: 9/16;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.short-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.short-card:hover .short-thumb img { transform: scale(1.05); }

.short-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  color: #334155;
  font-size: 1.4rem;
}

.short-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  color: #fff;
  font-size: 1.2rem;
}

.short-card:hover .short-overlay { opacity: 1; }

.short-status-badge {
  position: absolute;
  top: 6px; left: 6px;
  font-size: .6rem;
  padding: .2em .5em;
  border-radius: 4px;
}

.short-views-badge {
  position: absolute;
  bottom: 5px; left: 5px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: .15em .45em;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.short-title {
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

/* Upload add card */
.short-add-card { opacity: .7; transition: opacity .2s; }
.short-add-card:hover { opacity: 1; }

.short-add-thumb {
  background: rgba(99,102,241,.07) !important;
  border: 2px dashed var(--border);
  flex-direction: column;
  color: var(--text-muted);
}

/* Utility */
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.py-25  { padding-top: .625rem !important; padding-bottom: .625rem !important; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR — TikTok feed active highlight
   ═══════════════════════════════════════════════════════════════ */
.sidebar-nav .nav-link[href*="feed"].active,
.sidebar-nav .nav-link[href*="feed"]:hover {
  color: #fff;
  background: rgba(254,44,85,.12);
}
.sidebar-nav .nav-link[href*="feed"].active .nav-icon {
  background: var(--gradient-tiktok) !important;
  box-shadow: 0 4px 12px rgba(254,44,85,.4);
}
