/* ==========================================================================
   B-Roll Tabela — Admin Panel Stylesheet
   Dark theme consistent with main site design system
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&family=Inter:wght@300;400;500&display=swap');

/* --------------------------------------------------------------------------
   1. Design Tokens (matches main.css)
   -------------------------------------------------------------------------- */
:root {
  --bg:           #f5f6f8; /* Light gray backdrop for workspace */
  --bg-card:      #ffffff; /* Pure white containers */
  --bg-elevated:  #ffffff;
  --bg-sidebar:   #ffffff; /* Minimalist white sidebar */

  --gold:         #b58d3d; /* Elegant warm gold */
  --gold-light:   #c9a84c;
  --gold-dim:     rgba(181, 141, 61, 0.08);
  --gold-border:  rgba(181, 141, 61, 0.25);

  --text:         #222222; /* High-contrast charcoal text */
  --text-muted:   #666666;
  --text-dim:     #999999;
  --border:       rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);

  --success:      #2ecc71;
  --success-dim:  rgba(46, 204, 113, 0.1);
  --error:        #e74c3c;
  --error-dim:    rgba(231, 76, 60, 0.1);
  --warning:      #f39c12;
  --warning-dim:  rgba(243, 156, 18, 0.1);
  --info:         #3498db;
  --info-dim:     rgba(52, 152, 219, 0.1);

  --shadow-lg:    0 16px 48px rgba(0,0,0,0.04);
  --shadow-gold:  0 8px 24px rgba(181,141,61,0.08);

  --sidebar-width:          260px;
  --sidebar-collapsed-width: 68px;
  --topbar-height:           60px;

  --font-heading: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;
  --radius-sm:    4px;
  --radius-md:    12px;
  --radius-lg:    24px;
  --transition:   all 0.3s ease;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* --------------------------------------------------------------------------
   3. Admin Layout Shell
   -------------------------------------------------------------------------- */
.admin-body {
  display: flex;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   4. Sidebar
   -------------------------------------------------------------------------- */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.77,0,0.175,1), width 0.3s ease;
  overflow: hidden;
}

/* Sidebar Header (Logo) */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-logo-text span { color: var(--gold); }

.sidebar-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  color: var(--gold);
  border-color: var(--gold-border);
}

.sidebar-toggle-btn svg { width: 14px; height: 14px; }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-section-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 20px 6px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  border-radius: 0;
}

.sidebar-item:hover {
  color: var(--text);
  background: rgba(0,0,0,0.03);
}

.sidebar-item.active {
  color: var(--gold);
  background: var(--gold-dim);
  font-weight: 600;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item-icon svg { width: 18px; height: 18px; }

.sidebar-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--gold);
  color: #0a0a0a;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 2px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-username {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-role {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sidebar-logout {
  margin-left: auto;
  color: var(--text-dim);
  transition: var(--transition);
}

.sidebar-logout:hover { color: var(--error); }
.sidebar-logout svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   5. Main Content Area
   -------------------------------------------------------------------------- */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* --------------------------------------------------------------------------
   6. Top Bar
   -------------------------------------------------------------------------- */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile sidebar toggle */
.topbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
}

.topbar-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 100px;
  transition: var(--transition);
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search in topbar */
.topbar-search {
  position: relative;
}

.topbar-search input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 36px 8px 14px;
  font-size: 0.85rem;
  width: 200px;
  outline: none;
  transition: var(--transition);
}

.topbar-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
  width: 260px;
}

.topbar-search input::placeholder { color: var(--text-dim); }

.topbar-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.topbar-icon-btn svg { width: 17px; height: 17px; }

.topbar-icon-btn:hover {
  color: var(--gold);
  border-color: var(--gold-border);
}

.topbar-notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: var(--error);
  border-radius: 50%;
  border: 1.5px solid var(--bg);
}

/* --------------------------------------------------------------------------
   7. Page Content
   -------------------------------------------------------------------------- */
.admin-content {
  flex: 1;
  padding: 28px 24px;
}

/* Breadcrumb */
.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.admin-breadcrumb a { color: var(--text-muted); transition: var(--transition); }
.admin-breadcrumb a:hover { color: var(--gold); }
.admin-breadcrumb-sep { color: var(--text-dim); }
.admin-breadcrumb-current { color: var(--text); }

/* Page Header */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.admin-page-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.admin-page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Stat Cards (Dashboard)
   -------------------------------------------------------------------------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card-change {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}

.stat-card-change.up   { background: var(--success-dim); color: var(--success); }
.stat-card-change.down { background: var(--error-dim);   color: var(--error);   }

.stat-card-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Decorative corner element */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: var(--gold-dim);
  border-radius: 50%;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   9. Admin Cards
   -------------------------------------------------------------------------- */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.admin-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.admin-card-body {
  padding: 20px;
}

.admin-card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   10. Data Tables
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table thead th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.admin-table thead th:hover { color: var(--gold); }
.admin-table thead th.sort-asc::after  { content: ' ↑'; color: var(--gold); }
.admin-table thead th.sort-desc::after { content: ' ↓'; color: var(--gold); }

.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

/* Striped rows */
.admin-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.015);
}

.admin-table tbody tr:hover {
  background: var(--gold-dim);
}

.admin-table tbody tr:last-child {
  border-bottom: none;
}

.admin-table td {
  padding: 13px 16px;
  color: var(--text-muted);
  vertical-align: middle;
}

.admin-table td strong {
  color: var(--text);
  font-weight: 600;
}

/* Table Image thumbnail */
.table-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.action-btn svg { width: 15px; height: 15px; }

.action-btn-edit {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

.action-btn-edit:hover {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: var(--gold-border);
}

.action-btn-delete {
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-color: var(--border);
}

.action-btn-delete:hover {
  background: var(--error-dim);
  color: var(--error);
  border-color: rgba(231, 76, 60, 0.3);
}

.action-btn-view {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

.action-btn-view:hover {
  background: var(--info-dim);
  color: var(--info);
  border-color: rgba(52, 152, 219, 0.3);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-active   { background: var(--success-dim); color: var(--success); }
.status-inactive { background: var(--error-dim);   color: var(--error);   }
.status-pending  { background: var(--warning-dim); color: var(--warning); }
.status-draft    { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-label .required {
  color: var(--error);
  margin-left: 3px;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
  background: var(--bg-card);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-dim);
}

.form-help {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.form-error {
  font-size: 0.78rem;
  color: var(--error);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select arrow */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   12. Toggle Switch
   -------------------------------------------------------------------------- */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-input {
  display: none;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-input:checked + .toggle-label .toggle-slider {
  background: var(--gold-dim);
  border-color: var(--gold-border);
}

.toggle-input:checked + .toggle-label .toggle-slider::before {
  background: var(--gold);
  transform: translateY(-50%) translateX(20px);
}

.toggle-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* --------------------------------------------------------------------------
   13. Image Upload Zone
   -------------------------------------------------------------------------- */
.upload-zone {
  border: 2px dashed var(--gold-border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--gold);
  opacity: 0.5;
  margin: 0 auto var(--space-2);
}

.upload-icon svg { width: 100%; height: 100%; }

.upload-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-subtitle span { color: var(--gold); font-weight: 600; }

/* Image Preview Grid */
.upload-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
  border: none;
}

.preview-item-remove:hover {
  background: var(--error);
}

/* --------------------------------------------------------------------------
   14. Buttons (Admin)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--gold);
  color: #0a0a0a;
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold-border);
}

.btn-outline:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--error-dim);
  color: var(--error);
  border-color: rgba(231,76,60,0.3);
}

.btn-danger:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 0.95rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   15. Alert / Flash Messages
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  position: relative;
  border-left: 3px solid transparent;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.alert.hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.alert-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-close {
  margin-left: auto;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  transition: var(--transition);
  padding: 2px;
  flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }
.alert-close svg { width: 16px; height: 16px; }

.alert-success {
  background: var(--success-dim);
  color: var(--success);
  border-left-color: var(--success);
}

.alert-error {
  background: var(--error-dim);
  color: var(--error);
  border-left-color: var(--error);
}

.alert-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-left-color: var(--warning);
}

.alert-info {
  background: var(--info-dim);
  color: var(--info);
  border-left-color: var(--info);
}

/* --------------------------------------------------------------------------
   16. Pagination
   -------------------------------------------------------------------------- */
.admin-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--gold-border);
  color: var(--gold);
}

.page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0a0a;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   17. Rich Text Toolbar
   -------------------------------------------------------------------------- */
.editor-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.editor-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.toolbar-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
}

.toolbar-btn:hover,
.toolbar-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold);
}

.toolbar-separator {
  width: 1px;
  height: 30px;
  background: var(--border);
  margin: 0 4px;
}

.editor-content {
  min-height: 200px;
  padding: 14px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.75;
  outline: none;
  caret-color: var(--gold);
}

.editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   18. Drag to Reorder (Sortable)
   -------------------------------------------------------------------------- */
.sortable-item {
  cursor: grab;
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sortable-item:active { cursor: grabbing; }

.sortable-item.dragging {
  opacity: 0.5;
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
  z-index: 10;
}

.drag-handle {
  color: var(--text-dim);
  cursor: grab;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drag-handle:hover { color: var(--text-muted); }
.drag-handle svg { width: 16px; height: 16px; }
.drag-handle:active { cursor: grabbing; }

/* Drop placeholder */
.sortable-placeholder {
  border: 2px dashed var(--gold-border);
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   19. Modal / Confirm Dialog
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--error-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
  margin: 0 auto 16px;
}

.modal-icon svg { width: 24px; height: 24px; }

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   20. Responsive Admin Layout
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Sidebar goes off-screen, shown via .sidebar-open on body */
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  /* Overlay for mobile sidebar */
  body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 250;
  }

  .admin-main {
    margin-left: 0;
  }

  .topbar-hamburger { display: flex; }
  .topbar-search input { width: 160px; }
  .topbar-search input:focus { width: 180px; }

  .stat-cards { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }

  .admin-page-header { flex-direction: column; }
  .admin-content { padding: 16px; }
  .modal { padding: 20px; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
}
