/* =============================================
   BASE LAYOUT — Shared across all pages
   ============================================= */

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

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

:root {
  --nav-height: 52px;
  --sidebar-width: 200px;

  /* Brand */
  --brand-primary: #0096D6;
  --brand-dark:    #007BB8;
  --brand-light:   #E8F6FD;

  /* Sidebar */
  --sidebar-bg: #D9D9D9;
  --sidebar-active-border: #0096D6;
  --sidebar-active-bg: #FFFFFF;
  --sidebar-text: #1A1A1A;
  --sidebar-hover-bg: #C8C8C8;

  /* Surfaces */
  --bg-page: #F5F5F5;
  --bg-card: #FFFFFF;
  --bg-card-inner: #EBEBEB;

  /* Text */
  --text-primary:   #1A1A1A;
  --text-secondary: #555555;
  --text-muted:     #888888;

  /* Borders / Shadows */
  --border-color: #D0D0D0;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --card-radius: 10px;

  /* Inputs */
  --input-border: #C5C5C5;
  --input-focus:  #0096D6;
  --input-bg:     #FFFFFF;
  --input-radius: 6px;

  /* Transitions */
  --transition: 200ms ease;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
}

/* =============================================
   NAVBAR
   ============================================= */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background var(--transition);
}
.hamburger-btn:hover { background: rgba(255,255,255,0.15); }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: var(--transition);
}

.navbar-brand {
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logout {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.4);
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
  background: none;
  font-family: inherit;
}
.nav-logout:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.7);
}

/* =============================================
   APP SHELL (sidebar + content)
   ============================================= */

.app-shell {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 250ms ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.sidebar-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 16px 4px;
  white-space: nowrap;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-item:hover {
  background: var(--sidebar-hover-bg);
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  border-left-color: var(--sidebar-active-border);
  color: var(--brand-primary);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.65;
}
.nav-item.active svg { opacity: 1; }

/* Expandable caret */
.nav-caret {
  margin-left: auto;
  transition: transform 300ms ease;
  opacity: 0.5;
}
.nav-item.expanded .nav-caret {
  transform: rotate(180deg);
}

/* Submenu */
.nav-submenu {
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease;
}
.nav-submenu.open {
  max-height: 600px;
}
.nav-submenu .nav-item {
  padding-left: 36px;
  font-size: 13px;
  font-weight: 400;
  border-left: 3px solid transparent;
}
.nav-submenu .nav-item.active {
  border-left-color: var(--sidebar-active-border);
  background: var(--sidebar-active-bg);
  color: var(--brand-primary);
}

/* =============================================
   MAIN CONTENT
   ============================================= */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 32px;
  min-height: calc(100vh - var(--nav-height));
  transition: margin-left 250ms ease;
}

.sidebar.collapsed + .main-content {
  margin-left: 0;
}

/* Page header */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left {}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.breadcrumb a {
  color: var(--brand-primary);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: 0.5; }

/* =============================================
   CARD
   ============================================= */

.card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.card-inner {
  background: var(--bg-card-inner);
  border-radius: var(--card-radius);
  padding: 24px 28px;
}

/* =============================================
   FORM STYLES
   ============================================= */

.form-section {
  margin-bottom: 28px;
}
.form-section:last-of-type { margin-bottom: 0; }

.form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 2.5px solid var(--text-primary);
  margin-bottom: 18px;
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.form-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 130px;
}

.form-colon {
  color: var(--text-muted);
  font-weight: 500;
}

.form-control {
  flex: 1;
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--input-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(0,150,214,0.15);
}
.form-control::placeholder {
  color: var(--text-muted);
  font-size: 12.5px;
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Form actions */
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(0,150,214,0.35);
}

.btn-secondary {
  background: #f0f0f0;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: #e2e2e2; }

.btn-success {
  background: #2E7D32;
  color: #ffffff;
}
.btn-success:hover {
  background: #1B5E20;
  box-shadow: 0 4px 12px rgba(46,125,50,0.35);
}

.btn-danger {
  background: #E53935;
  color: #ffffff;
}
.btn-danger:hover {
  background: #C62828;
  box-shadow: 0 4px 12px rgba(229,57,53,0.35);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary);
}
.btn-outline:hover {
  background: var(--brand-light);
}

/* =============================================
   REQUIRED STAR
   ============================================= */
.req { color: #E53935; margin-left: 2px; }

/* =============================================
   UTILITY
   ============================================= */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 16px; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #B0B0B0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #909090; }

/* =============================================
   OVERLAY for mobile
   ============================================= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 850;
}
.sidebar-overlay.visible { display: block; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .sidebar { width: 0; }
  .sidebar.mobile-open {
    width: var(--sidebar-width);
    box-shadow: 4px 0 20px rgba(0,0,0,0.18);
  }
  .main-content { margin-left: 0 !important; padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
}
