/* ==========================================================================
   THINK WILD MOBILES - LUXURY ADMIN DASHBOARD STYLES
   ========================================================================== */

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

:root {
  --admin-bg: #090807;
  --admin-sidebar-bg: #0e0c09;
  --admin-header-bg: rgba(14, 12, 9, 0.96);
  --admin-card-bg: #14120e;
  --admin-card-hover: #1b1813;
  --admin-input-bg: #0c0a08;
  
  --gold-primary: #d4af37;
  --gold-light: #f5cf6d;
  --gold-dark: #8c6d17;
  --gold-border: rgba(212, 175, 55, 0.25);
  --gold-border-bright: rgba(212, 175, 55, 0.6);
  --gold-btn-gradient: linear-gradient(90deg, #d4af37 0%, #e8bc4a 50%, #c49925 100%);
  --gold-btn-hover: linear-gradient(90deg, #f0cc66 0%, #fbd062 50%, #dcae32 100%);

  --text-main: #f5f2eb;
  --text-muted: #9e9687;
  --text-dim: #6e675a;
  
  --color-green: #22c55e;
  --color-blue: #38bdf8;
  --color-amber: #f59e0b;
  --color-red: #ef4444;

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--admin-bg);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse at 80% 0%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(180, 130, 20, 0.04) 0%, transparent 40%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  transition: var(--transition);
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo {
  max-height: 52px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.4));
}

.sidebar-admin-badge {
  padding: 14px 20px;
  background: rgba(212, 175, 55, 0.06);
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold-primary);
  background: #191612;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 14px;
}
.admin-info strong {
  display: block;
  font-size: 13px;
  color: #fff;
}
.admin-info span {
  font-size: 11px;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  display: inline-block;
  box-shadow: 0 0 6px var(--color-green);
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.menu-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.menu-item a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}
.menu-item a:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #fff;
  transform: translateX(4px);
}
.menu-item.active a {
  background: var(--gold-btn-gradient);
  color: #100d07;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}
.menu-badge {
  margin-left: auto;
  background: #1f1b14;
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}
.menu-item.active .menu-badge {
  background: #100d07;
  color: #f5cf6d;
  border-color: #100d07;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.btn-storefront-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #191612;
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  padding: 11px 0;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-storefront-link:hover {
  background: #242017;
  border-color: var(--gold-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

/* ==========================================================================
   MAIN CONTENT WRAPPER
   ========================================================================== */
.admin-main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navbar */
.admin-topbar {
  height: var(--header-height);
  background: var(--admin-header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-border);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-page-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-search-box {
  display: flex;
  align-items: center;
  background: var(--admin-input-bg);
  border: 1px solid var(--gold-border);
  border-radius: 30px;
  padding: 7px 16px;
  width: 250px;
}
.admin-search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
}
.admin-search-box input::placeholder {
  color: #777;
}

.btn-quick-add {
  background: var(--gold-btn-gradient);
  color: #120e06;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-quick-add:hover {
  background: var(--gold-btn-hover);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}

/* Content Area */
.admin-content {
  padding: 30px;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: adminFade 0.25s ease-out;
}
.tab-pane.active-tab {
  display: block;
}
@keyframes adminFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   KPI METRICS GRID
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.metric-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.metric-card:hover {
  background: var(--admin-card-hover);
  border-color: var(--gold-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-btn-gradient);
  opacity: 0.7;
}
.metric-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.metric-growth {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-green);
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  flex-shrink: 0;
}
.metric-icon-box svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ==========================================================================
   CHARTS & SPLIT SECTIONS
   ========================================================================== */
.admin-split-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}
.admin-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Brand Performance Bars */
.brand-perf-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.brand-perf-label {
  width: 100px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.brand-perf-bar-bg {
  flex: 1;
  height: 8px;
  background: #1a1712;
  border-radius: 4px;
  overflow: hidden;
}
.brand-perf-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gold-btn-gradient);
}
.brand-perf-value {
  width: 60px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-light);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.admin-table th {
  padding: 12px 16px;
  background: #100e0b;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gold-border);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  color: #ddd;
}
.admin-table tr:hover td {
  background: rgba(212, 175, 55, 0.04);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.status-badge.badge-placed {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-badge.badge-packed {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.status-badge.badge-shipped {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.status-badge.badge-delivered {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.table-actions {
  display: flex;
  gap: 8px;
}
.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #1c1813;
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-action-icon:hover {
  background: var(--gold-btn-gradient);
  color: #120e06;
  border-color: var(--gold-primary);
}
.btn-action-icon.btn-delete:hover {
  background: var(--color-red);
  border-color: var(--color-red);
  color: #fff;
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-dialog {
  background: var(--admin-card-bg);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.25);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.btn-close-modal {
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
}
.btn-close-modal:hover {
  color: #fff;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-form-group {
  margin-bottom: 16px;
}
.admin-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.admin-form-control {
  width: 100%;
  background: var(--admin-input-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  transition: var(--transition);
}
.admin-form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   TOAST
   ========================================================================== */
.admin-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #1b1712;
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   ADMIN AUTHENTICATION / LOCKSCREEN OVERLAY
   ========================================================================== */
.admin-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 30%, #1a1610 0%, #080706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.admin-auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-auth-card {
  width: 100%;
  max-width: 440px;
  background: #14110b;
  border: 1.5px solid var(--gold-primary);
  border-radius: 18px;
  padding: 38px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(212, 175, 55, 0.3);
  text-align: center;
  animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes authCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.admin-auth-card.shake {
  animation: authShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes authShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.admin-auth-brand {
  margin-bottom: 26px;
}

.admin-auth-brand .auth-logo {
  height: 65px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 14px rgba(212, 175, 55, 0.4));
}

.admin-auth-brand .auth-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.admin-auth-brand .auth-subtitle {
  font-size: 12px;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.8px;
}

.admin-auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.admin-auth-error svg {
  width: 18px;
  height: 18px;
  fill: #ef4444;
  flex-shrink: 0;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: var(--text-dim);
  pointer-events: none;
  transition: fill 0.2s;
}

.auth-input {
  width: 100%;
  padding-left: 42px !important;
  padding-right: 44px !important;
  height: 44px;
  font-size: 14px;
}

.auth-input:focus ~ .auth-input-icon {
  fill: var(--gold-primary);
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.btn-toggle-eye svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: fill 0.2s;
}

.btn-toggle-eye:hover svg {
  fill: var(--gold-primary);
}

.btn-auth-submit {
  width: 100%;
  height: 46px;
  background: var(--gold-btn-gradient);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  color: #0c0a07;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  transition: all 0.25s ease;
}

.btn-auth-submit:hover {
  background: var(--gold-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.auth-hint-box {
  margin-top: 22px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-hint-box code {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.auth-return-link {
  margin-top: 18px;
  font-size: 12px;
}

.auth-return-link a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-return-link a:hover {
  color: var(--gold-light);
}

/* Topbar & Sidebar Logout Buttons */
.btn-admin-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-logout svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.btn-admin-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px;
  margin-top: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-split-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main-wrapper {
    margin-left: 0;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
