/* Atelier™ Admin Panel Styles — extends atelier.css */

:root {
  --admin-sidebar: #16110D;
  --admin-sidebar-hover: #221A14;
  --admin-sidebar-active: #2C2018;
  --admin-sidebar-border: rgba(255,255,255,0.07);
  --admin-sidebar-text: rgba(245,237,214,0.65);
  --admin-sidebar-active-text: #C9A84C;
  --admin-topbar: #fff;
  --admin-body: #F7F5F1;
}

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

body.admin-body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--admin-body);
  color: var(--charcoal, #1A1410);
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.admin-sidebar {
  width: 230px;
  min-height: 100vh;
  background: var(--admin-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  flex-shrink: 0;
}

.admin-logo {
  padding: 1.6rem 1.4rem 1.2rem;
  border-bottom: 1px solid var(--admin-sidebar-border);
}
.admin-logo-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #F5EDD6;
}
.admin-logo-name span { color: #C9A84C; }
.admin-logo-badge {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.6);
  margin-top: 0.15rem;
}

.admin-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.admin-nav-section {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 1rem 1.4rem 0.4rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.4rem;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 400;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}
.admin-nav a:hover {
  background: var(--admin-sidebar-hover);
  color: #F5EDD6;
}
.admin-nav a.active {
  background: var(--admin-sidebar-active);
  color: var(--admin-sidebar-active-text);
  border-left-color: #C9A84C;
  font-weight: 500;
}
.admin-nav a svg { flex-shrink: 0; opacity: 0.7; }
.admin-nav a.active svg { opacity: 1; }

.admin-nav-footer {
  padding: 1rem;
  border-top: 1px solid var(--admin-sidebar-border);
}
.admin-nav-footer a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: rgba(245,237,214,0.4);
  font-size: 0.78rem;
  text-decoration: none;
  padding: 0.5rem 0.4rem;
  transition: color 0.2s;
}
.admin-nav-footer a:hover { color: #F5EDD6; }

/* ── MAIN CONTENT ── */
.admin-main {
  margin-left: 230px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--admin-topbar);
  border-bottom: 1px solid #E8E2D9;
  padding: 0 2rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1A1410;
}
.admin-topbar-meta {
  font-size: 0.75rem;
  color: #8A7D70;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.admin-topbar-meta a {
  color: #8B6914;
  text-decoration: none;
  font-weight: 500;
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

/* ── STAT CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #E8E2D9;
  border-radius: 4px;
  padding: 1.4rem 1.5rem;
}
.stat-card-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8A7D70;
  margin-bottom: 0.5rem;
}
.stat-card-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: #1A1410;
  line-height: 1;
}
.stat-card-sub {
  font-size: 0.72rem;
  color: #8A7D70;
  margin-top: 0.3rem;
}
.stat-card.highlight { border-top: 2px solid #8B6914; }
.stat-card.warn      { border-top: 2px solid #D97706; }
.stat-card.success   { border-top: 2px solid #15803D; }
.stat-card.muted     { border-top: 2px solid #CBD5E1; }

/* ── LIMIT BAR ── */
.limit-bar-wrap { margin-top: 0.5rem; }
.limit-bar-track {
  height: 4px;
  background: #F0EBE0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.limit-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: #8B6914;
  transition: width 0.4s;
}
.limit-bar-fill.warn  { background: #D97706; }
.limit-bar-fill.danger{ background: #DC2626; }

/* ── ADMIN TABLE ── */
.admin-table-wrap {
  background: #fff;
  border: 1px solid #E8E2D9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.admin-table-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid #F0EBE0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-table-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A1410;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8A7D70;
  background: #FAF8F3;
  border-bottom: 1px solid #E8E2D9;
  font-weight: 500;
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F5F0E8;
  vertical-align: middle;
  color: #1A1410;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FEFCF8; }

.admin-table .design-thumb {
  width: 38px;
  height: 50px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #E8E2D9;
  background: #F0EBE0;
  display: block;
}
.admin-table .thumb-placeholder {
  width: 38px;
  height: 50px;
  background: #F0EBE0;
  border-radius: 2px;
  border: 1px solid #E8E2D9;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SETTINGS FORM ── */
.settings-section {
  background: #fff;
  border: 1px solid #E8E2D9;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.settings-section-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid #F0EBE0;
  background: #FAF8F3;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.settings-section-header h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1A1410;
}
.settings-section-header p {
  font-size: 0.75rem;
  color: #8A7D70;
  margin-top: 0.1rem;
}
.settings-body { padding: 1.4rem; }

.field-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem 2rem;
  align-items: start;
  padding: 0.8rem 0;
  border-bottom: 1px solid #F5F0E8;
}
.field-row:last-child { border-bottom: none; }
.field-row-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #1A1410;
  padding-top: 0.55rem;
}
.field-row-hint {
  font-size: 0.7rem;
  color: #8A7D70;
  margin-top: 0.15rem;
  font-weight: 400;
}
.field-row-control { }

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #DDD5C8;
  border-radius: 3px;
  background: #FAF8F3;
  color: #1A1410;
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.2s;
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  border-color: #8B6914;
  background: #fff;
}
.admin-textarea { min-height: 70px; resize: vertical; }
.admin-select { cursor: pointer; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #DDD5C8;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: #8B6914; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-label { font-size: 0.82rem; color: #1A1410; }

/* ── ADMIN ALERTS ── */
.admin-alert {
  padding: 0.8rem 1.2rem;
  border-radius: 3px;
  font-size: 0.82rem;
  margin-bottom: 1.2rem;
  border: 1px solid transparent;
}
.admin-alert-success { background: #E6F4EA; border-color: #86EFAC; color: #14532D; }
.admin-alert-error   { background: #FEF2F2; border-color: #FCA5A5; color: #7F1D1D; }
.admin-alert-info    { background: #F5EDD6; border-color: #C9A84C; color: #6B4C10; }

/* ── BUTTONS in admin ── */
.btn-admin-primary {
  background: #8B6914;
  color: #FAF8F3;
  border: 1px solid #8B6914;
  padding: 0.6rem 1.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-admin-primary:hover { background: #7A5C10; }

.btn-admin-outline {
  background: transparent;
  color: #1A1410;
  border: 1px solid #DDD5C8;
  padding: 0.6rem 1.2rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-admin-outline:hover { border-color: #8B6914; }

.btn-admin-danger {
  background: transparent;
  color: #9B1C1C;
  border: 1px solid #FCA5A5;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.btn-admin-danger:hover { background: #FEF2F2; }

.btn-admin-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.7rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-sidebar { width: 100%; min-height: auto; position: relative; flex-direction: row; }
  .admin-main    { margin-left: 0; }
  .field-row     { grid-template-columns: 1fr; gap: 0.4rem; }
}
