/* =====================================================================
   ASHISH CLOUD — premium dashboard styles
   ===================================================================== */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;

  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-muted: #94a3b8;
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --surface-3: #eef2ff;
  --line: #e8ecf6;
  --line-strong: #dbe2f0;

  --primary: #6366f1;
  --primary-2: #3b82f6;
  --primary-3: #8b5cf6;
  --primary-soft: #eef0ff;
  --pink: #ec4899;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #10b981;

  --gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 52%, #8b5cf6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(99,102,241,.14), rgba(59,130,246,.08) 50%, rgba(139,92,246,.14));
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 4px 14px rgba(23, 37, 84, .06);
  --shadow-md: 0 12px 34px rgba(23, 37, 84, .10);
  --shadow-lg: 0 28px 70px rgba(23, 37, 84, .16);
  --radius: 16px;
  --radius-lg: 22px;
  --radius-sm: 11px;
  --sidebar-w: 268px;
  --topbar-h: 74px;
  --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

[data-bs-theme="dark"] {
  --ink: #f1f5ff;
  --ink-soft: #b6c2dc;
  --ink-muted: #7c8bad;
  --surface: #111831;
  --surface-2: #0c1226;
  --surface-3: #182142;
  --line: #1e2947;
  --line-strong: #2a3760;
  --primary-soft: #1d2450;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, .28);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, .36);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-3); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.025em; color: var(--ink); }

::selection { background: rgba(99,102,241,.22); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: #b9c4dc; }

/* ------------------------------------------------------------------ */
/* App shell                                                           */
/* ------------------------------------------------------------------ */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 16px;
  flex-shrink: 0;
}

.brand-mark {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  box-shadow: 0 10px 24px rgba(99,102,241,.35);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.45), transparent 55%);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: .06em;
  line-height: 1.15;
}
.brand-sub { font-size: 9.5px; letter-spacing: .19em; color: var(--ink-muted); text-transform: uppercase; font-weight: 600; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2px 14px 18px;
  scrollbar-width: thin;
}

.nav-section { margin-top: 18px; }
.nav-section:first-child { margin-top: 4px; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 12px;
  margin-bottom: 7px;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--ink-soft);
  font-weight: 550;
  font-size: 13.5px;
  line-height: 1.3;
  position: relative;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.sidebar .nav-link i { font-size: 16px; width: 19px; text-align: center; color: var(--ink-muted); transition: color var(--transition); }
.sidebar .nav-link:hover { background: var(--surface-3); color: var(--ink); transform: translateX(2px); }
.sidebar .nav-link:hover i { color: var(--primary); }
.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(139,92,246,.10));
  color: var(--primary);
  font-weight: 650;
}
.sidebar .nav-link.active i { color: var(--primary); }
.sidebar .nav-link.active::before {
  content: "";
  position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0;
  background: var(--gradient);
}
.sidebar .nav-link .nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid; place-items: center;
}

.sidebar-footer { padding: 12px 16px 18px; border-top: 1px solid var(--line); flex-shrink: 0; }

.upgrade-card {
  background: linear-gradient(145deg, #111a3a, #1f2a5c);
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.upgrade-card::after {
  content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.6), transparent 65%);
  right: -36px; top: -42px;
}
.upgrade-card h6 { font-size: 12px; margin: 0 0 3px; color: #fff; letter-spacing: .02em; }
.upgrade-card p { font-size: 10.5px; color: #b9c4e4; margin: 0 0 10px; }
.upgrade-card .btn { font-size: 11px; padding: 6px 12px; border-radius: 8px; background: #fff; color: #1e2a5a; font-weight: 700; border: 0; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px;
  transition: background var(--transition);
}
.user-chip:hover { background: var(--surface-3); }
.user-chip .avatar { width: 36px; height: 36px; }
.user-chip .meta { min-width: 0; flex: 1; }
.user-chip .name { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .email { font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .logout-btn { color: var(--ink-muted); font-size: 15px; background: none; border: 0; padding: 6px; border-radius: 8px; }
.user-chip .logout-btn:hover { color: var(--red); background: rgba(239,68,68,.1); }

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--gradient);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-xs);
}
.avatar-sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* Main */
.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .page-crumb { font-size: 12px; color: var(--ink-muted); margin-right: auto; display: flex; align-items: center; gap: 7px; }
.topbar .page-crumb strong { color: var(--ink); font-weight: 650; }
.topbar-search {
  position: relative;
  width: min(360px, 34vw);
}
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-size: 15px; }
.topbar-search input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 42px;
  font-size: 13px;
  transition: border var(--transition), box-shadow var(--transition);
}
.topbar-search input:focus { outline: 0; border-color: rgba(99,102,241,.55); box-shadow: 0 0 0 4px rgba(99,102,241,.10); }
.topbar-search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--ink-muted); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-grid; place-items: center;
  font-size: 16px;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--primary); border-color: rgba(99,102,241,.4); background: var(--primary-soft); transform: translateY(-1px); }
.icon-btn .badge-dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--surface);
}

.mobile-toggle { display: none; }

.content { padding: 28px; flex: 1; max-width: 1680px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head h1 { font-size: 27px; margin: 0 0 4px; font-weight: 750; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--ink-muted); font-size: 13.5px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 9px;
}

/* Buttons */
.btn { font-weight: 600; border-radius: 10px; font-size: 13px; padding: 9px 16px; transition: all var(--transition); }
.btn-lg { padding: 12px 22px; font-size: 14px; border-radius: 12px; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-primary {
  background: var(--gradient);
  border: 0;
  color: #fff;
  box-shadow: 0 8px 20px rgba(99,102,241,.28);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #5457e5, #2f76ea 52%, #7c4df0); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(99,102,241,.34); }
.btn-light { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.btn-light:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.btn-soft { background: var(--primary-soft); color: var(--primary); border: 0; }
.btn-soft:hover { background: rgba(99,102,241,.2); color: var(--primary); }
.btn-danger-soft { background: rgba(239,68,68,.1); color: var(--red); border: 0; }
.btn-danger-soft:hover { background: rgba(239,68,68,.18); color: var(--red); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Cards */
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h2, .panel-head h3 { font-size: 15px; margin: 0; font-weight: 700; }
.panel-head .sub { font-size: 12px; color: var(--ink-muted); }
.panel-head .spacer { flex: 1; }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(99,102,241,.22); }
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 19px;
  margin-bottom: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}
.stat-card .stat-icon.pink { background: rgba(236,72,153,.1); color: var(--pink); }
.stat-card .stat-icon.teal { background: rgba(20,184,166,.1); color: var(--teal); }
.stat-card .stat-icon.amber { background: rgba(245,158,11,.12); color: var(--amber); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 750; letter-spacing: -.04em; line-height: 1; margin-bottom: 5px; }
.stat-card .stat-label { font-size: 12px; color: var(--ink-muted); font-weight: 550; }
.stat-card .stat-trend { font-size: 11px; font-weight: 650; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; color: var(--green); }
.stat-card .stat-trend.muted { color: var(--ink-muted); }
.stat-card .watermark {
  position: absolute; right: -14px; bottom: -16px; font-size: 82px; line-height: 1;
  color: rgba(99,102,241,.055); pointer-events: none;
}

.hero-card {
  background: linear-gradient(125deg, #101a3d 0%, #243069 55%, #4c3a8f 100%);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-card::before, .hero-card::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero-card::before { width: 300px; height: 300px; right: -80px; top: -120px; background: radial-gradient(circle, rgba(96,165,250,.38), transparent 65%); }
.hero-card::after { width: 220px; height: 220px; right: 90px; bottom: -130px; background: radial-gradient(circle, rgba(168,85,247,.44), transparent 65%); }
.hero-card h2 { color: #fff; font-size: 22px; margin: 0 0 6px; }
.hero-card p { color: #b9c6ea; font-size: 12.5px; margin: 0 0 16px; max-width: 480px; }
.hero-card .btn { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(4px); }
.hero-card .btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.hero-card .btn-white { background: #fff; color: #1b2652; }
.hero-card .btn-white:hover { background: #eef2ff; color: #1b2652; }

.account-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all var(--transition);
}
.account-mini:hover { border-color: rgba(99,102,241,.35); box-shadow: var(--shadow-sm); }
.account-mini .meta { flex: 1; min-width: 0; }
.account-mini .email { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-mini .sub { font-size: 10.5px; color: var(--ink-muted); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 650;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-soft);
}
.chip.success { background: rgba(16,185,129,.12); color: #0b9c6d; }
.chip.warning { background: rgba(245,158,11,.14); color: #b77908; }
.chip.danger { background: rgba(239,68,68,.12); color: #d33; }
.chip.info { background: rgba(59,130,246,.12); color: #2563eb; }
.chip.purple { background: rgba(139,92,246,.13); color: #7c3aed; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------------ */
/* Gallery                                                             */
/* ------------------------------------------------------------------ */
.filter-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 18px;
}
.filter-bar .form-control, .filter-bar .form-select { height: 38px; border-radius: 9px; font-size: 12.5px; border-color: var(--line); background-color: var(--surface); color: var(--ink); }
.filter-bar .search-input { position: relative; flex: 1; min-width: 170px; }
.filter-bar .search-input i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-size: 14px; }
.filter-bar .search-input input { padding-left: 34px; }

.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a {
  font-size: 11.5px; font-weight: 650; color: var(--ink-muted);
  padding: 6px 11px; border-radius: 7px; transition: all var(--transition);
}
.segmented a:hover { color: var(--ink); }
.segmented a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }

.masonry {
  column-count: 4;
  column-gap: 14px;
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-3);
  cursor: zoom-in;
  border: 1px solid var(--line);
  transform: translateZ(0);
}
.masonry-item img { width: 100%; height: auto; display: block; transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .3s; }
.masonry-item:hover img { transform: scale(1.035); filter: brightness(.92); }
.masonry-item .tile-overlay {
  position: absolute; inset: auto 0 0 0;
  padding: 30px 10px 9px;
  background: linear-gradient(to top, rgba(6,11,26,.72), transparent);
  opacity: 0; transition: opacity .22s;
  display: flex; align-items: flex-end; gap: 6px;
}
.masonry-item:hover .tile-overlay { opacity: 1; }
.masonry-item .tile-meta { flex: 1; min-width: 0; color: #fff; }
.masonry-item .tile-meta .name { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masonry-item .tile-meta .sub { font-size: 9.5px; opacity: .75; }
.tile-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 0;
  background: rgba(255,255,255,.18); color: #fff;
  display: grid; place-items: center; font-size: 13px;
  backdrop-filter: blur(6px);
  transition: background .2s, transform .2s;
}
.tile-btn:hover { background: rgba(255,255,255,.32); transform: scale(1.06); }
.tile-btn.is-favorite { color: #fda4af; }
.media-badges { position: absolute; top: 9px; right: 9px; display: flex; gap: 5px; }
.media-badge {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(7,12,28,.55); color: #fff; font-size: 12px;
  backdrop-filter: blur(6px);
}
.media-badge.fav { color: #fda4af; }
.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(7,12,28,.72); color: #fff;
  border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 650;
  letter-spacing: .02em;
}

/* Gallery multi-select */
.gallery-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 11px; margin: 0 0 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-xs);
  position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 20;
  backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s;
}
.gallery-toolbar:hover { border-color: var(--line-strong); }
.gallery-toolbar .gt-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gallery-toolbar .gt-group[hidden] { display: none !important; }
.gallery-toolbar .btn { padding: 6px 12px; border-radius: 8px; font-size: 12px; }
.gallery-toolbar .btn:disabled { opacity: .5; }
.gallery-toolbar .gt-count {
  font-size: 11.5px; font-weight: 650; color: var(--primary);
  background: var(--primary-soft); padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}

.select-check {
  position: absolute; top: 9px; left: 9px; z-index: 3;
  width: 24px; height: 24px; border-radius: 8px;
  display: none; place-items: center;
  font-size: 13px; line-height: 1; color: #fff;
  background: rgba(7,12,28,.42);
  border: 1.5px solid rgba(255,255,255,.85);
  backdrop-filter: blur(6px);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.gallery.is-selecting .select-check { display: grid; }
.gallery.is-selecting .js-media { cursor: pointer; }
.gallery-selecting .gallery { user-select: none; -webkit-user-select: none; }
.gallery.is-selecting .tile-overlay { opacity: 0 !important; pointer-events: none; }
.gallery.is-selecting .js-media:hover img { transform: none; filter: none; }
.gallery.is-selecting .video-card:hover { transform: none; box-shadow: none; }
.masonry-item.is-selected,
.video-card.is-selected {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
  border-color: transparent;
}
.masonry-item.is-selected .select-check,
.video-card.is-selected .select-check {
  background: var(--gradient);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,.45);
}
.masonry-item.is-selected img,
.video-card.is-selected img { opacity: .82; }
.video-card.is-selected { transform: none; }

.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.video-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.video-thumb { position: relative; aspect-ratio: 16 / 10; background: #0b1020; cursor: pointer; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .5s, opacity .3s; }
.video-card:hover .video-thumb img { transform: scale(1.04); opacity: 1; }
.play-btn {
  position: absolute; inset: 0; margin: auto;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #111a3a;
  display: grid; place-items: center; font-size: 19px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  transition: transform .2s;
}
.video-thumb:hover .play-btn { transform: scale(1.08); }
.video-info { padding: 12px 13px 13px; }
.video-info .title { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-info .meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-muted); margin-top: 4px; }
.video-info .meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 70px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-illustration {
  width: 84px; height: 84px; border-radius: 24px;
  background: var(--gradient-soft);
  display: grid; place-items: center;
  font-size: 34px; color: var(--primary);
  margin-bottom: 18px;
  transform: rotate(-4deg);
}
.empty-state h3 { font-size: 17px; margin: 0 0 6px; }
.empty-state p { color: var(--ink-muted); font-size: 13px; max-width: 420px; margin: 0 0 18px; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px; height: 38px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 600;
}
.pager a:hover { border-color: rgba(99,102,241,.4); color: var(--primary); }
.pager .current { background: var(--gradient); border-color: transparent; color: #fff; }
.pager .disabled { opacity: .45; pointer-events: none; }

/* ------------------------------------------------------------------ */
/* Lightbox                                                           */
/* ------------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(4,7,18,.94);
  backdrop-filter: blur(14px);
  display: none;
  flex-direction: column;
}
.lightbox.open { display: flex; animation: fadeIn .22s ease; }
.lightbox-top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  color: #e2e8ff;
  z-index: 2;
}
.lightbox-top .info { flex: 1; min-width: 0; }
.lightbox-top .info .title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-top .info .meta { font-size: 11px; color: #8e9bc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.07); color: #e6ebff;
  display: grid; place-items: center; font-size: 16px;
  transition: all .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.lb-btn.active { background: var(--primary); border-color: transparent; color: #fff; }
.lightbox-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 76px 20px; }
.lightbox-stage img, .lightbox-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: transform .28s ease; transform-origin: center; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  color: #fff; display: grid; place-items: center; font-size: 22px;
  transition: all .2s;
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-nav.prev { left: 18px; }
.lb-nav.next { right: 18px; }
.lb-counter { text-align: center; font-size: 11.5px; color: #8e9bc2; padding: 8px 0 16px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.form-label { font-size: 12px; font-weight: 650; color: var(--ink-soft); margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13.5px; padding: 10px 13px; min-height: 42px;
  transition: border var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--ink-muted); }
.form-control:focus, .form-select:focus { background: var(--surface); color: var(--ink); border-color: rgba(99,102,241,.55); box-shadow: 0 0 0 4px rgba(99,102,241,.10); }
.form-text { font-size: 11px; color: var(--ink-muted); }
.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.input-group-text { background: var(--surface-3); border-color: var(--line); color: var(--ink-muted); border-radius: 10px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background .2s; flex-shrink: 0; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); font-size: 12.5px; margin: 0; }
.table > thead th { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); font-weight: 700; border-bottom-color: var(--line); padding: 10px 12px; white-space: nowrap; }
.table > tbody td { padding: 12px; vertical-align: middle; border-color: var(--line); }
.table > tbody tr:hover { background: var(--surface-2); }

/* Modals */
.modal-content { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-size: 15px; }
.btn-close { filter: var(--bs-btn-close-filter, none); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* Alerts */
.alert { border: 0; border-radius: 12px; font-size: 13px; padding: 12px 14px; }
.alert-success { background: rgba(16,185,129,.11); color: #0b7a56; }
.alert-danger { background: rgba(239,68,68,.10); color: #c02c2c; }
.alert-warning { background: rgba(245,158,11,.13); color: #96650a; }
.alert-info { background: rgba(59,130,246,.10); color: #2563eb; }
[data-bs-theme="dark"] .alert-success { color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger { color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; }
[data-bs-theme="dark"] .alert-info { color: #93c5fd; }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 2200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast-item {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow-lg);
  font-size: 12.5px; color: var(--ink); animation: slideIn .25s ease;
}
.toast-item.success { border-left-color: var(--green); }
.toast-item.danger { border-left-color: var(--red); }
.toast-item.warning { border-left-color: var(--amber); }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ */
/* Auth                                                               */
/* ------------------------------------------------------------------ */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; padding: 46px;
  background: linear-gradient(150deg, #0b1230 0%, #1b2454 45%, #3b2a72 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; top: -190px; background: radial-gradient(circle, rgba(99,102,241,.52), transparent 65%); }
.auth-art::after { content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%; left: -190px; bottom: -230px; background: radial-gradient(circle, rgba(236,72,153,.34), transparent 65%); }
.auth-art .brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-art .brand .brand-name { color: #fff; }
.auth-art .headline { position: relative; z-index: 1; margin: auto 0; max-width: 520px; }
.auth-art h1 { color: #fff; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.06; letter-spacing: -.045em; margin-bottom: 18px; }
.auth-art h1 span { background: linear-gradient(120deg, #93c5fd, #c4b5fd, #f9a8d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #b7c3e6; font-size: 14px; max-width: 420px; }
.auth-points { display: grid; gap: 11px; margin-top: 26px; }
.auth-point { display: flex; gap: 11px; align-items: center; font-size: 12.5px; color: #cbd5f5; }
.auth-point i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.1); display: grid; place-items: center; color: #a5b4fc; font-size: 13px; }
.auth-art .foot { position: relative; z-index: 1; font-size: 11px; color: #8d9bc4; }

.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 42px 30px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; letter-spacing: -.035em; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-muted); font-size: 13px; margin-bottom: 26px; }
.auth-card .form-control { min-height: 46px; }
.auth-card .btn-primary { min-height: 46px; font-size: 13.5px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-muted); font-size: 11px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-note { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #a16207; border-radius: 11px; padding: 10px 12px; font-size: 11.5px; line-height: 1.5; }
[data-bs-theme="dark"] .demo-note { color: #fcd34d; }

/* ------------------------------------------------------------------ */
/* Accounts / import / sync                                            */
/* ------------------------------------------------------------------ */
.account-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 15px;
  border: 1px solid var(--line); background: var(--surface);
  transition: all var(--transition);
}
.account-card:hover { border-color: rgba(99,102,241,.28); box-shadow: var(--shadow-sm); }
.account-card .avatar { width: 46px; height: 46px; font-size: 15px; }
.account-card .meta { flex: 1; min-width: 0; }
.account-card .email { font-weight: 650; font-size: 13.5px; }
.account-card .name { font-size: 11px; color: var(--ink-muted); }
.account-card .counts { display: flex; gap: 14px; text-align: right; }
.account-card .counts .num { font-family: var(--font-display); font-weight: 750; font-size: 16px; line-height: 1; }
.account-card .counts .lbl { font-size: 9.5px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }

.dropzone {
  border: 1.6px dashed var(--line-strong);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon { font-size: 32px; color: var(--primary); margin-bottom: 9px; }
.dropzone h5 { font-size: 14px; margin: 0 0 4px; }
.dropzone p { font-size: 11.5px; color: var(--ink-muted); margin: 0; }

.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.file-row:hover { background: var(--surface-2); border-color: var(--line); }
.file-icon {
  width: 38px; height: 42px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 17px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
}
.file-icon.image { background: rgba(20,184,166,.1); color: var(--teal); }
.file-icon.video { background: rgba(236,72,153,.1); color: var(--pink); }
.file-icon.audio { background: rgba(139,92,246,.12); color: var(--purple); }
.file-icon.pdf { background: rgba(239,68,68,.1); color: var(--red); }
.file-icon.document { background: rgba(59,130,246,.1); color: #2563eb; }
.file-icon.spreadsheet { background: rgba(16,185,129,.1); color: #0b9c6d; }
.file-icon.archive { background: rgba(245,158,11,.12); color: var(--amber); }
.file-row .meta { flex: 1; min-width: 0; }
.file-row .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .sub { font-size: 10.5px; color: var(--ink-muted); }
.file-row .actions { display: flex; gap: 4px; opacity: .35; transition: opacity .2s; }
.file-row:hover .actions { opacity: 1; }

.folder-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  transition: all var(--transition);
  min-height: 110px;
}
.folder-card:hover { border-color: rgba(99,102,241,.35); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.folder-card .folder-icon { font-size: 25px; color: #f6b73c; }
.folder-card .name { font-size: 12.5px; font-weight: 650; margin-top: auto; }
.folder-card .sub { font-size: 10.5px; color: var(--ink-muted); }

.timeline-group { margin-bottom: 34px; }
.timeline-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.timeline-title h3 { font-size: 17px; margin: 0; }
.timeline-title span { font-size: 11px; color: var(--ink-muted); }

.log-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.log-icon.success { background: rgba(16,185,129,.1); color: var(--green); }
.log-icon.warning { background: rgba(245,158,11,.12); color: var(--amber); }
.log-icon.error { background: rgba(239,68,68,.1); color: var(--red); }
.log-icon.started { background: var(--primary-soft); color: var(--primary); }
.log-row .body { flex: 1; min-width: 0; }
.log-row .message { font-size: 12px; }
.log-row .meta { font-size: 10.5px; color: var(--ink-muted); margin-top: 2px; }

.import-status {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: 15px;
  background: var(--gradient-soft);
  border: 1px solid rgba(99,102,241,.16);
}
.pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 rgba(99,102,241,.6); animation: pulse 1.8s infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(99,102,241,.5); } 70% { box-shadow: 0 0 0 12px rgba(99,102,241,0); } 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); } }

/* Settings */
.settings-nav { display: flex; flex-direction: column; gap: 3px; }
.settings-nav a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 9px; color: var(--ink-soft); font-size: 12.5px; font-weight: 550; }
.settings-nav a:hover, .settings-nav a.active { background: var(--surface-3); color: var(--primary); }

.token-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: #0b1020; color: #a5f3fc;
  padding: 12px 14px; border-radius: 10px;
  word-break: break-all;
}

/* Charts */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.sm { height: 190px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-soft); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* Utilities */
.text-muted { color: var(--ink-muted) !important; }
.text-soft { color: var(--ink-soft) !important; }
.fw-650 { font-weight: 650 !important; }
.fw-750 { font-weight: 750 !important; }
.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.gap-8 { gap: 8px !important; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }

.skeleton { background: linear-gradient(100deg, var(--surface-3) 30%, var(--line) 50%, var(--surface-3) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Responsive */
@media (max-width: 1400px) {
  .masonry { column-count: 3; }
  .video-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1199px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-art { padding: 34px; }
}
@media (max-width: 991px) {
  :root { --sidebar-w: 280px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main-wrap { margin-left: 0; }
  .mobile-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px; }
  .topbar-search { display: none; }
  .page-head h1 { font-size: 23px; }
  .masonry { column-count: 2; column-gap: 10px; }
  .masonry-item { margin-bottom: 10px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(5,9,25,.5); z-index: 1035; backdrop-filter: blur(2px); display: none; }
  .sidebar-backdrop.show { display: block; }
  .lightbox-stage { padding: 0 12px 20px; }
  .lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .content { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 23px; }
  .stat-card .stat-icon { width: 36px; height: 36px; font-size: 16px; margin-bottom: 10px; }
  .masonry { column-count: 2; }
  .grid-2 { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .account-card { flex-wrap: wrap; }
  .account-card .counts { margin-left: auto; }
  .lightbox-top { padding: 10px 12px; }
  .lightbox-top .info { display: none; }
  .lb-btn { width: 36px; height: 36px; }
  .auth-form-wrap { padding: 28px 18px; }
  .filter-bar { padding: 8px; }
  .table-responsive { border-radius: 12px; }
  .gallery-toolbar { position: static; padding: 8px 9px; }
  .gallery-toolbar .btn { padding: 6px 10px; font-size: 11.5px; }
  .gallery-toolbar .gt-actions { width: 100%; justify-content: flex-start; }
  .gallery-toolbar .gt-actions.ms-auto { margin-left: 0 !important; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .masonry { column-count: 2; column-gap: 8px; }
  .masonry-item { border-radius: 10px; }
  .masonry-item .tile-meta { display: none; }
  .page-head h1 { font-size: 21px; }
  .content { padding: 12px; }
  .panel { padding: 14px; }
}

/* Utility additions */
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.panel-title { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.panel-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.icon-tile {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-soft); font-size: 18px;
}
.icon-tile.purple { background: rgba(99,102,241,.12); color: #6366f1; }
.icon-tile.success { background: rgba(16,185,129,.12); color: #059669; }
.icon-tile.warning { background: rgba(245,158,11,.14); color: #b45309; }
.form-switch .form-check-input:checked { background-color: #6366f1; border-color: #6366f1; }

/* Notifications */
.notif-list { display: flex; flex-direction: column; }
.notif-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 4px;
  border-bottom: 1px solid var(--line);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row.unread { background: linear-gradient(90deg, rgba(99,102,241,.055), transparent 70%); }
.notif-body { flex: 1; min-width: 0; }
.notif-body p { line-height: 1.5; }

/* Print */
@media print {
  .sidebar, .topbar, .page-actions, .pager { display: none !important; }
  .main-wrap { margin: 0; }
  body { background: #fff; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
