/* ==========================================================================
   MUSTUDS EXECUTIVE ADMIN PORTAL - STYLESHEET
   Corporate Dark Navy, High-Density Clean Cards, Professional SVG UI
   Strictly Zero Emojis
   ========================================================================== */

:root {
  --admin-primary: #0052CC;
  --admin-primary-dark: #0747A6;
  --admin-primary-deep: #091E42;
  --admin-navy-dark: #0B192C;
  --admin-slate: #1E293B;
  --admin-slate-light: #334155;
  --admin-muted: #64748B;
  --admin-light-muted: #94A3B8;
  
  --admin-bg: #F8FAFC;
  --admin-surface: #FFFFFF;
  --admin-border: #E2E8F0;
  --admin-border-light: #F1F5F9;
  
  --admin-success: #10B981;
  --admin-success-bg: #ECFDF5;
  --admin-warning: #F59E0B;
  --admin-warning-bg: #FFFBEB;
  --admin-danger: #EF4444;
  --admin-danger-bg: #FEF2F2;
  --admin-info: #0284C7;
  --admin-info-bg: #F0F9FF;

  --admin-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --admin-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --admin-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --admin-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-width: 260px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--admin-bg);
  color: var(--admin-slate);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--admin-navy-dark);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  background-color: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #FFFFFF;
}

.sidebar-brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #38BDF8;
  display: block;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--admin-light-muted);
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #94A3B8;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item svg {
  color: #64748B;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.nav-item:hover svg {
  color: #38BDF8;
}

.nav-item.active {
  background-color: var(--admin-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.35);
}

.nav-item.active svg {
  color: #FFFFFF;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-weight: 700;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  color: var(--admin-light-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #34D399;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  background-color: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--admin-primary-deep);
  letter-spacing: -0.3px;
}

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

.search-box svg {
  position: absolute;
  left: 0.75rem;
  color: var(--admin-muted);
  pointer-events: none;
}

.search-input {
  background-color: var(--admin-bg);
  border: 1px solid var(--admin-border);
  padding: 0.45rem 0.85rem 0.45rem 2.25rem;
  border-radius: 6px;
  font-size: 0.83rem;
  color: var(--admin-slate);
  width: 280px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background-color: #FFFFFF;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
  width: 320px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-primary {
  background-color: var(--admin-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--admin-primary-dark);
}

.btn-outline {
  background-color: #FFFFFF;
  border-color: var(--admin-border);
  color: var(--admin-slate);
}

.btn-outline:hover {
  background-color: var(--admin-bg);
  border-color: var(--admin-muted);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
}

.admin-body {
  padding: 2rem;
  flex: 1;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   METRIC KPI CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--admin-shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-muted);
}

.kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--admin-info-bg);
  color: var(--admin-primary);
}

.kpi-icon-box.success {
  background-color: var(--admin-success-bg);
  color: var(--admin-success);
}

.kpi-icon-box.warning {
  background-color: var(--admin-warning-bg);
  color: var(--admin-warning);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-primary-deep);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.kpi-footer {
  font-size: 0.75rem;
  color: var(--admin-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kpi-trend {
  font-weight: 700;
  color: var(--admin-success);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

/* ==========================================================================
   DATA PANELS & TABLES
   ========================================================================== */
.card {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.card-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FFFFFF;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-primary-deep);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--admin-muted);
  margin-top: 0.15rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.table-filter-bar {
  padding: 0.85rem 1.5rem;
  background-color: var(--admin-bg);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-filter {
  background-color: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-slate);
  outline: none;
  cursor: pointer;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.83rem;
}

.data-table th {
  background-color: #F8FAFC;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--admin-border-light);
  color: var(--admin-slate);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background-color: #F8FAFC;
}

.lead-name {
  font-weight: 700;
  color: var(--admin-primary-deep);
  display: block;
}

.lead-contact {
  font-size: 0.75rem;
  color: var(--admin-muted);
}

/* Status Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: capitalize;
}

.badge-new {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-contacted {
  background-color: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-in_progress {
  background-color: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.badge-booked, .badge-success {
  background-color: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-closed, .badge-cancelled, .badge-failed {
  background-color: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* Table Actions Button Group */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background-color: #FFFFFF;
  border: 1px solid var(--admin-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-slate);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background-color: var(--admin-bg);
  color: var(--admin-primary);
  border-color: var(--admin-primary);
}

.btn-icon.danger:hover {
  background-color: var(--admin-danger-bg);
  color: var(--admin-danger);
  border-color: var(--admin-danger);
}

/* ==========================================================================
   ANALYTICS & CHARTS GRID
   ========================================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--admin-border-light);
}

.stat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  font-weight: 600;
  color: var(--admin-slate);
}

.stat-val {
  font-weight: 700;
  color: var(--admin-primary-deep);
}

.bar-container {
  flex: 1;
  max-width: 140px;
  height: 6px;
  background-color: var(--admin-border-light);
  border-radius: 9999px;
  margin: 0 1rem;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background-color: var(--admin-primary);
  border-radius: 9999px;
}

/* ==========================================================================
   MODAL DRAWER
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(9, 30, 66, 0.54);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.modal-card {
  background-color: #FFFFFF;
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--admin-shadow-lg);
  overflow: hidden;
  border: 1px solid var(--admin-border);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--admin-primary-deep);
}

.modal-body {
  padding: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-row {
  margin-bottom: 1.15rem;
}

.modal-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-muted);
  margin-bottom: 0.35rem;
}

.modal-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--admin-slate);
  outline: none;
}

.modal-input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--admin-bg);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr; }
  .admin-header { padding: 0.75rem 1rem; }
  .admin-body { padding: 1rem; }
}

/* ==========================================================================
   AUTHENTICATION & LOGIN PAGE
   ========================================================================== */
.login-body {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #091E42 0%, #0B192C 100%);
  padding: 1.5rem;
}

.login-card {
  background-color: #FFFFFF;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
  padding: 2.5rem 2rem 1.5rem;
  text-align: center;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--admin-border-light);
}

.login-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  background-color: #000000;
  border: 1.5px solid #0052CC;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
  margin: 0 auto 1.15rem auto;
  display: block;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-primary-deep);
  letter-spacing: -0.4px;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--admin-muted);
}

.login-form {
  padding: 1.75rem 2rem 2rem;
}

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

.form-group label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-slate);
  margin-bottom: 0.4rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 0.85rem;
  color: var(--admin-muted);
  pointer-events: none;
}

.input-with-icon .login-input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 2.45rem;
  border: 1.5px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--admin-slate);
  outline: none;
  transition: all 0.2s ease;
  background-color: #F8FAFC;
}

.input-with-icon .login-input:focus {
  background-color: #FFFFFF;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.toggle-password-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--admin-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password-btn:hover {
  color: var(--admin-primary);
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--admin-primary);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 1rem;
}

.login-btn:hover {
  background-color: var(--admin-primary-dark);
}

.login-footer-security {
  padding: 0.9rem 1.5rem;
  background-color: #F8FAFC;
  border-top: 1px solid var(--admin-border);
  text-align: center;
  font-size: 0.72rem;
  color: var(--admin-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.login-error-alert {
  padding: 0.65rem 0.85rem;
  background-color: var(--admin-danger-bg);
  border: 1px solid #FECACA;
  border-radius: 6px;
  color: var(--admin-danger);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: none;
}

