/* ============================================================
   PCTM Smartclass Booking System — Global Stylesheet
   ============================================================ */

:root {
  --primary:     #1e40af;
  --primary-l:   #3b82f6;
  --primary-d:   #1e3a8a;
  --accent:      #0ea5e9;
  --success:     #16a34a;
  --warning:     #d97706;
  --danger:      #dc2626;
  --pending:     #7c3aed;
  --bg:          #f0f4f8;
  --card:        #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-m:      #475569;
  --text-s:      #94a3b8;
  --radius:      12px;
  --radius-s:    8px;
  --shadow:      0 2px 8px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.12);
  --nav-h:       64px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary-l); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, var(--primary-d) 0%, var(--primary) 100%);
  height: var(--nav-h); display: flex; align-items: center;
  padding: 0 24px; box-shadow: var(--shadow-lg);
  gap: 16px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px; color: #fff;
  font-size: 1.15rem; font-weight: 700; white-space: nowrap;
}
.navbar-brand img { height: 36px; border-radius: 6px; }
.navbar-brand .brand-icon {
  width: 38px; height: 38px; background: rgba(255,255,255,.18);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.navbar-brand .brand-text .sub { font-size: .7rem; opacity: .75; font-weight: 400; display: block; }
.navbar-spacer { flex: 1; }
.navbar-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: rgba(255,255,255,.85); padding: 6px 14px; border-radius: 6px;
  font-size: .88rem; font-weight: 500; transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.18); color: #fff; text-decoration: none;
}
.nav-link i { margin-right: 5px; }
.nav-user {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.9); font-size: .88rem;
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .85rem; color: #fff;
}
.nav-btn {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 6px 14px; border-radius: 6px; font-size: .85rem;
  cursor: pointer; transition: all .2s;
}
.nav-btn:hover { background: rgba(255,255,255,.25); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* ── Page Layout ─────────────────────────────────────────── */
.page-wrapper { max-width: 1280px; margin: 0 auto; padding: 28px 20px 60px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.page-header p { color: var(--text-m); margin-top: 4px; }
.breadcrumb { font-size: .82rem; color: var(--text-s); margin-bottom: 8px; }
.breadcrumb a { color: var(--primary-l); }
.breadcrumb span { margin: 0 6px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header h2, .card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 24px; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border); background: #f8fafc; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: var(--primary); }
.stat-icon.green  { background: #dcfce7; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.red    { background: #fee2e2; color: var(--danger); }
.stat-icon.purple { background: #ede9fe; color: var(--pending); }
.stat-val  { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label{ font-size: .8rem; color: var(--text-m); margin-top: 4px; }

/* ── Grid Layouts ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: #f1f5f9; border-radius: var(--radius-s); padding: 4px; margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer;
  font-size: .88rem; font-weight: 500; background: none; color: var(--text-m);
  transition: all .2s;
}
.tab-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Badge / Status ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-pending  { background: #ede9fe; color: #6d28d9; }
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-suspended{ background: #fee2e2; color: #b91c1c; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-s); border: none;
  font-size: .9rem; font-weight: 500; cursor: pointer; transition: all .2s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
  background: #fff; border: 1px solid var(--border); color: var(--text);
}
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 5px 12px; font-size: .8rem; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: 6px; min-width: 36px; min-height: 36px; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 9px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-s);
  font-size: .9rem; color: var(--text); background: #fff; transition: border-color .2s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary-l); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.form-control::placeholder { color: var(--text-s); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-hint { font-size: .78rem; color: var(--text-s); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 4px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px; font-size: .9rem;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  background: #f8fafc; padding: 11px 14px; text-align: left;
  font-weight: 600; color: var(--text-m); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ── Public Booking Cards ────────────────────────────────── */
.booking-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.booking-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.booking-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.booking-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 14px 18px; color: #fff;
}
.booking-card-header .faculty { font-size: 1rem; font-weight: 700; }
.booking-card-header .dept    { font-size: .8rem; opacity: .85; margin-top: 2px; }
.booking-card-body { padding: 16px 18px; }
.booking-detail { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: .88rem; }
.booking-detail i { color: var(--primary-l); width: 16px; flex-shrink: 0; margin-top: 2px; }
.booking-detail .label { color: var(--text-s); font-size: .78rem; display: block; }
.booking-detail .val   { color: var(--text); font-weight: 500; }
.booking-time-bar {
  background: #f1f5f9; border-radius: 6px; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center; margin-top: 12px;
}
.booking-time-bar .time { font-size: 1rem; font-weight: 700; color: var(--primary); }
.booking-time-bar .duration { font-size: .78rem; color: var(--text-s); }

/* ── Hero / Public ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-d) 0%, var(--primary) 50%, var(--accent) 100%);
  color: #fff; padding: 48px 20px; text-align: center;
}
.hero h1 { font-size: 2rem; font-weight: 800; }
.hero p  { font-size: 1.05rem; opacity: .85; margin-top: 8px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-meta { display: flex; justify-content: center; gap: 24px; margin-top: 20px; flex-wrap: wrap; }
.hero-meta-item { display: flex; align-items: center; gap: 6px; font-size: .9rem; opacity: .9; }
.today-date {
  background: rgba(255,255,255,.18); display: inline-block;
  padding: 6px 18px; border-radius: 20px; font-size: .88rem; margin-top: 14px;
}

/* ── Sidebar Admin Layout ────────────────────────────────── */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-h)); }
.sidebar {
  width: 240px; background: var(--card); border-right: 1px solid var(--border);
  padding: 20px 0; flex-shrink: 0; position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.sidebar-section { padding: 6px 12px; }
.sidebar-section-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-s); padding: 10px 12px 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px;
  color: var(--text-m); font-size: .88rem; font-weight: 500; transition: all .2s; margin-bottom: 2px;
}
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-link:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }
.sidebar-link.active { background: #dbeafe; color: var(--primary); }
.sidebar-link .badge-count {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .7rem; padding: 1px 7px; border-radius: 20px; font-weight: 700;
}
.admin-content { flex: 1; padding: 28px 28px 60px; min-width: 0; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-s); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; color: var(--border); }
.empty-state h3 { font-size: 1.1rem; color: var(--text-m); margin-bottom: 8px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: all .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-s); padding: 4px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; overflow: hidden; }
.auth-card-header {
  background: linear-gradient(135deg, var(--primary-d), var(--accent));
  padding: 28px 28px 20px; color: #fff; text-align: center;
}
.auth-card-header .logo-icon { font-size: 2.4rem; margin-bottom: 8px; }
.auth-card-header h1 { font-size: 1.3rem; font-weight: 700; }
.auth-card-header p  { font-size: .85rem; opacity: .8; margin-top: 4px; }
.auth-card-body { padding: 28px; }
.auth-footer { text-align: center; font-size: .85rem; color: var(--text-s); margin-top: 16px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-item {
  width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
  cursor: pointer; background: #fff; color: var(--text-m); transition: all .2s;
}
.page-item:hover, .page-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Search Bar ──────────────────────────────────────────── */
.search-bar { position: relative; }
.search-bar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-s); }
.search-bar input { padding-left: 36px; }

/* ── Reject Reason Box ───────────────────────────────────── */
.reject-box { background: #fff5f5; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 14px; margin-top: 10px; font-size: .85rem; color: #b91c1c; }
.reject-box strong { display: block; margin-bottom: 4px; }

/* ── Utilities ───────────────────────────────────────────── */
.mt-0{margin-top:0} .mt-1{margin-top:8px} .mt-2{margin-top:16px} .mt-3{margin-top:24px} .mt-4{margin-top:32px}
.mb-0{margin-bottom:0} .mb-1{margin-bottom:8px} .mb-2{margin-bottom:16px} .mb-3{margin-bottom:24px}
.text-center{text-align:center} .text-right{text-align:right}
.text-muted{color:var(--text-s)} .text-small{font-size:.82rem}
.fw-600{font-weight:600} .fw-700{font-weight:700}
.d-flex{display:flex} .align-center{align-items:center} .justify-between{justify-content:space-between}
.gap-1{gap:8px} .gap-2{gap:16px}
.w-100{width:100%} .flex-1{flex:1}
.hidden{display:none}
.loading { opacity: .5; pointer-events: none; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .admin-layout { flex-direction: column; }
  .admin-content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .navbar-nav { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--primary-d); flex-direction: column; padding: 10px; gap: 4px; }
  .navbar-nav.open { display: flex; }
  .hero h1 { font-size: 1.5rem; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-wrapper { padding: 16px 12px 40px; }
  .booking-grid { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
  .auth-card-body { padding: 20px; }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .navbar, .sidebar, .btn, .tabs { display: none; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
