/* Admin dashboard styles */
.admin-page { min-height: 100vh; background: #F4F5F7; display: flex; flex-direction: column; }
.admin-topbar { background: var(--charcoal); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.admin-topbar-brand { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 900; color: #fff; text-decoration: none; }
.admin-topbar-brand span { color: var(--gold-light); }
.admin-topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-topbar-user { color: rgba(255,255,255,0.6); font-size: 13px; }
.admin-logout { background: rgba(255,255,255,0.1); border: none; border-radius: 8px; padding: 7px 14px; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Outfit', sans-serif; transition: all 0.2s; }
.admin-logout:hover { background: var(--red); }

.admin-layout { display: flex; padding-top: 60px; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #fff; border-right: 1px solid #E5E7EB; flex-shrink: 0; padding: 24px 0; position: fixed; top: 60px; bottom: 0; overflow-y: auto; }
.admin-nav-item { display: flex; align-items: center; gap: 11px; padding: 12px 20px; font-size: 14px; font-weight: 600; color: #6B7280; text-decoration: none; transition: all 0.2s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: 'Outfit', sans-serif; }
.admin-nav-item:hover { color: var(--red); background: rgba(200,23,26,0.04); }
.admin-nav-item.active { color: var(--red); background: rgba(200,23,26,0.06); border-right: 3px solid var(--red); }
.admin-nav-icon { font-size: 18px; width: 22px; text-align: center; }
.admin-nav-divider { height: 1px; background: #E5E7EB; margin: 12px 16px; }

.admin-main { margin-left: 220px; flex: 1; padding: 28px 32px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 24px; }

/* Stats cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 16px; padding: 22px; border: 1px solid #E5E7EB; transition: all 0.2s; }
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.stat-card-label { font-size: 12px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-card-val { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 900; color: var(--text); line-height: 1; }
.stat-card-sub { font-size: 12px; color: #6B7280; margin-top: 6px; }
.stat-card-icon { font-size: 28px; margin-bottom: 10px; }

/* Orders table */
.orders-table-wrap { background: #fff; border-radius: 16px; border: 1px solid #E5E7EB; overflow: hidden; }
.orders-table-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #E5E7EB; flex-wrap: wrap; gap: 12px; }
.orders-table-title { font-weight: 700; font-size: 16px; color: var(--text); }
.orders-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { background: #F4F5F7; border: 1px solid #E5E7EB; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'Outfit', sans-serif; color: #6B7280; transition: all 0.2s; }
.filter-btn.active, .filter-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.orders-search { border: 1.5px solid #E5E7EB; border-radius: 10px; padding: 8px 14px; font-size: 13px; outline: none; font-family: 'Outfit', sans-serif; width: 220px; }
.orders-search:focus { border-color: var(--red); }
table { width: 100%; border-collapse: collapse; }
th { background: #F9FAFB; padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #E5E7EB; }
td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid #F4F5F7; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFA; }
.td-id { color: #9CA3AF; font-family: monospace; font-size: 11px; }
.td-name { font-weight: 600; color: var(--text); }
.td-total { font-family: 'Playfair Display', serif; font-weight: 900; color: var(--red); font-size: 16px; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.action-btn { border: none; border-radius: 7px; padding: 5px 10px; font-size: 11px; font-weight: 700; cursor: pointer; font-family: 'Outfit', sans-serif; transition: all 0.15s; }
.action-view { background: #EFF6FF; color: #2563EB; }
.action-view:hover { background: #2563EB; color: #fff; }
.action-confirm { background: rgba(26,122,58,0.1); color: var(--green); }
.action-confirm:hover { background: var(--green); color: #fff; }
.action-cancel { background: rgba(200,23,26,0.08); color: var(--red); }
.action-cancel:hover { background: var(--red); color: #fff; }

/* Order detail modal */
.order-detail-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 3000; align-items: center; justify-content: center; padding: 20px; }
.order-detail-overlay.open { display: flex; }
.order-detail-modal { background: #fff; border-radius: 20px; padding: 32px; max-width: 580px; width: 100%; max-height: 85vh; overflow-y: auto; position: relative; }
.order-detail-close { position: absolute; top: 14px; right: 14px; background: #F4F5F7; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.order-detail-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 800; margin-bottom: 20px; }
.order-detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #F4F5F7; font-size: 14px; }
.order-detail-row:last-child { border-bottom: none; }
.order-detail-label { color: #6B7280; }
.order-detail-val { font-weight: 600; color: var(--text); text-align: right; max-width: 60%; }
.status-select { border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-family: 'Outfit', sans-serif; outline: none; cursor: pointer; }
.status-select:focus { border-color: var(--red); }
.order-items-list { background: #F9FAFB; border-radius: 12px; padding: 14px; margin: 14px 0; }
.order-item-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.update-status-btn { background: var(--red); color: #fff; border: none; border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: 'Outfit', sans-serif; width: 100%; margin-top: 12px; transition: all 0.2s; }
.update-status-btn:hover { background: var(--red-deep); }

/* Empty & loading */
.admin-empty { text-align: center; padding: 60px 20px; color: #9CA3AF; }
.admin-empty-icon { font-size: 48px; margin-bottom: 12px; }
.admin-loading { text-align: center; padding: 40px; color: #9CA3AF; font-size: 14px; }
.loading-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #E5E7EB; border-top-color: var(--red); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Access denied */
.admin-access-denied { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.admin-access-denied h2 { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 800; color: var(--red); margin-bottom: 10px; }

@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  td, th { padding: 10px 10px; }
}
