/* ============================================================
   VANTS V2 — Admin Dashboard CSS
   Luxury Black & Gold Edition
   ============================================================ */

/* ── Admin Layout wrapper ── */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.admin-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 20%, rgba(245,158,11,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(245,158,11,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Login Card ── */
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 3rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(245,158,11,0.05);
  position: relative;
  z-index: 1;
}

/* Gold top line */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.5), transparent);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-badge {
  width: 60px; height: 60px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  margin: 0 auto 1rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.login-logo p {
  font-size: 0.84rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

.login-error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  color: #F87171;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.84rem;
  margin-bottom: 1.25rem;
  display: none;
}

.login-error.show { display: block; }

.login-card .form-group {
  margin-bottom: 1.25rem;
}

.login-card label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.5px;
}

.login-card input[type="password"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-1);
  transition: all 0.2s ease;
  outline: none;
}

.login-card input[type="password"]:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.1);
}

/* ── Admin page (dashboard) ── */
.admin-page {
  display: none;
  min-height: 100vh;
  background: var(--bg);
}

.admin-page.active {
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.admin-layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--text-3);
  display: block;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--text-3);
  padding: 0 0.75rem;
  margin: 1rem 0 0.4rem;
}

.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.sidebar-link:hover {
  background: rgba(245,158,11,0.05);
  color: var(--text-1);
}

.sidebar-link.active {
  background: rgba(245,158,11,0.08);
  color: var(--gold-400);
}

.link-icon { font-size: 1rem; flex-shrink: 0; }

.link-badge {
  margin-left: auto;
  background: rgba(245,158,11,0.15);
  color: var(--gold-400);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 980px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--gradient-gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-1);
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-3);
}

.logout-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: color 0.2s;
}

.logout-btn:hover { color: #F87171; }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-2);
}

/* ── Main content ── */
.admin-main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
}

.topbar-subtitle {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 0.1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--gold-500);
  color: var(--gold-400);
}

/* ── Content ── */
.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-gold);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
  border-color: rgba(245,158,11,0.2);
  box-shadow: var(--shadow-gold);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-label-small {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-3);
}

.stat-icon-badge {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-change {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
}

.stat-change.up { color: #4ADE80; }
.stat-change.neutral { color: var(--text-3); }

/* ── Main panel ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}

.panel-subtitle, .panel-count {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 0.1rem;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input-wrap input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem 0.5rem 2.25rem;
  font-size: 0.84rem;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.2s ease;
  width: 200px;
}

.search-input-wrap input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.08);
}

.filter-select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filter-select:focus { border-color: var(--gold-500); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-3);
  white-space: nowrap;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-2);
  vertical-align: middle;
}

tr:hover td { background: rgba(245,158,11,0.02); }
tr:last-child td { border-bottom: none; }

.td-name { font-weight: 600; color: var(--text-1); }
.td-phone a { color: #25D366; text-decoration: none; font-weight: 500; }
.td-phone a:hover { text-decoration: underline; }
.td-device { font-size: 0.8rem; }
.td-issue {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}
.td-time { font-size: 0.78rem; color: var(--text-3); white-space: nowrap; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 980px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.status-badge.pending     { background: rgba(245,158,11,0.1);  color: var(--gold-400);  border: 1px solid rgba(245,158,11,0.2); }
.status-badge.inprogress  { background: rgba(59,130,246,0.1);  color: #60A5FA;          border: 1px solid rgba(59,130,246,0.2); }
.status-badge.completed   { background: rgba(74,222,128,0.1);  color: #4ADE80;          border: 1px solid rgba(74,222,128,0.2); }
.status-badge.cancelled   { background: rgba(248,113,113,0.1); color: #F87171;          border: 1px solid rgba(248,113,113,0.2); }

.status-badge:hover { opacity: 0.8; transform: scale(0.98); }

/* Action buttons */
.action-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  color: inherit;
}

.action-btn:hover {
  border-color: var(--gold-500);
  background: rgba(245,158,11,0.06);
}

.action-btn.danger:hover {
  border-color: #F87171;
  background: rgba(248,113,113,0.06);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.84rem;
  color: var(--text-3);
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* Gold top line */
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.5), transparent);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--text-3);
  transition: all 0.2s ease;
}

.modal-close:hover {
  border-color: #F87171;
  color: #F87171;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}

.field-val {
  font-size: 0.9rem;
  color: var(--text-1);
  font-weight: 500;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-whatsapp:hover { background: #1DB954; }

/* ── Admin Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 980px;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Responsive Admin ── */
@media (max-width: 900px) {
  .sidebar-toggle { display: block; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-topbar { padding-left: 4rem; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-row { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
}
