/* ============================================================
   Campus Services Booking System — Professional Flat UI
   Design: Clean light theme, no gradients, thin borders only
   ============================================================ */

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

:root {
  --primary:       #4361ee;
  --primary-soft:  #eef0fd;
  --primary-hover: #3451d1;
  --accent:        #06b6d4;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #6366f1;

  --sidebar-w:     252px;
  --topbar-h:      56px;

  --bg-body:       #f7f8fc;
  --bg-white:      #ffffff;
  --bg-muted:      #f1f3f8;

  --border:        #e8eaf0;
  --border-thin:   1px solid var(--border);

  --text-main:     #1a1d2e;
  --text-sub:      #5f6580;
  --text-muted:    #9499b2;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;

  --shadow-xs:     0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:     0 2px 6px rgba(0,0,0,.07);
  --shadow:        0 4px 16px rgba(0,0,0,.08);

  --transition:    all .18s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d4e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b0b4c8; }

/* ─── Links ───────────────────────────────────────────────── */
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* =====================================================================
   AUTH LAYOUT
   ===================================================================== */

.auth-body {
  background: var(--bg-muted);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  border-radius: var(--radius-lg) !important;
  border: var(--border-thin) !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
  background: var(--bg-white);
}

.card-top-bar {
  height: 3px;
  background: var(--primary);
  margin: 0;
}

.auth-icon {
  width: 52px;
  height: 52px;
  background: var(--primary-soft);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
}

/* =====================================================================
   LAYOUT SHELL
   ===================================================================== */

#wrapper { min-height: 100vh; display: flex; }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  background: var(--bg-white);
  border-right: var(--border-thin);
  display: flex;
  flex-direction: column;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: var(--border-thin);
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  font-size: 1rem;
}

.brand-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.01em;
}

/* sidebar nav */
.sidebar-nav { padding: 10px 10px; overflow-y: auto; flex: 1; }

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}
.sidebar-group-toggle:hover { background: var(--bg-muted); }

.sidebar-group-label-text {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .07em !important;
  color: var(--text-muted) !important;
  text-transform: uppercase;
}

.sidebar-chevron {
  font-size: 10px;
  transition: transform .2s ease;
  color: var(--text-muted) !important;
}
.sidebar-group-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-sub);
  transition: var(--transition);
  white-space: nowrap;
}
.sidebar-link i { font-size: 15px; flex-shrink: 0; width: 18px; text-align: center; }
.sidebar-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.sidebar-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-link.active i { color: var(--primary); }

/* indent sub-items */
.sidebar-group-item > .collapse > .nav-item > .sidebar-link {
  padding-left: 14px;
}

.sidebar-footer {
  padding: 10px;
  border-top: var(--border-thin);
  flex-shrink: 0;
}
.sidebar-footer .sidebar-link { color: var(--danger); }
.sidebar-footer .sidebar-link:hover { background: #fef2f2; color: #dc2626; }

/* ─── Topbar ──────────────────────────────────────────────── */
#page-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-h);
  background: var(--bg-white);
  border-bottom: var(--border-thin);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.main-content { flex: 1; }

/* =====================================================================
   AVATAR
   ===================================================================== */
.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: var(--border-thin);
}
.avatar-circle.lg { width: 68px; height: 68px; font-size: 1.6rem; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card {
  border: var(--border-thin) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xs) !important;
  background: var(--bg-white);
}

.card-header {
  background: var(--bg-white) !important;
  border-bottom: var(--border-thin) !important;
  padding: 14px 18px !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.card-body { padding: 18px !important; }
.card-footer {
  background: var(--bg-muted) !important;
  border-top: var(--border-thin) !important;
  padding: 12px 18px !important;
}

/* Stat card */
.stat-card {
  border: var(--border-thin) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xs) !important;
  background: var(--bg-white);
  transition: box-shadow .18s ease;
}
.stat-card:hover { box-shadow: var(--shadow-sm) !important; }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* =====================================================================
   TABLES
   ===================================================================== */
.table {
  font-size: 13.5px;
  color: var(--text-main);
  margin-bottom: 0;
}
.table thead th {
  background: var(--bg-muted) !important;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: var(--border-thin) !important;
  border-top: none !important;
  padding: 10px 14px;
  white-space: nowrap;
}
.table tbody td {
  padding: 11px 14px;
  border-bottom: var(--border-thin) !important;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none !important; }
.table-hover tbody tr:hover { background: var(--primary-soft); }
.table-borderless td, .table-borderless th { border: none !important; }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-lg { padding: 9px 20px; font-size: 15px; }

.btn-light {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--text-sub);
}
.btn-light:hover { background: #e8eaf0; }

/* =====================================================================
   FORMS
   ===================================================================== */
.form-label {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.form-control, .form-select {
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  padding: 7px 12px;
  color: var(--text-main);
  background: var(--bg-white);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.1);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }

.form-text { font-size: 12px; color: var(--text-muted); }

.input-group-text {
  background: var(--bg-muted);
  border: var(--border-thin);
  color: var(--text-muted);
  font-size: 14px;
}

/* =====================================================================
   BADGES
   ===================================================================== */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* =====================================================================
   BREADCRUMB
   ===================================================================== */
.breadcrumb {
  font-size: 12.5px;
  margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text-muted); }

/* =====================================================================
   PAGE HEADER
   ===================================================================== */
.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-main);
}
.page-header p { color: var(--text-sub); font-size: 13.5px; }

/* =====================================================================
   RESOURCE CARDS
   ===================================================================== */
.resource-card {
  transition: box-shadow .18s ease, transform .18s ease;
  overflow: hidden;
}
.resource-card:hover {
  box-shadow: var(--shadow) !important;
  transform: translateY(-2px);
}
.resource-card .card-img-top {
  height: 130px;
  object-fit: cover;
  background: var(--bg-muted);
}

/* =====================================================================
   SCHEDULE / CALENDAR
   ===================================================================== */
.schedule-block {
  background: var(--bg-white);
  border-left: 3px solid var(--primary) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.calendar-event { border-left: 3px solid var(--primary); }

/* =====================================================================
   NOTIFICATIONS & BADGES
   ===================================================================== */
.notification-badge { font-size: 10px; padding: 2px 5px; }

/* =====================================================================
   CHECKLIST
   ===================================================================== */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .3rem 0;
  font-size: 13.5px;
}
.checklist-item i { color: var(--success); font-size: 15px; }

/* =====================================================================
   AVAILABILITY
   ===================================================================== */
#availabilityStatus.available  { color: var(--success); }
#availabilityStatus.unavailable { color: var(--danger); }
#availabilityStatus.checking   { color: var(--text-muted); }

/* =====================================================================
   DROPDOWN / MODALS
   ===================================================================== */
.dropdown-menu {
  border: var(--border-thin);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  padding: 6px;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-main);
}
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }

.modal-content {
  border: var(--border-thin);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.modal-header {
  border-bottom: var(--border-thin);
  padding: 14px 18px;
}
.modal-footer {
  border-top: var(--border-thin);
  padding: 12px 18px;
}

/* =====================================================================
   ALERTS
   ===================================================================== */
.alert {
  border-radius: var(--radius);
  border: none;
  font-size: 13.5px;
  padding: 12px 16px;
}
.alert-success { background: #f0fdf4; color: #15803d; }
.alert-danger   { background: #fef2f2; color: #b91c1c; }
.alert-warning  { background: #fffbeb; color: #92400e; }
.alert-info     { background: #eff6ff; color: #1d4ed8; }

/* =====================================================================
   PAGINATION
   ===================================================================== */
.pagination { font-size: 13px; gap: 3px; }
.page-link {
  border-radius: var(--radius-sm) !important;
  border: var(--border-thin);
  padding: 5px 11px;
  color: var(--text-sub);
}
.page-link:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* =====================================================================
   UTILITY CLASSES
   ===================================================================== */
.text-primary { color: var(--primary) !important; }
.bg-primary   { background: var(--primary) !important; }
.bg-soft      { background: var(--primary-soft); }
.border-soft  { border-color: var(--border) !important; }
.rounded-sm   { border-radius: var(--radius-sm) !important; }
.rounded-md   { border-radius: var(--radius) !important; }
.rounded-lg   { border-radius: var(--radius-lg) !important; }

/* =====================================================================
   SIDEBAR ICON COLOR HELPERS (stat cards, icons)
   ===================================================================== */
.icon-primary { background: var(--primary-soft); color: var(--primary); }
.icon-success { background: #f0fdf4; color: var(--success); }
.icon-warning { background: #fffbeb; color: var(--warning); }
.icon-danger  { background: #fef2f2; color: var(--danger); }
.icon-info    { background: #eef2ff; color: var(--info); }
.icon-accent  { background: #ecfeff; color: var(--accent); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 6px 0 24px rgba(0,0,0,.1);
  }
  #page-content { margin-left: 0; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 575.98px) {
  .main-content { padding: .85rem !important; }
  .card-body { padding: 14px !important; }
}

/* =====================================================================
   ADDITIONAL CUSTOM CLASSES
   ===================================================================== */
.empty-state {
  border: 2px dashed #dee2e6;
  background: #fafbfc;
}
.resource-card-img {
  height: 120px;
}
