/* AV Group Facilities - Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700;800&family=Barlow+Condensed:wght@600;700&display=swap');

:root {
  --navy: #0a1628;
  --navy2: #112240;
  --navy3: #1a3055;
  --blue: #4db8ff;
  --blue2: #0077cc;
  --teal: #00c9a7;
  --gold: #f5a623;
  --red: #ef4444;
  --green: #22c55e;
  --white: #ffffff;
  --gray1: rgba(255,255,255,0.85);
  --gray2: rgba(255,255,255,0.55);
  --gray3: rgba(255,255,255,0.2);
  --gray4: rgba(255,255,255,0.08);
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

html, body {
  height: 100%;
  font-family: 'Barlow', sans-serif;
  background: var(--navy);
  color: var(--white);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── APP LAYOUT ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy2);
  border-right: 1px solid var(--gray3);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--gray3);
}

.logo-mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; }
.logo-main { font-size: 16px; font-weight: 800; letter-spacing: 2px; color: #fff; line-height: 1.2; }
.logo-sub { font-size: 10px; letter-spacing: 3px; color: var(--blue); text-transform: uppercase; }

.nav-section { padding: 16px 12px 8px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--gray2); padding: 0 8px; margin-bottom: 6px;
  display: block; text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  color: var(--gray2); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: .2s; margin-bottom: 2px;
}
.nav-item:hover { background: var(--gray4); color: var(--white); }
.nav-item.active { background: rgba(77,184,255,0.15); color: var(--blue); font-weight: 600; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--gray3);
  display: flex; align-items: center; gap: 12px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--blue); text-transform: uppercase; letter-spacing: 1px; }
.logout-btn {
  color: var(--gray2); text-decoration: none;
  font-size: 18px; padding: 8px; border-radius: 8px;
  transition: .2s;
}
.logout-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }

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

.topbar {
  height: var(--topbar-h);
  background: rgba(10,22,40,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray3);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.menu-toggle {
  display: none; background: none; border: none;
  color: var(--white); font-size: 22px; cursor: pointer;
  padding: 8px; border-radius: 8px;
}
.page-title { font-size: 18px; font-weight: 700; flex: 1; }
.current-date { font-size: 13px; color: var(--gray2); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.content-area { padding: 28px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--navy2);
  border: 1px solid var(--gray3);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 20px; color: var(--white);
  display: flex; align-items: center; gap: 10px;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--navy2);
  border: 1px solid var(--gray3);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.blue::before { background: linear-gradient(90deg, var(--blue), var(--blue2)); }
.stat-card.teal::before { background: linear-gradient(90deg, var(--teal), #009977); }
.stat-card.gold::before { background: linear-gradient(90deg, var(--gold), #d4890a); }
.stat-card.red::before { background: linear-gradient(90deg, var(--red), #c0392b); }

.stat-value { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--gray2); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.stat-icon { font-size: 28px; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); opacity: 0.2; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--gray3); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gray2);
  white-space: nowrap;
}
td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray4); }
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 50px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.badge-blue { background: rgba(77,184,255,0.15); color: var(--blue); }
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-gold { background: rgba(245,166,35,0.15); color: var(--gold); }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gray2);
}
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"],
select, textarea {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--gray3);
  border-radius: 10px; color: var(--white);
  font-family: 'Barlow', sans-serif; font-size: 15px;
  outline: none; transition: .25s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  background: rgba(77,184,255,0.08);
  box-shadow: 0 0 0 3px rgba(77,184,255,0.15);
}
select option { background: var(--navy2); }
textarea { resize: vertical; min-height: 90px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; border: none; font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; transition: .25s; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(77,184,255,0.35); }
.btn-success { background: linear-gradient(135deg, var(--teal), #009977); color: #fff; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,201,167,0.35); }
.btn-danger { background: linear-gradient(135deg, var(--red), #c0392b); color: #fff; }
.btn-danger:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--gray3); color: var(--gray1); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 7px; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #d4890a); color: #fff; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(245,166,35,0.35); }

.action-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.action-bar-right { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ── FLASH ── */
.flash {
  position: fixed; top: 20px; right: 20px;
  padding: 14px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  z-index: 9999; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: slideIn .3s ease;
  max-width: calc(100vw - 40px);
}
.flash button { background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; padding: 0; line-height: 1; }
.flash-success { background: rgba(34,197,94,0.9); color: #fff; }
.flash-error { background: rgba(239,68,68,0.9); color: #fff; }
.flash-info { background: rgba(77,184,255,0.9); color: #fff; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy) 0%, #1a2f4e 50%, #0d2137 100%); padding: 20px; }
.auth-box { width: 100%; max-width: 440px; background: rgba(255,255,255,0.05); backdrop-filter: blur(20px); border: 1px solid var(--gray3); border-radius: 20px; padding: 44px; }
.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo .mark { font-size: 48px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 24px; font-weight: 800; letter-spacing: 2px; }
.auth-logo p { color: var(--blue); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; margin-top: 4px; }
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }
.auth-box p.sub { color: var(--gray2); font-size: 14px; margin-bottom: 28px; }
.auth-box .btn { width: 100%; justify-content: center; padding: 15px; font-size: 15px; }
.auth-box .form-group { margin-bottom: 18px; }
.auth-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--gray2); }
.auth-link a { color: var(--blue); text-decoration: none; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.input-wrap .eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--gray2); font-size: 18px; background: none; border: none; color: var(--gray2); }

/* ── MONTH PICKER ── */
.month-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.month-picker select { width: auto; }

/* ── MOBILE ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 150; }

@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .content-area { padding: 16px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar-right { margin-left: 0; }
  .auth-box { padding: 28px 24px; }
  table { min-width: 600px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── MISC ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray2); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 16px; margin-bottom: 16px; }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: var(--gold); }
.text-gray { color: var(--gray2); }
.fw-bold { font-weight: 700; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.divider { height: 1px; background: var(--gray3); margin: 20px 0; }
hr.divider { border: none; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 800; }
input[type="color"] { width: 44px; height: 44px; padding: 4px; border-radius: 10px; }

/* location tags */
.loc-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(0,201,167,0.12); border-radius: 6px; font-size: 12px; color: var(--teal); }
</style>
