@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;900&display=swap');

:root {
  --bg-main: #070913;
  --bg-sidebar: #0b0f1d;
  --bg-card: rgba(18, 25, 47, 0.4);
  --border-glow: rgba(0, 240, 255, 0.15);
  --border-purple: rgba(142, 68, 173, 0.2);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --color-cyan: #00f0ff;
  --color-purple: #a855f7;
  --color-amber: #f59e0b;
  --color-emerald: #10b981;
  --color-rose: #f43f5e;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
}

/* Layout Container */
#app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
#sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 100;
  transition: var(--transition-smooth);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--color-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item button {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.nav-item button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active button {
  color: var(--color-cyan);
  background: rgba(0, 240, 255, 0.06);
  border-left: 3px solid var(--color-cyan);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: inset 4px 0 10px rgba(0, 240, 255, 0.03);
}

/* Main Content Area */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  background-image: radial-gradient(circle at 80% 10%, rgba(142, 68, 173, 0.08), transparent 45%);
}

.top-bar {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 15, 29, 0.6);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-cyan), #00b0ff);
  color: #070913;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

/* Page Containers */
.page-container {
  padding: 2rem;
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.page-container.active {
  display: block;
}

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

/* Cards & Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  padding: 1.5rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.card-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Interactive Charts Widget */
.chart-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-container {
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-top: 1rem;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 24px;
  background: linear-gradient(180deg, var(--color-cyan), rgba(0, 240, 255, 0.2));
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.chart-bar:hover {
  background: linear-gradient(180deg, #fff, var(--color-cyan));
  box-shadow: 0 0 15px var(--color-cyan);
}

.chart-bar-value {
  position: absolute;
  top: -22px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-cyan);
  opacity: 0;
  transition: var(--transition-smooth);
}

.chart-bar:hover .chart-bar-value {
  opacity: 1;
}

.chart-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: center;
}

/* Tables and Records Styling */
.table-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

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

.search-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  flex: 1;
  max-width: 350px;
}

.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
}

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

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.01);
}

td {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--glass-border);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-emerald);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-amber);
}

.badge-inactive {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-rose);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 9, 19, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #0d1222;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border-radius: 14px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  transform: scale(0.95);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Form Styling */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Attendant Reports Module Specifics */
.report-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.report-editor {
  flex: 2;
  min-width: 350px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 12px;
}

.report-output-card {
  flex: 1;
  min-width: 280px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-purple);
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.report-preview {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--glass-border);
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: #38bdf8;
  flex: 1;
  margin-bottom: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Floating Action Button (FAB) Mobile */
.fab-mobile {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-cyan), #00b0ff);
  color: #070913;
  display: none;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.45);
  z-index: 200;
  border: none;
  cursor: pointer;
}

/* Mobile Responsiveness */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
  }
  
  #sidebar.active {
    left: 0;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .top-bar {
    padding: 1rem 1.25rem;
  }
  
  .page-container {
    padding: 1.25rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .report-row {
    flex-direction: column;
  }
}
