/**
 * PkBizHub.com — Executive Modern Admin Console
 * Unique, High-End SaaS Control Center with Glassmorphism, Micro-Illuminations & Polished Micro-Interactions
 */

:root {
  /* Slate & Obsidian Dark Scale */
  --admin-navy: #0b1329;
  --admin-navy-dark: #070c1b;
  --admin-sidebar-bg: #0b1329;
  --admin-sidebar-hover: rgba(255, 255, 255, 0.06);
  --admin-sidebar-active: rgba(5, 150, 105, 0.16);

  /* Primary Brand Themes */
  --admin-accent: #059669;        /* Signature Pakistani Emerald */
  --admin-accent-hover: #047857;
  --admin-accent-gradient: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  --admin-cyan: #0284c7;

  /* Surfaces & Backgrounds */
  --admin-body-bg: #f8fafc;       /* Ultra-clean Slate 50 */
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;        /* Slate 200 */
  --admin-border-dark: #cbd5e1;   /* Slate 300 */
  --admin-border-light: #f1f5f9;

  /* Typography */
  --admin-text-main: #0f172a;     /* Slate 900 */
  --admin-text-muted: #64748b;    /* Slate 500 */
  --admin-text-dim: #94a3b8;      /* Slate 400 */

  /* Functional Accents */
  --admin-success: #059669;
  --admin-warning: #d97706;
  --admin-danger: #dc2626;
  --admin-info: #0284c7;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 4px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow-emerald: 0 4px 14px rgba(5, 150, 105, 0.35);
  --shadow-glow-amber: 0 4px 14px rgba(217, 119, 6, 0.35);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--admin-body-bg);
  color: var(--admin-text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--admin-accent);
  text-decoration: none;
  transition: all 0.15s ease;
}

a:hover {
  color: var(--admin-accent-hover);
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==============================================================
   Layout Grid & Shell
============================================================== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ==============================================================
   Unique Dark Obsidian Sidebar
============================================================== */
.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0b1329 0%, #0f172a 100%);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  z-index: 50;
}

.sidebar-brand {
  height: 72px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: -0.5px;
}

.sidebar-brand i {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  color: #ffffff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.sidebar-brand span {
  color: #38bdf8;
}

.sidebar-brand-badge {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sidebar-menu {
  list-style: none;
  padding: 18px 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-menu-heading {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.9px;
  padding: 14px 14px 6px 14px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9.5px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-link-content i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: #64748b;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background-color: var(--admin-sidebar-hover);
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-link:hover .sidebar-link-content i {
  color: #38bdf8;
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.22) 0%, rgba(13, 148, 136, 0.08) 100%);
  color: #34d399;
  border-left: 3px solid #10b981;
  border-color: rgba(16, 185, 129, 0.25);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-link.active .sidebar-link-content i {
  color: #10b981;
}

.sidebar-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  animation: pulseBadge 2.5s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #64748b;
  background-color: rgba(0, 0, 0, 0.15);
}

/* ==============================================================
   Main Admin Canvas & Topbar
============================================================== */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #f8fafc;
}

/* Glassmorphic Modern Topbar */
.admin-topbar {
  height: 72px;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Clean Capsule User Profile Pill */
.admin-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px 4px 5px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.admin-user-pill:hover {
  border-color: #059669;
  background-color: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.15);
}

.admin-user-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
}

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

/* ==============================================================
   Unique KPI Metrics Cards (Micro-Illuminations)
============================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3px Top Illuminating Accent */
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: #cbd5e1;
  transition: height 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.metric-card:hover::before {
  height: 5px;
}

.metric-card.urgent::before {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.metric-card.approved::before {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.metric-card.info::before {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
}

.metric-card.neutral::before {
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
}

.metric-data h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.metric-number {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.metric-card:hover .metric-icon {
  transform: scale(1.08);
}

.metric-icon.warning-bg {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.metric-icon.success-bg {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.metric-icon.info-bg {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.metric-icon.navy-bg {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* ==============================================================
   Admin Cards & Priority Containers
============================================================== */
.admin-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.admin-card:hover {
  border-color: #cbd5e1;
}

.admin-card-header {
  padding: 18px 26px;
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.admin-card-body {
  padding: 26px;
}

/* ==============================================================
   Clean Modern Data Tables
============================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.admin-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 13px 18px;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.admin-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.admin-table tbody tr {
  transition: background-color 0.15s ease;
}

.admin-table tbody tr:hover td {
  background-color: #f8fafc;
}

/* ==============================================================
   Modern Pill Badges (Pastel Fill + Dot Indicator)
============================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 14px;
  text-transform: capitalize;
  line-height: 1.3;
}

.status-pending {
  background-color: #fef3c7;
  color: #78350f;
  border: 1px solid #fde68a;
}

.status-approved {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-rejected {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.status-suspended {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* ==============================================================
   Refined Tactile Buttons
============================================================== */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.2;
  text-decoration: none;
}

.btn-admin:active {
  transform: scale(0.98);
}

.btn-admin-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.btn-admin-primary:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-admin-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
}

.btn-admin-success:hover {
  background: #047857;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-admin-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

.btn-admin-danger:hover {
  background: #b91c1c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.btn-admin-navy {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-admin-navy:hover {
  background-color: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-admin-outline {
  background-color: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-admin-outline:hover {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-admin-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 7px;
}

/* Action Groups */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================
   Form Controls & Inputs
============================================================== */
.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  padding: 9.5px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background-color: #ffffff;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* ==============================================================
   Modern Alert Banners
============================================================== */
.admin-alert {
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.admin-alert-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.admin-alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.admin-alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ==============================================================
   Modal Dialogs
============================================================== */
.admin-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.admin-modal.show {
  display: flex;
}

.admin-modal-dialog {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: modalPop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.admin-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.admin-modal-body {
  padding: 24px;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* QA fix: admin table wrapping, sticky first column, touch targets, forms-first on narrow screens */
.admin-table td { overflow-wrap: anywhere; }
.admin-table th:first-child, .admin-table td:first-child { position: sticky; left: 0; background: #ffffff; z-index: 1; }
.btn-admin-sm { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 900px) {
  .admin-table th, .admin-table td { padding: 10px 12px; }
}

/* QA fix: keep add forms visible while scrolling long lists */
.admin-form-panel, .admin-card { position: relative; }
@media (min-width: 1024px) {
  .admin-form-sticky { position: sticky; top: 20px; }
}
