/* Awadhpuri Infraheights - CollectERP Executive Theme System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light dark;
  --bg-dark: #f8fafc;
  --bg-panel: #ffffff;
  --bg-panel-2: #f1f5f9;
  --bg-card: #ffffff;
  --border-line: rgba(15, 23, 42, 0.08);
  --border-glow: rgba(16, 185, 129, 0.4);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --brand-emerald: #10b981;
  --brand-gold: #f59e0b;
  --brand-cyan: #06b6d4;
  --brand-blue: #3b82f6;
  
  --status-ok: #10b981;
  --status-warn: #f59e0b;
  --status-err: #ef4444;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* Dark Mode Overrides */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-dark: #070b14;
  --bg-panel: #0f172a;
  --bg-panel-2: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.85);
  --border-line: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(16, 185, 129, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
}

/* Base Body Setup */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  margin: 0;
}

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Shell Layout */
.app-body {
  display: flex;
  min-height: 100vh;
}

/* ========== CollectERP Sidebar Design ========== */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 50;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  width: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 4px;
}

.brand-badge-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

html[data-theme="dark"] .brand-badge-logo {
  background: var(--brand-emerald);
  color: #032015;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: #94a3b8;
  text-transform: uppercase;
  margin: 16px 0 6px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

html[data-theme="dark"] .nav-item {
  color: #94a3b8;
}

.nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

html[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Active Nav Link Pill (Black Pill with White Text like CollectERP) */
.nav-item.active {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2) !important;
}

html[data-theme="dark"] .nav-item.active {
  background: var(--brand-emerald) !important;
  color: #032015 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.nav-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
}

/* Bottom Left Footer Profile Card */
.sidebar-profile-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

html[data-theme="dark"] .sidebar-profile-card {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.profile-details {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.profile-role-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

html[data-theme="dark"] .profile-role-tag {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

/* ========== Top Header Menu Bar ========== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: 60px;
  padding: 0 28px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
}

.bc-brand {
  color: var(--text-muted);
}

.bc-sep {
  color: #cbd5e1;
}

.bc-role {
  color: var(--text-muted);
}

.bc-title {
  color: var(--text-main);
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

html[data-theme="dark"] .chip {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  color: #0f172a;
  cursor: pointer;
}

html[data-theme="dark"] .theme-toggle-btn {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.header-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

/* Header Logout Button (Clean Light Pill matching reference) */
.header-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.header-logout-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

html[data-theme="dark"] .header-logout-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ========== Page Content & Cards System ========== */
.app-content {
  padding: 28px 36px;
  flex: 1;
}

/* KPI Stat Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.card .muted {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.big {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 6px;
  display: block;
}

/* Tables System */
.table-card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border-line);
  background: var(--bg-panel);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-line);
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

html[data-theme="dark"] .data-table th {
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
}

.data-table td {
  color: var(--text-main);
}

.data-table tr:hover {
  background: #f8fafc;
}

html[data-theme="dark"] .data-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Badges & Status Pills */
.pill, .badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pill-available, .badge-available { background: rgba(16, 185, 129, 0.12); color: #059669; }
.pill-hold, .badge-hold { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.pill-booked, .badge-booked { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

/* Filter Tabs for Settings & Users */
.filter-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

html[data-theme="dark"] .tab-btn {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.tab-btn.active, .tab-btn:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  font-weight: 700;
}

html[data-theme="dark"] .tab-btn.active, html[data-theme="dark"] .tab-btn:hover {
  background: var(--brand-emerald);
  border-color: var(--brand-emerald);
  color: #032015;
}
