/* ============================================================
   CreatorNeed - app.css (glassmorphism, dark/light themes)
   ============================================================ */

/* ---------------- tokens ---------------- */

:root {
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --primary: #7c5cff;
  --primary-2: #a855f7;
  --accent: #22d3ee;
  --success: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --sidebar-w: 248px;
  --transition: 0.18s ease;
}

body.theme-dark {
  --bg: #0b0f1a;
  --bg-2: #101627;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e7eaf3;
  --muted: #94a3b8;
  --glass-blur: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --input-bg: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.09);
  --grid-line: rgba(124, 92, 255, 0.06);
}

body.theme-light {
  --bg: #f2f4fb;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-2: rgba(255, 255, 255, 0.95);
  --border: rgba(15, 23, 42, 0.09);
  --text: #0f172a;
  --muted: #64748b;
  --glass-blur: 16px;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
  --input-bg: #ffffff;
  --hover: rgba(15, 23, 42, 0.06);
  --grid-line: rgba(15, 23, 42, 0.04);
}

/* ---------------- base ---------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 12% -5%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(700px 500px at 95% 10%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(700px 600px at 50% 110%, rgba(168, 85, 247, 0.14), transparent 60%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.4em; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 0.6em; }

code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

input[type="checkbox"], input[type="color"] { width: auto; padding: 0; }
input[type="color"] { height: 2.6rem; background: transparent; }

textarea { resize: vertical; min-height: 80px; }

table { border-collapse: collapse; width: 100%; }

/* ---------------- utilities ---------------- */

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.empty { text-align: center; color: var(--muted); padding: 1rem; }
.inline { display: inline; }
.inline-details { display: inline; }
.fade { opacity: 0; transition: opacity 0.5s; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---------------- glass + panels ---------------- */

.glass {
  background: var(--panel);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 1.25rem; margin-bottom: 1.25rem; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; }
.panel-sub { margin-top: 1.1rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: 0.4rem; color: var(--muted); font-size: 0.9rem; }

.section-title { margin: 1.4rem 0 0.8rem; font-size: 1.05rem; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 550;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124, 92, 255, 0.25); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
}
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.btn.danger-ghost:hover { background: rgba(248, 113, 113, 0.12); }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.82rem; border-radius: 8px; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.align-end { align-self: end; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--hover); }
.icon-btn.danger { color: var(--danger); }

/* ---------------- app shell ---------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1rem;
  background: var(--panel);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border);
  z-index: 40;
}

.app.sidebar-hidden .sidebar { margin-left: calc(-1 * var(--sidebar-w)); transition: margin var(--transition); }
.sidebar { transition: margin var(--transition); }

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text); margin-bottom: 1.4rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
.brand-name { font-size: 1.05rem; }

.side-nav { flex: 1; overflow-y: auto; }
.nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1.1rem 0 0.35rem;
  padding: 0 0.6rem;
}
.nav-link {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  color: var(--text);
  font-size: 0.93rem;
  margin-bottom: 2px;
  transition: background var(--transition);
}
.nav-link:hover { background: var(--hover); text-decoration: none; }

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

.credit-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.credit-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  flex-shrink: 0;
}
.credit-num { font-weight: 700; font-size: 1.05rem; }
.credit-label { color: var(--muted); font-size: 0.78rem; }
.credit-add {
  margin-left: auto;
  width: 1.5rem; height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.credit-add:hover { text-decoration: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.6rem;
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
}
.topbar-search { flex: 1; max-width: 420px; }
.search-form { display: flex; gap: 0.4rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; }

.content { padding: 1.6rem; flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------------- dropdowns ---------------- */

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--panel-2);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0.4rem;
  display: none;
  z-index: 60;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.9rem;
}
.dropdown-item:hover { background: var(--hover); text-decoration: none; }
.dropdown-item.is-active { color: var(--primary); font-weight: 600; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item strong { display: block; font-size: 0.85rem; }
.dropdown-item .muted { font-size: 0.78rem; }

.profile-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; border-radius: 10px; border: 0; background: transparent; color: var(--text); }
.profile-btn:hover { background: var(--hover); }
.profile-name { font-size: 0.9rem; font-weight: 550; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-menu { width: 300px; }

/* ---------------- stats / dashboards ---------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
.stat-card { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.stat-icon { font-size: 1.5rem; }
.stat-value { font-size: 1.7rem; font-weight: 750; }
.stat-label { color: var(--muted); font-size: 0.82rem; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; }

/* ---------------- quick actions & activity ---------------- */

.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.7rem; }
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.84rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.quick-action:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(124, 92, 255, 0.25); text-decoration: none; }
.qa-icon { font-size: 1.4rem; }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: flex; align-items: center; gap: 0.55rem; padding: 0.42rem 0; font-size: 0.9rem; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.activity-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 0.78rem; flex-shrink: 0; }

/* ---------------- lists ---------------- */

.content-list { list-style: none; margin: 0; padding: 0; }
.content-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}
.content-list li:last-child { border-bottom: 0; }

.mini-icon { font-size: 1.05rem; flex-shrink: 0; }
.mini-name { flex: 1; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { font-size: 0.8rem; flex-shrink: 0; }

.project-mini-list, .video-mini-list { display: flex; flex-direction: column; gap: 0.35rem; }
.project-mini, .video-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
}
.project-mini:hover, .video-mini:hover { text-decoration: none; background: var(--hover); }

/* ---------------- storage bar ---------------- */

.storage-bar { margin-top: 0.4rem; }
.storage-track, .progress-track { height: 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; margin-bottom: 0.35rem; }
.storage-fill, .progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

/* ---------------- empty states ---------------- */

.empty-state {
  text-align: center;
  padding: 2.4rem 1rem;
  color: var(--text);
}
.empty-icon { font-size: 2.6rem; display: block; margin-bottom: 0.6rem; }
.empty-state .btn { margin-top: 0.6rem; }

/* ---------------- forms ---------------- */

.form-card { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; max-width: 560px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; align-items: end; }
.form-row { display: flex; gap: 0.7rem; align-items: end; flex-wrap: wrap; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; }

.field { display: block; }
.field-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--muted); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.8rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--primary); background: rgba(124, 92, 255, 0.06); }
.dz-icon { font-size: 2rem; }
.upload-progress { margin-top: 0.9rem; display: flex; align-items: center; gap: 0.7rem; }

/* ---------------- tabs ---------------- */

.tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.tab {
  padding: 0.6rem 1rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count {
  font-size: 0.72rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  margin-left: 0.25rem;
}

/* ---------------- cards ---------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.project-card { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; color: var(--text); transition: transform var(--transition), box-shadow var(--transition); }
.project-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(124, 92, 255, 0.3); text-decoration: none; }
.card-icon { font-size: 1.7rem; }
.card-title { font-size: 1.02rem; margin: 0; }
.card-desc { font-size: 0.85rem; }
.card-meta { display: flex; gap: 0.8rem; font-size: 0.78rem; flex-wrap: wrap; }

.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.9rem; margin-bottom: 1.25rem; }
.count-card { padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: var(--text); border-radius: var(--radius); text-align: center; }
.count-card:hover { text-decoration: none; transform: translateY(-2px); }
.count-num { font-size: 1.6rem; font-weight: 750; }
.count-label { color: var(--muted); font-size: 0.82rem; }

/* ---------------- videos ---------------- */

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.video-card { overflow: hidden; display: flex; flex-direction: column; }
.video-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); display: flex; align-items: center; justify-content: center; }
.thumb-placeholder { font-size: 2.4rem; opacity: 0.6; display: inline-flex; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.duration-badge {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}
.video-body { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.video-body h3 { font-size: 0.95rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-body .btn { margin-top: auto; }

.video-stage .video-player { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); }
.video-placeholder { height: 320px; display: flex; align-items: center; justify-content: center; }
.video-info { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}
.status-badge.is-ok { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.status-badge.is-warn { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.status-badge.is-bad { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.status-badge.is-neutral { background: var(--panel-2); color: var(--muted); }

.job-list { list-style: none; margin: 0; padding: 0; }
.job-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; font-size: 0.9rem; }

/* ---------------- captions timeline ---------------- */

.cap-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.2rem; align-items: start; }
.cap-side { padding: 1.1rem; }
.cap-main { min-width: 0; }
.cap-form { display: flex; flex-direction: column; gap: 0.7rem; }

.cap-preview {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.9rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(34, 211, 238, 0.25), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(124, 92, 255, 0.35), transparent 50%),
    linear-gradient(135deg, #1a1330, #0d1b2a);
  aspect-ratio: 16 / 9;
}
.preview-box { position: relative; width: 100%; height: 100%; display: flex; }
.preview-box[data-position="top"] { align-items: flex-start; }
.preview-box[data-position="center"] { align-items: center; }
.preview-box[data-position="bottom"] { align-items: flex-end; }
.preview-box[data-position="bottom"]::before, .preview-box[data-position="center"]::before, .preview-box[data-position="top"]::before { content: ''; }
.preview-caption {
  width: 100%;
  padding: 0.6rem 0.9rem;
  text-align: center;
  font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  line-height: 1.3;
}

.cap-toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; }
.cap-timeline { display: flex; flex-direction: column; gap: 0.5rem; max-height: 420px; overflow-y: auto; margin-bottom: 0.9rem; }
.cap-line {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
}
.cap-line-times { display: flex; align-items: center; gap: 0.35rem; }
.cap-line-times input { width: 100%; padding: 0.4rem; }
.cap-line-times span { color: var(--muted); }

.toggle-list { display: flex; flex-direction: column; gap: 0.3rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }
.check input { margin: 0; }

/* ---------------- thumbnails ---------------- */

.thumb-concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.thumb-concept { overflow: hidden; display: flex; flex-direction: column; }
.concept-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel-2); }
.concept-img.placeholder { display: flex; align-items: center; justify-content: center; }
.concept-body { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.concept-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.concept-head h3 { margin: 0; font-size: 0.98rem; }
.concept-actions { display: flex; gap: 0.5rem; padding: 0 0.9rem 0.9rem; }

.ctr-badge { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 14px; }
.ctr-badge.is-high { background: rgba(52, 211, 153, 0.18); color: var(--success); }
.ctr-badge.is-mid { background: rgba(251, 191, 36, 0.18); color: var(--warn); }
.ctr-badge.is-low { background: rgba(248, 113, 113, 0.18); color: var(--danger); }

.palette-dots { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); }

.prompt-box { font-size: 0.82rem; }
.prompt-box summary { cursor: pointer; color: var(--accent); }
.prompt-box p { margin-top: 0.4rem; color: var(--muted); }

.thumb-mini-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.thumb-mini { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------------- scripts / blog / shorts / social ---------------- */

.script-card, .blog-card, .short-card, .post-card { padding: 1.1rem; margin-bottom: 1rem; }
.script-head, .blog-head, .short-head, .post-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.script-meta, .card-meta { color: var(--muted); font-size: 0.8rem; }
.script-body, .blog-body, .post-content { margin-top: 0.7rem; font-size: 0.95rem; }
.script-body pre, .code-block { white-space: pre-wrap; word-break: break-word; }

.short-grid, .post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.short-card, .post-card { margin-bottom: 0; }
.short-hook { font-weight: 700; font-size: 1.05rem; margin: 0.3rem 0; }
.short-rank { display: inline-block; margin-bottom: 0.4rem; }

.score-grid { display: flex; flex-direction: column; gap: 0.55rem; }
.score { display: grid; grid-template-columns: 150px 1fr 44px; gap: 0.6rem; align-items: center; }
.score-label { font-size: 0.85rem; }
.score-track { height: 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; }
.score-value { text-align: right; font-weight: 650; font-size: 0.85rem; }

.post-platform { font-size: 0.82rem; }
.post-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.platform-checkboxes { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* ---------------- calendar ---------------- */

.calendar-list { display: flex; flex-direction: column; gap: 0.8rem; }
.calendar-item { display: flex; gap: 0.9rem; padding: 0.9rem; align-items: flex-start; }
.calendar-day-label { font-weight: 750; min-width: 52px; color: var(--primary); }
.calendar-item-body { flex: 1; }
.calendar-item-body h3 { font-size: 0.98rem; margin: 0 0 0.2rem; }

/* ---------------- chat ---------------- */

.chat-layout { max-width: 820px; margin: 0 auto; }
.chat-panel { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; }
.chat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.7rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); }
.chat-context { flex: 1; max-width: 320px; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.chat-empty { text-align: center; padding: 2rem 0.5rem; }
.chat-empty .empty-icon { margin-bottom: 0.8rem; }
.chat-suggestion { margin: 0.2rem; }
.chat-msg { display: flex; }
.chat-msg.is-user { justify-content: flex-end; }
.chat-msg.is-assistant { justify-content: flex-start; }
.bubble {
  max-width: 78%;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-size: 0.93rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.is-user .bubble { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.is-assistant .bubble { background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.9rem 1rem; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; }

/* ---------------- images ---------------- */

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.image-card { overflow: hidden; margin: 0; }
.image-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.image-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.5rem 0.7rem; }

/* ---------------- credits / packs ---------------- */

.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.pack-card { padding: 1.3rem; text-align: center; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.pack-card .price { font-size: 1.9rem; font-weight: 800; }

/* ---------------- subscription ---------------- */

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.plan-card { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.55rem; position: relative; }
.plan-card.is-highlight { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.plan-top { display: flex; align-items: center; gap: 0.5rem; }
.plan-emoji { font-size: 1.6rem; }
.plan-name { margin: 0; font-size: 1.15rem; }
.plan-desc { color: var(--muted); font-size: 0.86rem; }
.plan-price { display: flex; align-items: baseline; gap: 0.35rem; }
.price-num { font-size: 1.9rem; font-weight: 800; }
.price-cycle { color: var(--muted); font-size: 0.85rem; }
.plan-credits { color: var(--muted); font-size: 0.85rem; }
.plan-features { margin: 0.3rem 0 0.7rem; padding-left: 1.1rem; font-size: 0.9rem; }
.plan-features li { margin-bottom: 0.25rem; }
.plan-features li::marker { color: var(--primary); }

.current-plan { padding: 1.2rem; }
.current-plan-body { display: flex; flex-direction: column; gap: 0.4rem; }

/* ---------------- settings ---------------- */

.settings-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.settings-tab {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
}
.settings-tab.is-active { background: var(--panel-2); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

/* ---------------- tables ---------------- */

.table-wrap { overflow-x: auto; }
.table th, .table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr:hover { background: var(--hover); }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tx-type { font-size: 0.78rem; }

.pill {
  display: inline-flex;
  padding: 0.15rem 0.6rem;
  border-radius: 14px;
  font-size: 0.75rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

/* ---------------- alerts / errors ---------------- */

.alert {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: opacity 0.5s;
}
.alert-success { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.4); color: var(--success); }
.alert-error { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.error-list { margin: 0.3rem 0 0; padding-left: 1.2rem; }

.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; text-align: center; gap: 0.5rem; }
.error-code { font-size: 5rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- modal & toast ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 16, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.modal h3 { margin: 0 0 0.4rem; }
.modal p { color: var(--muted); margin: 0 0 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

.toast-wrap {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 340px;
}
.toast {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ---------------- auth ---------------- */

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.auth-shell { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 1rem; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 0.6rem; font-weight: 700; color: var(--text); font-size: 1.2rem; }
.auth-brand:hover { text-decoration: none; }
.auth-card { padding: 1.7rem; }
.auth-head { text-align: center; margin-bottom: 1.1rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }
.auth-divider { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); font-size: 0.8rem; margin: 0.9rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-links { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; margin-top: 0.5rem; }
.auth-demo-hint { font-size: 0.78rem; }
.auth-langs { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.lang-pill {
  padding: 0.3rem 0.7rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}
.lang-pill.is-active { color: var(--primary); border-color: var(--primary); }
.social-login { display: flex; gap: 0.5rem; }
.social-login .btn { flex: 1; }

/* ---------------- admin ---------------- */

.admin-nav { padding: 0.9rem 1rem; margin-bottom: 1.2rem; }
.admin-brand { display: block; font-weight: 750; margin-bottom: 0.7rem; color: var(--text); }
.admin-nav-links { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.88rem;
}
.admin-nav-link:hover { background: var(--hover); text-decoration: none; }
.admin-nav-link.is-active { background: rgba(124, 92, 255, 0.14); color: var(--primary); font-weight: 600; }
.admin-main { max-width: 1280px; margin: 0 auto; }

/* ---------------- landing ---------------- */

.landing-page { overflow-x: hidden; }
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
}
.landing-nav-inner { display: flex; align-items: center; gap: 1.4rem; padding: 0.8rem 20px; }
.landing-links { display: flex; gap: 1rem; margin-left: 1rem; }
.landing-links a { color: var(--muted); font-size: 0.92rem; }
.landing-links a:hover { color: var(--text); text-decoration: none; }
.landing-links a.is-active { color: var(--text); font-weight: 600; }
.landing-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.landing-main { min-height: 70vh; }
.landing-footer { border-top: 1px solid var(--border); padding: 1.6rem 0; text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 3rem; }

.page-hero { text-align: center; padding: 3.2rem 20px 1.6rem; }
.page-hero h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); margin-bottom: 0.5rem; }
.page-hero p { color: var(--muted); font-size: 1.05rem; }

.hero { position: relative; text-align: center; padding: 4.5rem 20px 3rem; }
.hero-glow {
  position: absolute;
  inset: -10% -20%;
  z-index: -1;
  background:
    radial-gradient(500px 300px at 25% 30%, rgba(124, 92, 255, 0.4), transparent 60%),
    radial-gradient(500px 300px at 75% 40%, rgba(34, 211, 238, 0.35), transparent 60%);
  filter: blur(30px);
  opacity: 0.7;
  animation: glow-pulse 6s ease-in-out infinite alternate;
}
@keyframes glow-pulse {
  from { opacity: 0.45; transform: scale(0.98); }
  to { opacity: 0.8; transform: scale(1.02); }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.4);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
}
.hero-title { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.hero-title .grad { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto 1.6rem; }
.hero-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 1.6rem; justify-content: center; flex-wrap: wrap; margin-top: 2.2rem; color: var(--muted); font-size: 0.85rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: 0.35rem; }

.features-section, .how-section, .faq-section, .pricing-section, .cta-section { padding: 2.4rem 20px; }
.section-title-center { text-align: center; margin-bottom: 1.6rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feature-card { padding: 1.3rem; }
.feature-icon { font-size: 1.7rem; margin-bottom: 0.5rem; }
.feature-card h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.feature-card p { color: var(--muted); font-size: 0.88rem; margin: 0; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; counter-reset: step; }
.how-step { padding: 1.2rem; position: relative; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 750;
  margin-bottom: 0.6rem;
}

.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item summary { padding: 0.9rem 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--primary); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1rem 1rem; color: var(--muted); margin: 0; }

.cta-section { text-align: center; }
.cta-section .btn-lg { margin-top: 0.5rem; }

.billing-toggle { display: flex; justify-content: center; gap: 0.4rem; margin-bottom: 1.4rem; }
.toggle-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
}
.toggle-btn.is-active { background: var(--panel-2); color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .cap-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; margin-left: calc(-1 * var(--sidebar-w)); }
  .app.sidebar-hidden .sidebar { margin-left: 0; }
  .sidebar-hidden { margin-left: 0; }
  .app:not(.sidebar-hidden) .sidebar { margin-left: 0; box-shadow: var(--shadow); }
  .chat-panel { height: calc(100vh - 180px); }
}

@media (max-width: 640px) {
  .content { padding: 1rem; }
  .topbar { padding: 0.6rem 0.9rem; }
  .topbar-search { display: none; }
  .profile-name { display: none; }
  .cap-line { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; align-items: stretch; }
  .score { grid-template-columns: 1fr; }
  .score-value { text-align: left; }
}
