/* ============================================================
   DMAdmin.css — Admin Panel Styles
   Premium dark admin interface
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --adm-bg:        #070710;
  --adm-sidebar:   #0e0e1c;
  --adm-surface:   #13131f;
  --adm-card:      #1a1a2a;
  --adm-border:    rgba(255,255,255,0.07);
  --adm-accent:    #7c3aed;
  --adm-accent-2:  #a855f7;
  --adm-accent-3:  #3b82f6;
  --adm-text:      #e8e8f8;
  --adm-text-2:    #9090b0;
  --adm-text-3:    #555575;
  --adm-success:   #10b981;
  --adm-warning:   #f59e0b;
  --adm-danger:    #ef4444;
  --adm-info:      #3b82f6;
  --adm-grad:      linear-gradient(135deg,#7c3aed,#3b82f6);
  --adm-sidebar-w: 260px;
  --adm-header-h:  64px;
  --adm-font:      'Outfit', system-ui, sans-serif;
  --adm-radius:    12px;
  --adm-radius-lg: 18px;
  --adm-ease:      cubic-bezier(0.25,0.46,0.45,0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--adm-font);
  background: var(--adm-bg);
  color: var(--adm-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────── */
.adm-layout { display: flex; min-height: 100vh; }

.adm-sidebar {
  width: var(--adm-sidebar-w);
  background: var(--adm-sidebar);
  border-right: 1px solid var(--adm-border);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s var(--adm-ease);
  overflow-y: auto;
}

.adm-content {
  flex: 1;
  margin-left: var(--adm-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.adm-main {
  flex: 1;
  padding: var(--adm-header-h) 0 0;
}

.adm-inner { padding: 32px; }

/* ── Sidebar Brand ───────────────────────────────────────── */
.adm-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.adm-brand__icon {
  width: 36px; height: 36px;
  background: var(--adm-grad);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.adm-brand__text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--adm-text);
  letter-spacing: -0.3px;
}
.adm-brand__sub {
  font-size: 0.7rem;
  color: var(--adm-text-3);
  font-weight: 500;
}

/* ── Sidebar Nav ─────────────────────────────────────────── */
.adm-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adm-nav__section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--adm-text-3);
  padding: 12px 8px 6px;
}

.adm-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--adm-radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--adm-text-2);
  text-decoration: none;
  transition: all 0.2s var(--adm-ease);
  position: relative;
}
.adm-nav__item:hover {
  background: rgba(124,58,237,0.08);
  color: var(--adm-text);
}
.adm-nav__item.active {
  background: rgba(124,58,237,0.15);
  color: var(--adm-accent-2);
}
.adm-nav__item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--adm-accent);
  border-radius: 0 2px 2px 0;
}
.adm-nav__icon { flex-shrink: 0; opacity: 0.7; }
.adm-nav__item.active .adm-nav__icon,
.adm-nav__item:hover .adm-nav__icon { opacity: 1; }

.adm-nav__badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--adm-accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 99px;
}

/* ── Sidebar Footer ──────────────────────────────────────── */
.adm-sidebar__footer {
  padding: 16px 12px;
  border-top: 1px solid var(--adm-border);
}

.adm-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--adm-radius);
  background: rgba(255,255,255,0.03);
}
.adm-user-avatar {
  width: 32px; height: 32px;
  background: var(--adm-grad);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.adm-user-name { font-size: 0.8rem; font-weight: 600; }
.adm-user-role { font-size: 0.7rem; color: var(--adm-text-3); }
.adm-logout-btn {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--adm-border);
  color: var(--adm-text-3);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--adm-font);
}
.adm-logout-btn:hover { border-color: var(--adm-danger); color: var(--adm-danger); }

/* ── Top Header ──────────────────────────────────────────── */
.adm-topbar {
  position: fixed;
  top: 0;
  left: var(--adm-sidebar-w);
  right: 0;
  height: var(--adm-header-h);
  background: var(--adm-surface);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  z-index: 50;
}
.adm-topbar__title {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
}
.adm-topbar__breadcrumb {
  font-size: 0.8rem;
  color: var(--adm-text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Cards ───────────────────────────────────────────────── */
.adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  overflow: hidden;
}

.adm-card__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.adm-card__title { font-size: 0.925rem; font-weight: 700; }
.adm-card__body  { padding: 24px; }

/* ── Stat Cards ──────────────────────────────────────────── */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.adm-stat {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.adm-stat:hover { border-color: rgba(124,58,237,0.3); }
.adm-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--adm-grad);
}
.adm-stat__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: rgba(124,58,237,0.1);
}
.adm-stat__value { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; }
.adm-stat__label { font-size: 0.8rem; color: var(--adm-text-3); font-weight: 500; }

/* ── Forms ───────────────────────────────────────────────── */
.adm-form-group { margin-bottom: 20px; }
.adm-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--adm-text-2);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.adm-label .required { color: var(--adm-danger); margin-left: 2px; }

.adm-input, .adm-textarea, .adm-select {
  width: 100%;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: var(--adm-font);
  color: var(--adm-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.adm-input:focus, .adm-textarea:focus, .adm-select:focus {
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.adm-input::placeholder, .adm-textarea::placeholder { color: var(--adm-text-3); }
.adm-textarea { resize: vertical; min-height: 100px; }
.adm-select { cursor: pointer; }

/* Color Swatch Input */
.adm-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-color-preview {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid var(--adm-border);
  flex-shrink: 0;
}

/* Toggle / Switch */
.adm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--adm-border);
}
.adm-toggle-row:last-child { border-bottom: none; }
.adm-toggle-info { flex: 1; }
.adm-toggle-title { font-size: 0.875rem; font-weight: 600; }
.adm-toggle-desc  { font-size: 0.775rem; color: var(--adm-text-3); }

.adm-switch { position: relative; width: 44px; height: 24px; }
.adm-switch input { opacity: 0; width: 0; height: 0; }
.adm-switch-slider {
  position: absolute; inset: 0;
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
}
.adm-switch-slider::after {
  content: '';
  position: absolute;
  left: 3px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: var(--adm-text-3);
  border-radius: 50%;
  transition: 0.3s;
}
.adm-switch input:checked + .adm-switch-slider { background: rgba(124,58,237,0.2); border-color: var(--adm-accent); }
.adm-switch input:checked + .adm-switch-slider::after { left: calc(100% - 19px); background: var(--adm-accent); }

/* ── Buttons ─────────────────────────────────────────────── */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--adm-font);
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--adm-ease);
  text-decoration: none;
  white-space: nowrap;
}
.adm-btn-primary  { background: var(--adm-grad); color: #fff; box-shadow: 0 4px 16px rgba(124,58,237,0.3); }
.adm-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.4); }
.adm-btn-ghost    { background: transparent; color: var(--adm-text-2); border: 1px solid var(--adm-border); }
.adm-btn-ghost:hover { border-color: var(--adm-accent); color: var(--adm-accent-2); background: rgba(124,58,237,0.06); }
.adm-btn-danger   { background: rgba(239,68,68,0.1); color: var(--adm-danger); border: 1px solid rgba(239,68,68,0.2); }
.adm-btn-danger:hover { background: var(--adm-danger); color: #fff; }
.adm-btn-sm { padding: 7px 14px; font-size: 0.775rem; }
.adm-btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; }

/* ── Table ───────────────────────────────────────────────── */
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--adm-text-3);
  border-bottom: 1px solid var(--adm-border);
}
.adm-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.adm-table tr:hover td { background: rgba(124,58,237,0.04); }
.adm-table tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────── */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
}
.adm-badge-success { background: rgba(16,185,129,0.12); color: var(--adm-success); border: 1px solid rgba(16,185,129,0.2); }
.adm-badge-warning { background: rgba(245,158,11,0.12); color: var(--adm-warning); border: 1px solid rgba(245,158,11,0.2); }
.adm-badge-danger  { background: rgba(239,68,68,0.12);  color: var(--adm-danger);  border: 1px solid rgba(239,68,68,0.2); }
.adm-badge-info    { background: rgba(59,130,246,0.12); color: var(--adm-info);    border: 1px solid rgba(59,130,246,0.2); }
.adm-badge-purple  { background: rgba(124,58,237,0.12); color: var(--adm-accent-2);border: 1px solid rgba(124,58,237,0.2);}

/* ── Alert / Toast ───────────────────────────────────────── */
.adm-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  min-width: 280px;
  max-width: 400px;
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 9999;
  animation: admSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes admSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
.adm-toast-icon { flex-shrink: 0; }
.adm-toast-msg  { font-size: 0.875rem; }
.adm-toast.success { border-left: 3px solid var(--adm-success); }
.adm-toast.error   { border-left: 3px solid var(--adm-danger);  }
.adm-toast.warning { border-left: 3px solid var(--adm-warning); }

/* ── Upload Zone ─────────────────────────────────────────── */
.adm-dropzone {
  border: 2px dashed var(--adm-border);
  border-radius: var(--adm-radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(124,58,237,0.02);
}
.adm-dropzone:hover, .adm-dropzone.dragging {
  border-color: var(--adm-accent);
  background: rgba(124,58,237,0.05);
}
.adm-dropzone__icon { color: var(--adm-text-3); margin: 0 auto 12px; display: block; }
.adm-dropzone__title { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.adm-dropzone__sub   { font-size: 0.8rem; color: var(--adm-text-3); }

/* Upload progress item */
.adm-upload-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--adm-border);
  font-size: 0.85rem;
}
.adm-upload-item:last-child { border-bottom: none; }
.adm-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--adm-surface);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.adm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--adm-grad);
  border-radius: 3px;
  transition: width 0.2s ease;
}

/* ── Page Header ─────────────────────────────────────────── */
.adm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.adm-page-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.adm-page-subtitle { font-size: 0.85rem; color: var(--adm-text-3); margin-top: 2px; }

/* ── Grid ────────────────────────────────────────────────── */
.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.adm-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

@media (max-width: 1200px) { .adm-stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px) {
  .adm-sidebar  { transform: translateX(-100%); }
  .adm-sidebar.open { transform: translateX(0); }
  .adm-content  { margin-left: 0; }
  .adm-topbar   { left: 0; }
  .adm-grid-2   { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .adm-stats-grid { grid-template-columns: 1fr 1fr; }
  .adm-inner { padding: 16px; }
}
@media (max-width: 480px) { .adm-stats-grid { grid-template-columns: 1fr; } }

/* ── Login Page ──────────────────────────────────────────── */
.adm-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--adm-bg);
  position: relative;
  overflow: hidden;
}
.adm-login-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.adm-login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--adm-grad);
  border-radius: 24px 24px 0 0;
}

/* Scrollbar */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 3px; }
