/* ═══════════════════════════════════════════════════════════════════
   Square Pictures — Studio Backoffice Master Stylesheet
   admin/assets/css/admin.css
   Warm Cream & Amber Gold Luxury Palette (Matches main website style.css)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Warm Cream Wall Palette — Exactly from style.css */
  --ink:         #F5EFE0;   /* page / outer background — warm cream wall */
  --ink-light:   #EDE7D4;   /* card / section background — parchment */
  --ink-lighter: #E4DBBF;   /* hover background — tan */

  --gold:        #8A6200;   /* primary accent — deep amber gold */
  --gold-bright: #B8860B;   /* brighter accent */
  --gold-dark:   #6B4C00;   /* deeper accent */
  --gold-deep:   #4E3700;   /* darkest accent */

  --cream:       #2A1F0F;   /* primary text — dark ink */
  --cream-muted: rgba(42, 31, 15, 0.68);  /* secondary text */
  --cream-faint: rgba(42, 31, 15, 0.08);

  --gold-glow:   rgba(138, 98, 0, 0.18);
  --gold-faint:  rgba(138, 98, 0, 0.08);
  --border:      rgba(138, 98, 0, 0.22);
  --border-hi:   rgba(138, 98, 0, 0.45);

  /* Bootstrap 5 Overrides */
  --bs-body-bg: #F5EFE0;
  --bs-body-color: #2A1F0F;
  --bs-border-color: rgba(138, 98, 0, 0.22);

  /* Status Colors */
  --status-green: #15803D;
  --status-green-bg: rgba(21, 128, 61, 0.12);
  --status-amber: #B45309;
  --status-amber-bg: rgba(180, 83, 9, 0.12);
  --status-blue: #0369A1;
  --status-blue-bg: rgba(3, 105, 161, 0.12);
  --status-purple: #7E22CE;
  --status-purple-bg: rgba(126, 34, 206, 0.12);
  --status-red: #B91C1C;
  --status-red-bg: rgba(185, 28, 28, 0.12);

  --fh: 'Cinzel', serif;
  --fs: 'Cormorant Garamond', Georgia, serif;
  --fb: 'Inter', sans-serif;
}

body {
  background-color: var(--ink) !important;
  color: var(--cream) !important;
  font-family: var(--fb);
  font-size: 14px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--fh);
  color: var(--cream);
  letter-spacing: 0.5px;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--gold-dark);
}

/* ── Luxury Gold & Outline Buttons ──────────────────────── */
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  color: #FFF !important;
  font-weight: 600;
  border: none !important;
  border-radius: 4px;
  padding: 8px 18px;
  transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(138, 98, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold)) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(138, 98, 0, 0.35);
  color: #FFF !important;
}

.btn-outline-gold {
  background: var(--ink-light) !important;
  color: var(--gold-dark) !important;
  border: 1px solid var(--border-hi) !important;
  border-radius: 4px;
  padding: 7px 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline-gold:hover {
  background: var(--gold) !important;
  color: #FFF !important;
  border-color: var(--gold) !important;
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--ink);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  transition: all 0.2s;
}

.btn-icon-sm:hover {
  background: var(--gold);
  color: #FFF;
  border-color: var(--gold);
}

/* ── Sidebar (Parchment Texture) ────────────────────────── */
.admin-sidebar {
  width: 260px;
  background: var(--ink-light);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1020;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 16px rgba(42, 31, 15, 0.04);
}

.admin-main {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 90% 10%, rgba(138, 98, 0, 0.04) 0%, transparent 60%), var(--ink);
}

.sidebar-brand {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink-light);
}

.brand-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fh);
  font-weight: 700;
  font-size: 18px;
  color: #FFF;
  box-shadow: 0 2px 8px rgba(138, 98, 0, 0.25);
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cream-muted);
  padding: 16px 20px 6px;
  font-weight: 600;
}

.sidebar-nav a.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--cream-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a.nav-link:hover {
  background: var(--ink-lighter);
  color: var(--cream);
}

.sidebar-nav a.nav-link.active {
  background: rgba(138, 98, 0, 0.12);
  color: var(--gold-dark);
  font-weight: 600;
  border-left-color: var(--gold);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: var(--ink-light);
}

/* ── Top Header Bar ─────────────────────────────────────── */
.admin-header {
  height: 68px;
  background: rgba(237, 231, 212, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1010;
}

/* ── Cards (Parchment Surfaces) ─────────────────────────── */
.card {
  background-color: var(--ink-light) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--cream) !important;
  box-shadow: 0 2px 12px rgba(42, 31, 15, 0.04);
}

.card-header {
  background-color: var(--ink-lighter) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--cream) !important;
  font-weight: 600;
}

.card-footer {
  background-color: var(--ink-lighter) !important;
  border-top: 1px solid var(--border) !important;
}

/* ── Form Controls (Crisp, High Legibility) ──────────────── */
.form-control, .form-select {
  background-color: #FDFCFA !important;
  border: 1px solid var(--border-hi) !important;
  color: var(--cream) !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  padding: 8px 12px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(138, 98, 0, 0.18) !important;
  background-color: #FFF !important;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cream-muted);
  margin-bottom: 5px;
}

.input-group-text {
  background-color: var(--ink-lighter) !important;
  border-color: var(--border-hi) !important;
  color: var(--cream-muted) !important;
}

/* ── Tables & DataTables Styling ────────────────────────── */
.table {
  color: var(--cream) !important;
  border-color: var(--border) !important;
  margin-bottom: 0 !important;
}

.table th {
  background-color: var(--ink-lighter) !important;
  color: var(--cream) !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-hi) !important;
  padding: 12px 16px !important;
}

.table td {
  background-color: transparent !important;
  border-bottom: 1px solid rgba(138, 98, 0, 0.12) !important;
  padding: 13px 16px !important;
  vertical-align: middle !important;
  color: var(--cream) !important;
}

.table-hover tbody tr:hover td {
  background-color: rgba(138, 98, 0, 0.05) !important;
}

/* DataTables Specific Customization (Supports both DT 1.x and DT 2.x) */
div.dataTables_wrapper div.dataTables_length select,
div.dt-container div.dt-length select {
  width: auto;
  display: inline-block;
  background-color: #FDFCFA !important;
  border: 1px solid var(--border-hi) !important;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--cream) !important;
}

div.dataTables_wrapper div.dataTables_filter input,
div.dt-container div.dt-search input {
  background-color: #FDFCFA !important;
  border: 1px solid var(--border-hi) !important;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  margin-left: 8px;
  color: var(--cream) !important;
}

div.dataTables_wrapper div.dataTables_filter input:focus,
div.dt-container div.dt-search input:focus {
  border-color: var(--gold) !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(138, 98, 0, 0.18);
}

.dt-container .row:first-child,
div.dataTables_wrapper .row:first-child {
  margin-bottom: 14px;
  align-items: center;
}

.dt-container .row:last-child,
div.dataTables_wrapper .row:last-child {
  margin-top: 14px;
  align-items: center;
}

.page-item.active .page-link {
  background-color: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #FFF !important;
}

.page-link {
  background-color: var(--ink-light) !important;
  border-color: var(--border) !important;
  color: var(--cream) !important;
  font-size: 12px;
}

.page-link:hover {
  background-color: var(--ink-lighter) !important;
  color: var(--gold-dark) !important;
}

div.dataTables_wrapper div.dataTables_info,
div.dt-container div.dt-info {
  color: var(--cream-muted) !important;
  font-size: 12px;
  padding-top: 12px;
}

div.dataTables_wrapper div.dataTables_paginate,
div.dt-container div.dt-paging {
  padding-top: 8px;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge-status {
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status.new { background: var(--status-blue-bg); color: var(--status-blue); }
.badge-status.contacted { background: var(--status-amber-bg); color: var(--status-amber); }
.badge-status.quote_sent, .badge-status.sent { background: var(--status-purple-bg); color: var(--status-purple); }
.badge-status.booked, .badge-status.honoured { background: var(--status-green-bg); color: var(--status-green); }
.badge-status.completed { background: rgba(138, 98, 0, 0.14); color: var(--gold-dark); }
.badge-status.lost, .badge-status.expired { background: var(--status-red-bg); color: var(--status-red); }

/* ── Modals (Parchment Styled) ─────────────────────────── */
.modal-content {
  background-color: var(--ink-light) !important;
  border: 1px solid var(--border-hi) !important;
  color: var(--cream) !important;
  border-radius: 8px !important;
  box-shadow: 0 16px 40px rgba(42, 31, 15, 0.2) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
  background-color: var(--ink-lighter);
}

.modal-footer {
  border-top: 1px solid var(--border) !important;
  background-color: var(--ink-lighter);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-header {
    padding: 0 16px;
  }
}
