/* Tanishq AI Central Management Platform — Luxury Dark Maroon, Obsidian & Champagne Gold Theme */

:root {
  --bg-obsidian: #0f080a;
  --bg-maroon: #24090f;
  --bg-card: #1a0b0f;
  --bg-card-alt: #220e14;
  --border-gold: rgba(212, 175, 95, 0.28);
  --gold: #d4af5f;
  --gold-bright: #f2d591;
  --text-ivory: #f8f1e5;
  --text-muted: #b7a39e;
  --success: #3fb97a;
  --danger: #e05260;
  --warn: #e5a93c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top right, #3a0d18 0%, var(--bg-obsidian) 58%);
  color: var(--text-ivory);
  min-height: 100vh;
}

/* Login & Public Share Pages */
.login-body, .share-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card, .share-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, #270b12 0%, #14070a 100%);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.login-brand, .share-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-emblem {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 22px;
  color: var(--gold-bright);
  background: rgba(212, 175, 95, 0.08);
}

.login-brand h1, .share-header h1 {
  margin: 0;
  font-family: Georgia, serif;
  letter-spacing: 0.16em;
  font-size: 24px;
  color: var(--gold-bright);
}

.login-brand p, .share-header p {
  margin: 6px 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.domain-badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  color: var(--gold);
}

.login-form, .stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label, .stack-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

input, select {
  background: rgba(15, 6, 9, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--text-ivory);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

input[type="checkbox"] { width: auto; accent-color: var(--gold); }
input[type="color"] { height: 40px; padding: 4px; }

.btn-gold {
  background: linear-gradient(135deg, #c69a47, #ebd08c);
  color: #1c090d;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-gold:hover { filter: brightness(1.06); }

.btn-outline {
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.btn-outline:hover { background: rgba(212, 175, 95, 0.1); }

.btn-danger {
  background: rgba(224, 82, 96, 0.16);
  color: #ff8e99;
  border: 1px solid rgba(224, 82, 96, 0.45);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }

.alert-error {
  background: rgba(224, 82, 96, 0.16);
  border: 1px solid rgba(224, 82, 96, 0.5);
  color: #ffb1b8;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* Dashboard Layout */
.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #1d070d 0%, #100508 100%);
  border-right: 1px solid var(--border-gold);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-gold);
}
.sidebar-brand .brand-emblem { margin: 0; width: 40px; height: 40px; font-size: 18px; }
.brand-title { font-family: Georgia, serif; letter-spacing: 0.12em; color: var(--gold-bright); font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(212, 175, 95, 0.08); color: var(--text-ivory); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 95, 0.22), rgba(212, 175, 95, 0.05));
  border-left: 3px solid var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
}

.sidebar-footer { border-top: 1px solid var(--border-gold); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.admin-pill { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.role-badge {
  background: rgba(212, 175, 95, 0.15);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
}

.main-content { padding: 24px 28px; overflow-x: hidden; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-gold);
  gap: 12px;
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-family: Georgia, serif; color: var(--gold-bright); }
.topbar-sub { font-size: 12px; color: var(--text-muted); }
.topbar-actions { display: flex; gap: 10px; }

.panel-section { display: none; }
.panel-section.active { display: block; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 16px;
}
.kpi-label { font-size: 12px; color: var(--text-muted); }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--gold-bright); margin-top: 6px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; color: var(--gold-bright); }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.check-inline { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text-ivory) !important; }
.divider { border: 0; border-top: 1px solid var(--border-gold); margin: 8px 0; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(212, 175, 95, 0.14);
  text-align: left;
  vertical-align: middle;
}
.data-table th { color: var(--gold); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.pill-ok { background: rgba(63, 185, 122, 0.16); color: var(--success); border: 1px solid rgba(63, 185, 122, 0.4); }
.pill-off { background: rgba(229, 169, 60, 0.16); color: var(--warn); border: 1px solid rgba(229, 169, 60, 0.4); }
.pill-bad { background: rgba(224, 82, 96, 0.16); color: var(--danger); border: 1px solid rgba(224, 82, 96, 0.4); }

.swatch-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-gold); vertical-align: middle; }
.thumb-mini { width: 64px; height: 84px; object-fit: cover; object-position: top center; border-radius: 8px; border: 1px solid var(--border-gold); background: #0c0406; cursor: pointer; }
.active-view { background: rgba(212, 175, 95, 0.22) !important; border-color: var(--gold) !important; color: var(--gold-bright) !important; }

/* Template Lookbook Visual Gallery */
.template-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}
.template-card {
  background: linear-gradient(170deg, var(--bg-card-alt) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.template-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.template-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0c0406;
  overflow: hidden;
  cursor: pointer;
}
.template-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.25s ease;
}
.template-card-media:hover img { transform: scale(1.03); }
.template-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}
.template-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.badge-occ {
  background: rgba(15, 6, 9, 0.82);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.template-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.template-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-ivory);
}
.template-card-sub {
  font-size: 12px;
  color: var(--gold);
}
.template-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.template-swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.template-swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-ivory);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 95, 0.22);
  border-radius: 999px;
  padding: 2px 8px 2px 4px;
}
.template-swatch-chip i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.template-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(212, 175, 95, 0.14);
}

/* Upload live image preview */
.upload-preview-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--border-gold);
  background: rgba(12, 4, 6, 0.65);
}
.upload-preview-box img {
  width: 84px;
  height: 112px;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
}

/* Full-size Template Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 3, 5, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-content {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  background: linear-gradient(165deg, #250b12 0%, #120609 100%);
  border: 1px solid var(--gold);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}
.lightbox-head, .lightbox-foot {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-gold);
}
.lightbox-foot { border-bottom: none; border-top: 1px solid var(--border-gold); justify-content: flex-end; }
.lightbox-body {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #0a0305;
}
.lightbox-body img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gallery-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gallery-pair img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-gold); background: #0c0406; }

.activation-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(63, 185, 122, 0.14);
  border: 1px solid rgba(63, 185, 122, 0.45);
  color: #b7f5d2;
  font-size: 14px;
}

.toast {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: rgba(212, 175, 95, 0.16);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 13px;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 13px; }
.code-box { background: #0b0406; padding: 14px; border-radius: 8px; overflow: auto; max-height: 360px; font-size: 12px; color: #e8d9be; }

.share-frame { margin: 16px 0; text-align: center; }
.share-portrait { width: 100%; border-radius: 12px; border: 1px solid var(--border-gold); }
.share-expiry { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 12px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border-gold); }
}
