/* ==========================================================================
   Sahajanand Sky - SkyOS Society Management Suite
   Theme: Pure Light Theme Content + Sleek Dark Left Sidebar
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand Identity - Sahajanand Sky Warm Amber & Sunset Orange */
  --brand-primary: #f47c34;
  --brand-primary-hover: #ea580c;
  --brand-secondary: #0284c7;
  --brand-accent: #fbbf24;

  /* Main Workspace: Light Theme */
  --bg-deep: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-highlight: rgba(244, 124, 52, 0.4);

  /* Typography Colors */
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Left Sidebar: Sleek Dark Aesthetics */
  --sidebar-bg: #0b1120;
  --sidebar-card: #111a2e;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f8fafc;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.1);

  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.25s ease;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
}

/* --------------------------------------------------------------------------
   Clean Light Global Header
   -------------------------------------------------------------------------- */
.global-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f47c34 0%, #ea580c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(244, 124, 52, 0.3);
  color: #fff;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.brand-title span.tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(244, 124, 52, 0.12);
  color: #ea580c;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Center Omnisearch Bar in Header
   -------------------------------------------------------------------------- */
.header-search-container {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin: 0 16px;
}

.header-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  transition: var(--transition-fast);
}

.header-search-input-wrap:focus-within {
  background: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(244, 124, 52, 0.15);
}

.header-search-input-wrap svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-main);
  width: 100%;
}

.header-search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: #e2e8f0;
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
}

/* Omnisearch Dropdown */
.search-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 120;
  display: none;
  padding: 6px;
}

.search-dropdown-menu.active {
  display: block;
}

.search-category-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px 2px;
  letter-spacing: 0.05em;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.84rem;
}

.search-result-item:hover {
  background: #fff7ed;
  color: #ea580c;
}

.search-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Header Right Actions
   -------------------------------------------------------------------------- */
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-action-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 120;
  display: none;
}

.quick-action-dropdown.active {
  display: block;
}

.dropdown-item {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: #fff7ed;
  color: #ea580c;
}

/* Live Gate Status Pill */
.status-pill-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Icon Buttons */
.icon-round-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.icon-round-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Notification Drawer Dropdown */
.notif-drawer-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 330px;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 120;
  display: none;
}

.notif-drawer-menu.active {
  display: block;
}

.notif-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Admin User Pill */
.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.admin-user-pill:hover {
  background: #f1f5f9;
  border-color: var(--border-medium);
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-user-info {
  line-height: 1.2;
}

.admin-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.admin-user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Sidebar Badges and Pulse */
.sidebar-nav-item .badge-count.pulse-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}
.sidebar-nav-item .badge-count.info {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}

/* --------------------------------------------------------------------------
   Workspace Sections
   -------------------------------------------------------------------------- */
.app-workspace {
  min-height: calc(100vh - 63px);
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Admin Dashboard Layout (Dark Left Sidebar + Light Content)
   -------------------------------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 63px);
}

/* Dark Left Sidebar */
.admin-sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 63px;
  height: calc(100vh - 63px);
  overflow-y: auto;
  padding: 16px 12px;
}

.admin-sidebar::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 14px 12px 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-item.active {
  color: #ffffff;
  background: rgba(244, 124, 52, 0.15);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

.sidebar-nav-item svg {
  width: 17px;
  height: 17px;
  opacity: 0.9;
  flex-shrink: 0;
}

.sidebar-nav-item .badge-count {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-weight: 700;
}

/* Society Quick Card in Dark Sidebar */
.society-quick-card {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-card);
  border: 1px solid var(--sidebar-border);
  font-size: 0.75rem;
}

.society-quick-card .title {
  font-weight: 700;
  color: #ff9858;
  margin-bottom: 2px;
}

/* Main Content Area: Pure Light Theme */
.admin-content {
  flex: 1;
  padding: 24px 32px;
  background: var(--bg-deep);
  overflow-y: auto;
}

.admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-headline h2 {
  font-size: 1.55rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.page-headline p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Light Metric Cards & Panels
   -------------------------------------------------------------------------- */
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-primary);
}

.metric-card.success::before { background: var(--success); }
.metric-card.warning::before { background: var(--warning); }
.metric-card.info::before { background: var(--info); }
.metric-card.purple::before { background: var(--purple); }

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 6px;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #f47c34, #ea580c);
  transition: width 0.8s ease;
}

/* Light Card Panels */
.panel-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.badge-warning { background: var(--warning-bg); color: #d97706; border: 1px solid #fde68a; }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); border: 1px solid #fecaca; }
.badge-info    { background: var(--info-bg);    color: var(--info); border: 1px solid #bae6fd; }
.badge-brand   { background: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(244, 124, 52, 0.3);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 4px 12px rgba(244, 124, 52, 0.4);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--brand-primary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.input-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.84rem;
  color: var(--text-main);
  min-width: 220px;
}

.input-search:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(244, 124, 52, 0.2);
}

.input-search input {
  background: transparent;
  width: 100%;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-size: 0.88rem;
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(244, 124, 52, 0.2);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

@media (max-width: 1024px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
}
