/* ============================================================
   CANVA TEMPLATES PLATFORM  —  Premium UI v3
   ============================================================ */

/* ── Google Fonts: Inter + Plus Jakarta Sans ──────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Brand */
  --p50:  #f5f3ff;
  --p100: #ede9fe;
  --p200: #ddd6fe;
  --p400: #a78bfa;
  --p500: #8b5cf6;
  --p600: #7c3aed;
  --p700: #6d28d9;
  --p800: #5b21b6;
  --p900: #4c1d95;

  /* Accent */
  --a400: #fbbf24;
  --a500: #f59e0b;

  /* Neutrals */
  --n0:   #ffffff;
  --n50:  #fafafa;
  --n100: #f4f4f5;
  --n200: #e4e4e7;
  --n300: #d4d4d8;
  --n400: #a1a1aa;
  --n500: #71717a;
  --n600: #52525b;
  --n700: #3f3f46;
  --n800: #27272a;
  --n900: #18181b;

  /* Status */
  --green:  #10b981;
  --red:    #ef4444;
  --blue:   #3b82f6;
  --amber:  #f59e0b;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,.25);
  --shadow-purple: 0 8px 24px rgba(124,58,237,.25);
  --shadow-purple-lg: 0 16px 40px rgba(124,58,237,.35);

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur: 200ms;
  --dur-md: 300ms;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--n100);
  color: var(--n800);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--p600); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--p700); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select, textarea { outline: none; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--n300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--p400); }

/* ══════════════════════════════════════════════════════════════
   LOGIN / AUTH PAGE
   ══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* Left decorative panel */
.auth-panel-left {
  position: relative;
  background: linear-gradient(145deg, #0f0035 0%, #2d0b6b 35%, #5b21b6 70%, #7c3aed 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  overflow: hidden;
}
.auth-panel-left::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,.4) 0%, transparent 70%);
  top: -150px; right: -150px;
  pointer-events: none;
}
.auth-panel-left::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,.25) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.auth-float-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.auth-float-card {
  position: absolute;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}
.auth-float-card:nth-child(1) {
  width: 160px; height: 100px;
  top: 18%; left: 8%;
  transform: rotate(-8deg);
  animation: floatA 6s ease-in-out infinite;
}
.auth-float-card:nth-child(2) {
  width: 200px; height: 130px;
  top: 22%; right: 5%;
  transform: rotate(6deg);
  animation: floatB 7s ease-in-out infinite .5s;
}
.auth-float-card:nth-child(3) {
  width: 140px; height: 90px;
  bottom: 22%; left: 12%;
  transform: rotate(4deg);
  animation: floatA 8s ease-in-out infinite 1s;
}
.auth-float-card:nth-child(4) {
  width: 180px; height: 115px;
  bottom: 18%; right: 8%;
  transform: rotate(-5deg);
  animation: floatB 6.5s ease-in-out infinite 1.5s;
}
@keyframes floatA {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50%       { transform: rotate(-8deg) translateY(-14px); }
}
@keyframes floatB {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50%       { transform: rotate(6deg) translateY(-10px); }
}

.auth-panel-left-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.auth-brand-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.auth-panel-left-content h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: .75rem;
}
.auth-panel-left-content p {
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  max-width: 320px;
  line-height: 1.7;
}
.auth-panel-left-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  text-align: left;
}
.auth-feature-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.8);
  font-size: .88rem;
}
.auth-feature-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Right form panel */
.auth-panel-right {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}
.auth-form-logo {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 2.5rem;
}
.auth-form-logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--p600);
}
.auth-form-logo-text {
  font-size: .85rem;
  font-weight: 700;
  color: var(--n500);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.auth-form-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--n900);
  line-height: 1.2;
  margin-bottom: .5rem;
}
.auth-form-subtitle {
  font-size: .92rem;
  color: var(--n500);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--n600);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--n200);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--n800);
  background: var(--n50);
  transition: all var(--dur) var(--ease);
}
.form-control:hover  { border-color: var(--n300); }
.form-control:focus  { border-color: var(--p500); box-shadow: 0 0 0 3px rgba(139,92,246,.12); background: #fff; }
.form-control.error  { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.form-control-wrap   { position: relative; }
.form-control-wrap .form-control { padding-left: 2.75rem; }
.form-control-icon   {
  position: absolute; left: .9rem; top: 50%;
  transform: translateY(-50%);
  color: var(--n400); font-size: .95rem;
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}
.form-control-wrap:focus-within .form-control-icon { color: var(--p500); }
.form-hint  { font-size: .78rem; color: var(--n400); margin-top: .4rem; display: flex; align-items: center; gap: .3rem; }
.form-error { font-size: .8rem;  color: var(--red);  margin-top: .4rem; display: flex; align-items: center; gap: .3rem; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: .875rem;
  display: flex; align-items: flex-start; gap: .65rem;
  border: 1px solid;
}
.alert i { flex-shrink: 0; margin-top: .1rem; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur);
}
.btn:hover::after { background: rgba(255,255,255,.08); }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--p600) 0%, var(--p500) 100%);
  color: #fff;
  box-shadow: var(--shadow-purple);
}
.btn-primary:hover {
  box-shadow: var(--shadow-purple-lg);
  transform: translateY(-1px);
  color: #fff;
}
.btn-secondary {
  background: var(--p50);
  color: var(--p700);
  border: 1.5px solid var(--p200);
}
.btn-secondary:hover { background: var(--p100); border-color: var(--p300); color: var(--p700); }
.btn-ghost {
  background: transparent;
  color: var(--n600);
  border: 1.5px solid var(--n200);
}
.btn-ghost:hover { background: var(--n100); border-color: var(--n300); }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,.25); }
.btn-success:hover { background: #059669; color: #fff; transform: translateY(-1px); }
.btn-danger  { background: var(--red);   color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,.25); }
.btn-danger:hover  { background: #dc2626; color: #fff; transform: translateY(-1px); }
.btn-warning { background: var(--amber); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-sm  { padding: .45rem .9rem;  font-size: .8rem; border-radius: 6px; }
.btn-lg  { padding: .9rem 2rem;    font-size: 1rem; border-radius: var(--radius); }
.btn-xl  { padding: 1rem 2.5rem;   font-size: 1.05rem; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; transform: none !important; }

/* ── Badges / Tags ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .65rem;
  border-radius: 99px;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .02em;
}
.badge-purple { background: var(--p100); color: var(--p700); }
.badge-green  { background: #d1fae5;     color: #065f46; }
.badge-red    { background: #fee2e2;     color: #991b1b; }
.badge-amber  { background: #fef3c7;     color: #92400e; }
.badge-blue   { background: #dbeafe;     color: #1e40af; }
.badge-gray   { background: var(--n100); color: var(--n600); }

.tag-pill {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem;
  background: var(--p50);
  color: var(--p700);
  border: 1px solid var(--p200);
  border-radius: 99px;
  font-size: .72rem; font-weight: 600;
  margin: .1rem;
}

/* ── Toggle ──────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: .5rem; }
.toggle-input { display: none; }
.toggle-label {
  width: 40px; height: 22px;
  background: var(--n300);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  transition: background var(--dur) var(--ease);
}
.toggle-label::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--dur) var(--ease-spring);
  box-shadow: var(--shadow-sm);
}
.toggle-input:checked + .toggle-label { background: var(--green); }
.toggle-input:checked + .toggle-label::after { transform: translateX(18px); }
.toggle-label-text { font-size: .82rem; color: var(--n500); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ══════════════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; background: var(--n100); }

/* ── Sidebar ─────────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--n900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--dur-md) var(--ease);
  overflow: hidden;
}
.admin-sidebar::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,.2) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-top {
  padding: 1.25rem 1.25rem 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .75rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--p600), var(--p500));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(124,58,237,.4);
  flex-shrink: 0;
}
.sidebar-brand-info { min-width: 0; }
.sidebar-brand-name { color: #fff; font-size: .95rem; font-weight: 700; white-space: nowrap; }
.sidebar-brand-sub  { color: rgba(255,255,255,.35); font-size: .68rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
.sidebar-section {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 1.25rem .5rem .5rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: rgba(255,255,255,.55);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  margin-bottom: .1rem;
  position: relative;
}
.sidebar-link:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.06);
}
.sidebar-link.active {
  color: #fff;
  background: rgba(139,92,246,.2);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--p400);
  border-radius: 0 2px 2px 0;
}
.sidebar-link i {
  font-size: .9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem .75rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user-card {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .75rem;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  margin-bottom: .5rem;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--a500), #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { color: rgba(255,255,255,.85); font-size: .84rem; font-weight: 600; }
.sidebar-user-role { color: rgba(255,255,255,.35); font-size: .68rem; }
.sidebar-logout {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  color: rgba(255,255,255,.35);
  font-size: .82rem; font-weight: 500;
  transition: all var(--dur);
}
.sidebar-logout:hover { color: #ff6b6b; background: rgba(239,68,68,.08); }

/* ── Admin Main ──────────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--n200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: none;
  align-items: center; justify-content: center;
  color: var(--n500);
  background: var(--n100);
  font-size: 1rem;
  transition: all var(--dur);
}
.topbar-toggle:hover { background: var(--n200); color: var(--n800); }
.topbar-breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; color: var(--n500);
}
.topbar-breadcrumb strong { color: var(--n800); font-weight: 700; }
.topbar-breadcrumb span { color: var(--n300); }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.admin-content { padding: 1.5rem; }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--n200);
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--n100);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.card-title { font-size: .95rem; font-weight: 700; color: var(--n800); }
.card-body  { padding: 1.25rem; }

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--n200);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
  opacity: 0;
  transition: opacity var(--dur);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:hover::after { opacity: 1; }
.stat-card-purple::after { background: linear-gradient(90deg, var(--p500), var(--p400)); }
.stat-card-green::after  { background: var(--green); }
.stat-card-amber::after  { background: var(--amber); }
.stat-card-blue::after   { background: var(--blue); }
.stat-card-red::after    { background: var(--red); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.si-purple { background: var(--p100); color: var(--p600); }
.si-green  { background: #d1fae5;     color: #059669; }
.si-amber  { background: #fef3c7;     color: #d97706; }
.si-blue   { background: #dbeafe;     color: #2563eb; }
.si-red    { background: #fee2e2;     color: #dc2626; }

.stat-num   { font-size: 1.65rem; font-weight: 800; line-height: 1; color: var(--n900); }
.stat-label { font-size: .78rem; color: var(--n400); margin-top: .25rem; font-weight: 500; }

/* ── DataTable overrides ─────────────────────────────────────── */
.dataTables_wrapper { font-size: .875rem; }
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--n200) !important;
  border-radius: 8px !important;
  padding: .45rem .85rem !important;
  margin-left: .5rem;
  transition: border-color var(--dur);
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--p500) !important;
  box-shadow: 0 0 0 3px rgba(139,92,246,.1);
  outline: none;
}
.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--n200) !important;
  border-radius: 8px !important;
  padding: .35rem .6rem !important;
}
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
table.dataTable thead th, table.dataTable thead td {
  background: var(--n50) !important;
  padding: .85rem 1rem !important;
  font-size: .72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  color: var(--n400) !important;
  border-bottom: 1px solid var(--n200) !important;
  white-space: nowrap;
}
table.dataTable tbody tr {
  transition: background var(--dur);
  border-bottom: 1px solid var(--n100) !important;
}
table.dataTable tbody tr:hover { background: var(--p50) !important; }
table.dataTable tbody td {
  padding: .875rem 1rem !important;
  vertical-align: middle !important;
  border-top: none !important;
  color: var(--n700);
}
.dataTables_wrapper .dataTables_info { font-size: .8rem; color: var(--n400); }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  border: 1.5px solid var(--n200) !important;
  background: #fff !important;
  color: var(--n600) !important;
  font-size: .8rem !important;
  font-weight: 600 !important;
  margin: 0 2px !important;
  padding: .35rem .7rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--p600) !important;
  border-color: var(--p600) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--p50) !important;
  border-color: var(--p300) !important;
  color: var(--p700) !important;
}

/* ── Filters bar ─────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--n50);
  border-bottom: 1px solid var(--n100);
}
.filter-field { display: flex; flex-direction: column; gap: .3rem; }
.filter-field .form-control { padding: .5rem .85rem; font-size: .84rem; max-width: 200px; }

/* ── Clickable table cell ────────────────────────────────────── */
.link-cell {
  color: var(--p600);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color var(--dur);
}
.link-cell:hover { text-decoration-color: var(--p500); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(9,9,11,.6);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-md) var(--ease);
  backdrop-filter: blur(6px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  transform: scale(.94) translateY(16px);
  transition: transform var(--dur-md) var(--ease), opacity var(--dur-md) var(--ease);
  opacity: 0;
}
.modal-overlay.active .modal-box { transform: scale(1) translateY(0); opacity: 1; }
.modal-box.modal-wide { max-width: 960px; }
.modal-box.modal-sm   { max-width: 420px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--n100);
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--n900); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--n100);
  display: flex; align-items: center; justify-content: center;
  color: var(--n500);
  font-size: .9rem;
  transition: all var(--dur);
}
.modal-close:hover { background: #fee2e2; color: var(--red); }
.modal-body   { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--n100);
  display: flex; justify-content: flex-end; gap: .75rem;
  background: var(--n50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ── Upload zone ─────────────────────────────────────────────── */
.upload-drop-zone {
  border: 2px dashed var(--n300);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--n400);
  transition: all var(--dur) var(--ease);
  background: var(--n50);
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over {
  border-color: var(--p400);
  background: var(--p50);
  color: var(--p600);
}
.upload-drop-zone i { font-size: 2rem; margin-bottom: .65rem; display: block; }
.upload-drop-zone p { font-size: .875rem; font-weight: 500; }

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: .6rem;
  margin-top: .75rem;
}
.upload-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--n200);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(239,68,68,.9);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; cursor: pointer;
  transition: transform var(--dur);
}
.upload-thumb-remove:hover { transform: scale(1.1); }

/* ── Tag multiselect ─────────────────────────────────────────── */
.tag-multiselect { position: relative; }
.tag-multiselect-display {
  min-height: 44px;
  border: 1.5px solid var(--n200);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
  cursor: pointer;
  background: var(--n50);
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.tag-multiselect-display:focus-within,
.tag-multiselect-display.open { border-color: var(--p500); box-shadow: 0 0 0 3px rgba(139,92,246,.1); }
.tag-multiselect-pill {
  background: var(--p600); color: #fff;
  padding: .18rem .55rem .18rem .5rem;
  border-radius: 99px; font-size: .73rem;
  display: flex; align-items: center; gap: .25rem;
}
.tag-multiselect-pill .rm { cursor: pointer; font-size: .8rem; opacity: .8; }
.tag-multiselect-pill .rm:hover { opacity: 1; }
.tag-multiselect-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--p400);
  border-radius: var(--radius-sm);
  max-height: 200px; overflow-y: auto;
  z-index: 99; display: none;
  box-shadow: var(--shadow-lg);
}
.tag-multiselect-dropdown.open { display: block; }
.tag-multiselect-option {
  padding: .55rem .9rem; font-size: .875rem; cursor: pointer;
  display: flex; align-items: center; gap: .6rem;
  transition: background var(--dur);
}
.tag-multiselect-option:hover    { background: var(--p50); }
.tag-multiselect-option.selected { background: var(--p50); color: var(--p700); font-weight: 600; }
.tag-multiselect-option.selected::before {
  content: '✓';
  color: var(--p600);
  font-weight: 800;
  font-size: .75rem;
}

/* ── Misc utility ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--n400);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { font-size: 1.05rem; color: var(--n600); font-weight: 700; margin-bottom: .4rem; }
.empty-state p  { font-size: .875rem; }

/* Toast */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem;
  background: var(--n900);
  color: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-xl);
  min-width: 260px;
  font-size: .875rem; font-weight: 500;
  transform: translateX(120%);
  transition: transform var(--dur-md) var(--ease);
}
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-success .toast-icon { color: #4ade80; }
.toast-error   .toast-icon { color: #f87171; }
.toast-info    .toast-icon { color: #60a5fa; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--n200) 25%, var(--n100) 50%, var(--n200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% } 100% { background-position: -200% } }

/* ══════════════════════════════════════════════════════════════
   CUSTOMER LAYOUT
   ══════════════════════════════════════════════════════════════ */
.customer-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Customer Header ─────────────────────────────────────────── */
.customer-header {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--n200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.customer-logo {
  display: flex; align-items: center; gap: .65rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem; font-weight: 800;
  color: var(--n900);
}
.customer-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--p600), var(--p400));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.customer-logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p500); flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: .75rem; }
.header-email {
  font-size: .82rem; color: var(--n500); font-weight: 500;
  background: var(--n100); padding: .35rem .85rem;
  border-radius: 99px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Customer Body ───────────────────────────────────────────── */
.customer-body { display: flex; flex: 1; }

/* Filter sidebar */
.filter-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--n200);
  padding: 1.25rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.filter-section-title {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--n400);
  margin-bottom: .75rem;
}
.filter-search {
  margin-bottom: 1.25rem;
}
.filter-search .form-control {
  padding: .55rem .85rem;
  font-size: .85rem;
  border-radius: 8px;
}
.filter-tag-list { display: flex; flex-direction: column; gap: .1rem; }
.filter-tag-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .6rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--n600);
  transition: all var(--dur);
  user-select: none;
}
.filter-tag-item:hover { background: var(--n100); }
.filter-tag-item input[type=checkbox] {
  accent-color: var(--p600);
  width: 15px; height: 15px;
  border-radius: 4px;
  cursor: pointer;
}
.filter-tag-item.checked { color: var(--p700); background: var(--p50); font-weight: 600; }

.filter-divider { border: none; border-top: 1px solid var(--n200); margin: 1rem 0; }
.filter-clear-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: var(--red); font-weight: 600;
  cursor: pointer; padding: .3rem .5rem; border-radius: 6px;
  transition: background var(--dur);
}
.filter-clear-btn:hover { background: #fef2f2; }

/* Template main area */
.template-area {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
  background: var(--n100);
}

.template-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.template-count {
  font-size: .875rem; color: var(--n500); font-weight: 500;
}
.template-count strong { color: var(--n800); font-weight: 700; }

.fav-filter-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem 1rem;
  border: 1.5px solid var(--n200);
  border-radius: 99px;
  font-size: .82rem; font-weight: 600;
  color: var(--n500);
  background: #fff;
  transition: all var(--dur) var(--ease);
}
.fav-filter-btn .fav-icon { color: var(--n300); font-size: .9rem; transition: color var(--dur); }
.fav-filter-btn:hover { border-color: #fca5a5; color: var(--red); }
.fav-filter-btn:hover .fav-icon { color: var(--red); }
.fav-filter-btn.active { border-color: var(--red); color: var(--red); background: #fff5f5; }
.fav-filter-btn.active .fav-icon { color: var(--red); }

/* ── Template Cards ──────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.template-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--n200);
  cursor: pointer;
  transition: box-shadow var(--dur-md) var(--ease), transform var(--dur-md) var(--ease), border-color var(--dur) var(--ease);
  position: relative;
}
.template-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  transform: translateY(-4px);
  border-color: var(--n100);
}

/* Image area */
.tc-image {
  position: relative;
  aspect-ratio: 1920/1080;
  overflow: hidden;
  background: var(--n100);
}
.tc-image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.tc-img-primary  { z-index: 1; opacity: 1; }
.tc-img-hover    { z-index: 2; opacity: 0; transform: scale(1.04); }
.template-card:hover .tc-img-primary { opacity: 0; }
.template-card:hover .tc-img-hover   { opacity: 1; transform: scale(1); }

.tc-no-img {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; color: var(--n400);
}
.tc-no-img i { font-size: 2rem; opacity: .4; }

/* Heart button */
.heart-btn {
  position: absolute; top: .65rem; right: .65rem;
  z-index: 3;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  color: var(--n300);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: all var(--dur) var(--ease-spring);
}
.heart-btn:hover   { transform: scale(1.15); color: var(--red); }
.heart-btn.hearted { color: var(--red); }

/* Hover overlay */
.tc-hover-overlay {
  position: absolute; inset: 0; z-index: 4;
  background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--dur-md);
  display: flex; align-items: flex-end; padding: .85rem;
}
.template-card:hover .tc-hover-overlay { opacity: 1; }
.tc-quick-open {
  background: rgba(255,255,255,.95);
  color: var(--n800);
  font-size: .78rem; font-weight: 700;
  padding: .35rem .85rem;
  border-radius: 99px;
  display: flex; align-items: center; gap: .35rem;
  transform: translateY(6px);
  transition: transform var(--dur-md);
}
.template-card:hover .tc-quick-open { transform: translateY(0); }

/* Card body */
.tc-body { padding: .9rem 1rem 1rem; }
.tc-name {
  font-size: .9rem; font-weight: 700; color: var(--n800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .25rem;
}
.tc-desc {
  font-size: .78rem; color: var(--n500); line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .5rem;
}
.tc-tags { display: flex; flex-wrap: wrap; gap: .2rem; }

/* ── Template Popup ──────────────────────────────────────────── */
.popup-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.75rem;
}
.popup-slider-main {
  aspect-ratio: 1920/1080;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--n100);
  margin-bottom: .65rem;
  position: relative;
}
.popup-slider-main img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .25s;
}
.thumb-strip { display: flex; gap: .4rem; flex-wrap: wrap; }
.thumb-strip img {
  width: 58px; height: 44px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--dur);
  opacity: .6;
}
.thumb-strip img.active, .thumb-strip img:hover { border-color: var(--p500); opacity: 1; }

.popup-info { display: flex; flex-direction: column; gap: 1rem; }
.popup-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem; font-weight: 800; color: var(--n900);
  line-height: 1.3;
}
.popup-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.popup-desc {
  font-size: .875rem; color: var(--n500); line-height: 1.75;
  flex: 1; overflow-y: auto; max-height: 180px;
}
.popup-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: auto; }
.popup-action-divider {
  font-size: .72rem; color: var(--n400); text-align: center;
  position: relative;
}
.popup-action-divider::before, .popup-action-divider::after {
  content: '';
  position: absolute;
  top: 50%; width: 35%;
  height: 1px; background: var(--n200);
}
.popup-action-divider::before { left: 0; }
.popup-action-divider::after  { right: 0; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .35rem; margin-top: 2rem; flex-wrap: wrap;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 600;
  background: #fff;
  border: 1.5px solid var(--n200);
  color: var(--n500);
  transition: all var(--dur) var(--ease);
}
.page-btn:hover  { background: var(--p50); border-color: var(--p300); color: var(--p700); }
.page-btn.active { background: var(--p600); border-color: var(--p600); color: #fff; }
.page-btn.disabled { opacity: .35; pointer-events: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
  .popup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .admin-sidebar {
    width: 256px;
    transform: translateX(-100%);
    box-shadow: none;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-2xl);
  }
  .admin-main { margin-left: 0; }
  .topbar-toggle { display: flex !important; align-items: center; justify-content: center; }
  .filter-sidebar { display: none; }
}
@media (max-width: 640px) {
  .templates-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
  .admin-content { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}

/* Auth page responsive */
@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
  .auth-panel-right { padding: 2rem 1.5rem; }
}
