:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface2: #f0f1f5;
  --border: #e2e5ed;
  --text: #1e2030;
  --text-dim: #6b7280;
  --accent: #6c5ce7;
  --accent-hover: #5a4bd1;
  --accent-light: rgba(108, 92, 231, .08);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 10px;
  --sidebar-w: 230px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 1px 0 4px rgba(0,0,0,.04);
}

.sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav {
  list-style: none;
  padding: 12px 10px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all .15s;
  font-size: .9rem;
  font-weight: 500;
}

.sidebar-nav li a:hover { color: var(--text); background: var(--surface2); }
.sidebar-nav li a.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

/* Main content */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 1.35rem; font-weight: 700; color: var(--text); }

.page-content { padding: 24px 32px; }

/* Alerts */
.messages { padding: 0 32px; padding-top: 16px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: .9rem;
  font-weight: 500;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h2 { font-size: 1rem; font-weight: 600; color: var(--text); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card .label { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.stat-card .value { font-size: 1.8rem; font-weight: 700; margin-top: 4px; color: var(--text); }
.stat-card .sub { font-size: .8rem; color: var(--text-dim); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-danger:hover { background: var(--danger); color: white; }

/* Tables */
.table-wrap { overflow-x: auto; }

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

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}

th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--surface2);
}
th:first-child { border-radius: var(--radius) 0 0 0; }
th:last-child { border-radius: 0 var(--radius) 0 0; }
tr:hover td { background: var(--accent-light); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-idea { background: #eff6ff; color: var(--info); }
.badge-scripted { background: #fffbeb; color: var(--warning); }
.badge-filmed { background: var(--accent-light); color: var(--accent); }
.badge-edited { background: #ecfdf5; color: var(--success); }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-archived { background: var(--surface2); color: var(--text-dim); }

.badge-draft { background: var(--surface2); color: var(--text-dim); }
.badge-scheduled { background: #eff6ff; color: var(--info); }
.badge-publishing { background: #fffbeb; color: var(--warning); }
.badge-failed { background: #fef2f2; color: var(--danger); }

/* Kanban */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-col {
  min-width: 260px;
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kanban-col-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-col-header .count {
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .75rem;
  color: var(--text-dim);
}

.kanban-cards { padding: 8px; min-height: 60px; }

.kanban-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}

.kanban-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.kanban-card h4 { font-size: .85rem; margin-bottom: 6px; }
.kanban-card .meta { font-size: .75rem; color: var(--text-dim); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--text-dim); font-weight: 500; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Grid layout helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Modal (Alpine.js powered) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal h2 { font-size: 1.1rem; margin-bottom: 16px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}

.empty-state p { margin-top: 8px; font-size: .9rem; }

/* Sidebar login */
.sidebar-login {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.btn-tiktok {
  display: block;
  text-align: center;
  padding: 10px 16px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  transition: all .15s;
}
.btn-tiktok:hover {
  background: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0,0,0,.1);
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .85rem;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-sep { margin: 0 8px; }

/* Links in content */
.page-content a { color: var(--accent); }
.page-content a:hover { color: var(--accent-hover); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
  .topbar { padding: 16px; }
  .page-content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kanban { flex-direction: column; }
  .kanban-col { min-width: unset; }
}
