:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-low: #f2f4f6;
  --surface-container: #eceef0;
  --surface-variant: #e0e3e5;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --text: #191c1e;
  --text-muted: #43474e;
  --primary: #163a63;
  --primary-strong: #002447;
  --secondary: #1c6d13;
  --secondary-soft: #a0f48a;
  --danger-soft: #ffdad6;
  --danger-text: #93000a;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --shadow-soft: 0 4px 6px -1px rgba(22, 58, 99, 0.05), 0 2px 4px -2px rgba(22, 58, 99, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
}

.material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: "FILL" 0, "wght" 200, "GRAD" 0, "opsz" 24;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: block;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: block;
  width: 100%;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 224px;
  height: auto;
  margin: 0 auto;
}

.sidebar-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
}

.sidebar-link:hover {
  background: rgba(22, 58, 99, 0.06);
}

.sidebar-link.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--border);
}

.sidebar-link.is-active .material-symbols-rounded {
  color: var(--secondary);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 16px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.user-chip .material-symbols-rounded {
  font-size: 24px;
  color: var(--primary);
}

.user-chip-name {
  font-weight: 600;
}

.user-chip-role {
  color: var(--text-muted);
  text-transform: capitalize;
  font-size: 12px;
}

.content-area {
  flex: 1;
  padding: 32px;
  max-width: calc(1440px + 64px);
}

.page-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.notification-preview-card {
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.notification-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.notification-preview-list {
  display: grid;
  gap: 8px;
}

.notification-preview-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-low);
  color: var(--text);
}

.notification-preview-item.is-unread {
  border-left: 3px solid var(--secondary);
  background: #f5fbf3;
}

.notification-preview-title {
  font-weight: 600;
}

.notification-preview-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.page-title {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.flatpickr-input[readonly],
.flatpickr-input[readonly]:focus {
  background-color: var(--surface);
  cursor: pointer;
}

.flatpickr-calendar {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(22, 58, 99, 0.14);
  padding: 10px;
  font-family: "Inter", sans-serif;
}

.flatpickr-months {
  margin-bottom: 8px;
}

.flatpickr-current-month {
  padding-top: 4px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-weight: 600;
  color: var(--primary);
}

.flatpickr-weekdays {
  background: transparent;
}

span.flatpickr-weekday {
  color: var(--text-muted);
  font-weight: 600;
}

.flatpickr-day {
  border-radius: 10px;
  color: var(--text);
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: rgba(22, 58, 99, 0.08);
  border-color: transparent;
}

.flatpickr-day.today {
  border-color: var(--secondary);
  color: var(--secondary);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.flatpickr-day.inRange {
  box-shadow: -5px 0 0 rgba(22, 58, 99, 0.08), 5px 0 0 rgba(22, 58, 99, 0.08);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(22, 58, 99, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(28, 109, 19, 0.08), transparent 24%),
    var(--bg);
}

.auth-flash {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 32px, 420px);
  z-index: 20;
}

.auth-flash,
.flash-stack {
  margin-bottom: 16px;
}

.auth-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.auth-card-body {
  padding: 32px;
}

.auth-card-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-card-title {
  margin: 16px 0 6px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: normal;
  overflow-wrap: normal;
}

.auth-card-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.auth-form .form-control {
  min-height: 48px;
}

.auth-support-link {
  text-align: center;
}

.auth-support-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-support-link a:hover {
  text-decoration: underline;
}

.login-logo {
  width: 132px;
  height: auto;
  display: inline-block;
}

.app-alert {
  border-radius: 12px;
  border-width: 1px;
  box-shadow: none;
}

.card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
}

.card-body {
  padding: 20px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 20px;
}

.stat-card .text-muted,
.text-muted {
  color: var(--text-muted) !important;
}

.stat-value {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.quota-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.quota-year-field {
  flex: 0 0 auto;
}

.quota-year-select {
  min-width: 160px;
}

.quota-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.quota-tabs-inline {
  flex: 1;
  margin-bottom: 0;
  align-self: flex-end;
}

.quota-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.quota-tab:hover {
  background: var(--surface-low);
}

.quota-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.settings-tab:hover {
  background: var(--surface-low);
}

.settings-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.settings-tab-panel {
  display: none;
  width: 100%;
}

.settings-tab-panel.is-active {
  display: block;
}

.quota-tab.is-active .quota-tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.quota-period-header {
  margin-bottom: 12px;
}

.empty-state {
  color: var(--text-muted);
}

.notifications-list {
  display: grid;
  gap: 14px;
}

.notification-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.notification-card.is-unread {
  border-left: 4px solid var(--secondary);
  background: #f7fcf5;
}

.notification-main {
  flex: 1;
}

.notification-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.notification-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.notification-meta,
.notification-read-state {
  color: var(--text-muted);
  font-size: 12px;
}

.notification-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.notification-message {
  margin: 0;
}

.notification-actions {
  display: flex;
  align-items: center;
}

@media (max-width: 992px) {
  .quota-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .quota-tabs-inline {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .auth-card-body {
    padding: 24px;
  }

  .auth-card-title {
    font-size: 28px;
  }
}

.btn {
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: none;
}

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

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

.btn-secondary,
.btn-outline-secondary {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  background: var(--surface-low);
  color: var(--text);
  border-color: var(--border);
}

.form-control,
.form-select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 58, 99, 0.12);
}

.form-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.table thead th {
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
}

.table tbody td {
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f8fafc;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--primary);
}

.icon-link:hover {
  background: rgba(22, 58, 99, 0.08);
  color: var(--primary-strong);
}

.list-group-item {
  border-color: var(--border-soft);
  padding: 12px 16px;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
}

.badge-paid,
.badge-active {
  background: rgba(95, 175, 78, 0.14);
  color: #1e5d17;
}

.badge-overdue,
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.badge-partial,
.badge-pending {
  background: rgba(237, 180, 46, 0.18);
  color: #8b5e00;
}

.metric-list {
  display: grid;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.metric-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

@media (max-width: 991px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .content-area {
    padding: 16px;
  }

  .page-topbar,
  .section-header {
    display: block;
  }
}
