:root {
  --primary: #1a2332;
  --primary-light: #243348;
  --gold: #f5a623;
  --gold-dark: #d4891a;
  --text: #e8eaed;
  --text-muted: #8b9ab0;
  --bg: #0f1723;
  --card: #1a2332;
  --card-hover: #1e2a3d;
  --border: #2a3a52;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  --sidebar-width: 240px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* Auth page */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg) 0%, #1a2332 100%);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .brand {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.5px;
}
.auth-logo .subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}
.sidebar-logo .tagline {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}
.nav-section {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-size: 14px;
}
.nav-item:hover, .nav-item.active {
  background: var(--primary-light);
  color: var(--text);
}
.nav-item.active {
  color: var(--gold);
  border-left: 3px solid var(--gold);
}
.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 20px; font-weight: 600; }
.page-content { padding: 32px; flex: 1; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.stat-value { font-size: 36px; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--primary); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: var(--primary-light); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-control {
  width: 100%;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}
.form-control:focus { border-color: var(--gold); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; font-family: inherit; }
select.form-control { appearance: none; cursor: pointer; }

/* Platform checkboxes */
.platform-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.platform-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--primary-light);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.platform-check:hover { border-color: var(--gold); }
.platform-check.checked { border-color: var(--gold); background: rgba(245, 166, 35, 0.1); }
.platform-check input { display: none; }
.platform-icon { font-size: 18px; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-draft { background: rgba(139,154,176,0.2); color: var(--text-muted); }
.badge-scheduled { background: rgba(52,152,219,0.2); color: #5dade2; }
.badge-published { background: rgba(46,204,113,0.2); color: #58d68d; }

/* Posts list */
.posts-list { display: flex; flex-direction: column; gap: 12px; }
.post-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
  cursor: pointer;
}
.post-item:hover { background: var(--card-hover); border-color: var(--gold); }
.post-item-content { flex: 1; min-width: 0; }
.post-item-title { font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-item-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.post-item-actions { display: flex; gap: 8px; }

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-header-cell {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.calendar-day {
  background: var(--primary-light);
  border-radius: 6px;
  min-height: 100px;
  padding: 8px;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.calendar-day:hover { border-color: var(--border); }
.calendar-day.today { border-color: var(--gold); }
.calendar-day.other-month { opacity: 0.35; }
.calendar-day-num {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-muted);
}
.calendar-day.today .calendar-day-num {
  color: var(--gold);
  background: rgba(245,166,35,0.15);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-post-pill {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.calendar-post-pill.draft { background: rgba(139,154,176,0.25); color: var(--text-muted); }
.calendar-post-pill.scheduled { background: rgba(52,152,219,0.25); color: #5dade2; }
.calendar-post-pill.published { background: rgba(46,204,113,0.25); color: #58d68d; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.table tr:hover td { background: var(--card-hover); }

/* Media upload */
.media-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.media-dropzone:hover, .media-dropzone.dragover { border-color: var(--gold); background: rgba(245,166,35,0.05); }
.media-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.media-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  border: none;
  color: white;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-danger { background: rgba(231,76,60,0.15); border: 1px solid rgba(231,76,60,0.3); color: #e74c3c; }
.alert-success { background: rgba(46,204,113,0.15); border: 1px solid rgba(46,204,113,0.3); color: #2ecc71; }

/* Loader */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 18px; font-weight: 600; }

/* AI Helper */
.ai-section {
  background: linear-gradient(135deg, rgba(245,166,35,0.05) 0%, rgba(26,35,50,0) 100%);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.ai-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

/* Responsive */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .calendar-grid { font-size: 12px; }
  .calendar-day { min-height: 60px; }
  .topbar { padding: 12px 16px; }
}

/* Misc utils */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.hidden { display: none !important; }
.w-full { width: 100%; }
