/* Google Sans Flex */
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/google-sans-flex-0.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/google-sans-flex-1.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/google-sans-flex-2.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/google-sans-flex-3.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/google-sans-flex-4.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/google-sans-flex-5.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/google-sans-flex-6.ttf') format('truetype');
}

/* ============================================================
   Variables
   ============================================================ */
:root {
  --color-primary: #0068b9;
  --color-dark:    #0f253a;
  --color-muted:   #2d2c2c;
  --color-grey:    #8f9192;
  --sidebar-width: 240px;
  --topbar-height: 54px;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

body {
  font-family: 'Google Sans Flex', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  background: #f4f6f9;
  color: var(--color-muted);
  margin: 0;
}

/* ============================================================
   Layout
   ============================================================ */
#wrapper {
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

#sidebar.collapsed {
  width: 60px;
}

#sidebar.collapsed .sidebar-brand span,
#sidebar.collapsed .sidebar-link span,
#sidebar.collapsed .sidebar-section {
  display: none;
}

#page-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar-brand {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: var(--topbar-height);
  letter-spacing: 0.02em;
}

.sidebar-section {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-grey);
  padding: 1.2rem 1rem 0.4rem;
}

.sidebar-nav {
  padding-bottom: 2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(0,104,185,0.25);
  color: #fff;
  border-left-color: var(--color-primary);
  font-weight: 500;
}

.sidebar-link i {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  background: var(--color-primary);
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.topbar .btn-link {
  color: rgba(255,255,255,0.8);
}

.topbar .btn-link:hover {
  color: #fff;
}

/* ============================================================
   Main content
   ============================================================ */
.main-content {
  flex: 1;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid #e0e4ea;
  background: #fff;
}

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-dark);
  margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px 10px 0 0 !important;
}

.stat-card {
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.stat-card i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: 0.2;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .label {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

/* ============================================================
   Tables
   ============================================================ */
.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-grey);
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table td {
  font-size: 0.875rem;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: #f0f4ff;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: #0058a0;
  border-color: #0058a0;
}

.btn-sm i { font-size: 0.8rem; }

/* ============================================================
   Forms
   ============================================================ */
.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(0,104,185,0.15);
}

/* ============================================================
   FullCalendar overrides
   ============================================================ */
.fc-toolbar-title {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
}

.fc-button-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.fc-event {
  border-radius: 4px;
  font-size: 0.78rem;
}

/* ============================================================
   Login page
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo i {
  font-size: 2.5rem;
  color: var(--color-primary);
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-top: 0.5rem;
}

/* ============================================================
   Badges
   ============================================================ */
.badge { font-weight: 500; font-size: 0.75rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  #sidebar.mobile-open {
    transform: translateX(0);
  }

  #page-content {
    width: 100%;
  }
}
