:root {
  --brand-blue: #1c4fb4;
  --brand-blue-dark: #16367f;
  --brand-blue-soft: #2c65d8;
  --brand-cyan: #2f93ff;
  --brand-sky: #eaf3ff;
  --brand-panel: #ffffff;
  --brand-ink: #243648;
  --brand-muted: #72859a;
  --brand-border: #d8e4f3;
  --brand-shadow: 0 20px 45px rgba(16, 51, 113, 0.12);
}

body.theme-dark {
  --brand-sky: #111827;
  --brand-panel: rgba(17, 24, 39, 0.94);
  --brand-ink: #edf3fb;
  --brand-muted: #a9b8cc;
  --brand-border: #31425f;
  --brand-shadow: 0 20px 45px rgba(2, 6, 23, 0.45);
  background:
    radial-gradient(circle at top left, rgba(47, 147, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(28, 79, 180, 0.18), transparent 26%),
    linear-gradient(180deg, #0b1320 0%, #111c2f 100%);
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  color: var(--brand-ink);
  background:
    radial-gradient(circle at top left, rgba(47, 147, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(28, 79, 180, 0.18), transparent 24%),
    linear-gradient(180deg, #f5f9ff 0%, #edf3fb 100%);
  font-family: "Segoe UI", "Tahoma", sans-serif;
}

body.theme-dark .sidebar-link,
body.theme-dark .filter-card,
body.theme-dark .table-card,
body.theme-dark .form-card,
body.theme-dark .auth-card,
body.theme-dark .admin-surface,
body.theme-dark .dashboard-panel,
body.theme-dark .dashboard-focus-card,
body.theme-dark .dashboard-hero,
body.theme-dark .section-card,
body.theme-dark .stat-card,
body.theme-dark .sidebar-card {
  background: rgba(16, 24, 40, 0.9);
  color: var(--brand-ink);
}

body.theme-dark .sidebar-link:hover {
  background: rgba(28, 79, 180, 0.22);
  border-color: rgba(124, 162, 233, 0.28);
}

body.theme-dark .sidebar-link.is-active {
  color: #f8fbff;
  background: linear-gradient(180deg, rgba(47, 103, 213, 0.92) 0%, rgba(31, 83, 183, 0.96) 100%);
  border-color: rgba(124, 162, 233, 0.42);
  box-shadow: 0 14px 28px rgba(3, 10, 24, 0.34);
}

body.theme-dark .table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .text-secondary,
body.theme-dark .sidebar-kicker,
body.theme-dark .sidebar-module-title,
body.theme-dark .sidebar-section-title,
body.theme-dark .dashboard-subtitle,
body.theme-dark .panel-heading span,
body.theme-dark .hero-kicker,
body.theme-dark .table-card table thead th,
body.theme-dark .admin-table th,
body.theme-dark .notification-item__category,
body.theme-dark .notification-item__time,
body.theme-dark .notification-detail__empty,
body.theme-dark .notification-list__empty,
body.theme-dark .account-role,
body.theme-dark .app-footer-inner,
body.theme-dark .app-footer-inner a {
  color: #c8d5e6 !important;
}

body.theme-dark .dashboard-title,
body.theme-dark .page-header h1,
body.theme-dark .page-header .h2,
body.theme-dark .dashboard-focus-card h2,
body.theme-dark .panel-heading h3,
body.theme-dark .table-card table td,
body.theme-dark .table-card table th,
body.theme-dark .feature-icon,
body.theme-dark .feature-tile h2,
body.theme-dark .focus-list li,
body.theme-dark .event-item strong,
body.theme-dark .event-item div,
body.theme-dark .empty-note,
body.theme-dark .pill-item,
body.theme-dark .form-label {
  color: #edf3fb !important;
}

body:not(.theme-dark) .dashboard-title,
body:not(.theme-dark) .page-header h1,
body:not(.theme-dark) .page-header .h2,
body:not(.theme-dark) .dashboard-focus-card h2,
body:not(.theme-dark) .panel-heading h3,
body:not(.theme-dark) .table-card table td,
body:not(.theme-dark) .table-card table th,
body:not(.theme-dark) .form-label,
body:not(.theme-dark) .empty-note,
body:not(.theme-dark) .pill-item {
  color: #243648 !important;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(29, 114, 136, 0.25);
}

.app-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(90deg, var(--brand-blue-dark) 0%, var(--brand-blue) 45%, var(--brand-blue-soft) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.topbar-notification-row {
  position: relative;
  width: 100%;
  height: 0;
  margin: 0;
  z-index: 35;
}

.topbar-notification-inner {
  position: absolute;
  top: 0.55rem;
  right: 0.45rem;
  display: flex;
  justify-content: flex-end;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.65rem;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.35rem;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
}

.topbar-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  padding: 0.7rem 0.95rem;
  border-radius: 0.9rem;
  font-weight: 600;
}

.topbar-link.is-active,
.topbar-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.topbar-link.is-active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.app-shell {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0.6rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.sidebar-panel {
  position: sticky;
  top: 5.8rem;
  display: grid;
  gap: 1rem;
}

.sidebar-card,
.dashboard-panel,
.dashboard-focus-card,
.dashboard-hero,
.section-card,
.stat-card,
.filter-card,
.table-card,
.form-card,
.auth-card,
.admin-surface {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow);
  border-radius: 1.45rem;
}

.sidebar-card {
  padding: 1.2rem;
}

.sidebar-kicker {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b91ab;
}

.sidebar-module-title {
  margin-top: 0.45rem;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 800;
  color: #25374b;
}

.sidebar-nav-group + .sidebar-nav-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8eff8;
}

.sidebar-card-accent {
  background: linear-gradient(180deg, rgba(28, 79, 180, 0.96) 0%, rgba(47, 147, 255, 0.94) 100%);
  color: #fff;
}

.sidebar-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7f95;
  margin-bottom: 0.9rem;
}

.sidebar-card-accent .sidebar-section-title,
.sidebar-card-accent .sidebar-note {
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar-link {
  text-decoration: none;
  color: var(--brand-ink);
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  font-weight: 600;
  background: #f7fbff;
  border: 1px solid transparent;
}

.sidebar-link:hover {
  color: var(--brand-blue-dark);
  background: #eef5ff;
  border-color: #d7e5fb;
}

.sidebar-link.is-active {
  color: #fff;
  background: linear-gradient(180deg, #2f67d5 0%, #1f53b7 100%);
  border-color: #1f53b7;
  box-shadow: 0 12px 24px rgba(31, 83, 183, 0.18);
}

.content-panel {
  min-width: 0;
}

.account-widget {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  justify-content: flex-end;
}

.account-dropdown {
  position: relative;
}

.account-trigger {
  border: 0;
  background: transparent;
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
}

.account-trigger__chevron {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
}

.account-dropdown.is-open .account-trigger__chevron {
  transform: rotate(-135deg) translateX(-1px);
}

.account-menu {
  position: absolute;
  top: calc(100% + 0.9rem);
  right: 0;
  min-width: 320px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d9e6f7;
  border-radius: 1rem;
  box-shadow: 0 22px 50px rgba(16, 51, 113, 0.18);
  overflow: hidden;
  z-index: 120;
}

.account-avatar-panel {
  padding: 1rem 1.1rem 0.9rem;
  border-bottom: 1px solid #edf2fa;
  display: grid;
  gap: 0.45rem;
}

.account-avatar-panel__label {
  font-weight: 700;
  color: #4a5d73;
}

.account-avatar-panel__input {
  border-radius: 0.75rem;
}

.account-menu::before {
  content: "";
  position: absolute;
  top: -0.45rem;
  right: 1.3rem;
  width: 0.9rem;
  height: 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid #d9e6f7;
  border-top: 1px solid #d9e6f7;
  transform: rotate(45deg);
}

.account-menu__item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #25374b;
  text-decoration: none;
  border-bottom: 1px solid #edf2fa;
}

.page-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.invoice-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.invoice-preview-card {
  position: sticky;
  top: 6rem;
  padding: 1.25rem;
}

.invoice-preview-list {
  display: grid;
  gap: 0.15rem;
}

.invoice-preview-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e7eef8;
}

.invoice-preview-list span {
  color: var(--brand-muted);
}

.invoice-preview-list strong {
  text-align: right;
}

.invoice-preview-list__total strong {
  font-size: 1.1rem;
  color: var(--brand-blue-dark);
}

.invoice-preview-note {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: #f5f9ff;
  color: #51657b;
}

.invoice-pagination {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.invoice-pagination__summary {
  color: var(--brand-muted);
  font-weight: 600;
}

.btn.disabled,
.btn:disabled {
  pointer-events: none;
  opacity: 0.65;
}

body.theme-dark .invoice-preview-list div {
  border-bottom-color: #31425f;
}

body.theme-dark .invoice-preview-note {
  background: rgba(18, 35, 63, 0.92);
  color: #c8d5e6;
}

@media (max-width: 992px) {
  .invoice-create-layout {
    grid-template-columns: 1fr;
  }

  .invoice-preview-card {
    position: static;
  }
}

.account-menu__form {
  margin: 0;
}

.account-menu__content {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.account-menu__icon {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #59708a;
  flex-shrink: 0;
}

.account-menu__icon svg {
  width: 100%;
  height: 100%;
}

.account-menu__item:last-child {
  border-bottom: 0;
}

.account-menu__item--submenu {
  display: block;
  padding: 0;
}

.account-menu__label,
.account-menu__item--link {
  font-weight: 700;
}

.account-menu__item--link:hover {
  background: #f5f9ff;
  color: var(--brand-blue-dark);
}

.account-menu__item--button {
  text-align: left;
  cursor: pointer;
}

.account-menu__item--button:hover {
  background: #fff3f3;
  color: #c93f3f;
}

.account-menu__item--button:hover .account-menu__icon {
  color: #c93f3f;
}

.account-menu__submenu-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  color: #25374b;
}

.account-menu__value {
  color: #71849a;
  font-size: 0.92rem;
  margin-left: auto;
}

.account-menu__submenu-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.account-menu__submenu-trigger[aria-expanded="true"] .account-menu__submenu-chevron {
  transform: rotate(45deg);
}

.account-submenu {
  display: grid;
  gap: 0;
  padding: 0 0.6rem 0.8rem;
}

.account-submenu__option {
  border: 0;
  background: #f8fbff;
  color: #31465c;
  font-weight: 600;
  text-align: left;
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  margin-top: 0.45rem;
}

.account-submenu__option.is-active {
  background: #e7f1ff;
  color: var(--brand-blue-dark);
}

.theme-switch {
  border: 0;
  background: transparent;
  padding: 0;
}

.theme-switch__track {
  width: 3.25rem;
  height: 1.9rem;
  border-radius: 999px;
  background: #d8e4f7;
  display: block;
  padding: 0.2rem;
  transition: background 0.2s ease;
  position: relative;
}

.theme-switch__icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  z-index: 1;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.theme-switch__icon svg {
  width: 0.98rem;
  height: 0.98rem;
}

.theme-switch__thumb {
  position: absolute;
  left: 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #eff5ff 100%);
  box-shadow: 0 8px 18px rgba(20, 34, 56, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-switch[aria-pressed="true"] .theme-switch__track {
  background: #1f2b44;
}

.theme-switch__icon--sun {
  color: #f0a423;
  opacity: 1;
}

.theme-switch__icon--moon {
  color: #f8fbff;
  opacity: 0;
}

.theme-switch[aria-pressed="true"] .theme-switch__icon--sun {
  opacity: 0;
}

.theme-switch[aria-pressed="true"] .theme-switch__icon--moon {
  opacity: 1;
}

.theme-switch[aria-pressed="true"] .theme-switch__thumb {
  transform: translateX(1.35rem);
  background: linear-gradient(180deg, #4f76ff 0%, #7ca0ff 100%);
}

body.theme-dark .account-menu {
  background: rgba(22, 28, 39, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .account-menu::before {
  background: rgba(22, 28, 39, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .account-menu__item,
body.theme-dark .account-menu__submenu-trigger,
body.theme-dark .account-menu__item--link {
  color: #eef4fb;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .account-menu__icon {
  color: #9fb0c4;
}

body.theme-dark .account-menu__item--link:hover,
body.theme-dark .account-submenu__option {
  background: rgba(255, 255, 255, 0.05);
  color: #eef4fb;
}

body.theme-dark .account-menu__item--button:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #ffd0d0;
}

body.theme-dark .account-menu__item--button:hover .account-menu__icon {
  color: #ffd0d0;
}

body.theme-dark .account-menu__value {
  color: #9fb0c4;
}

body.theme-dark .account-submenu__option.is-active {
  background: rgba(76, 120, 255, 0.22);
}

body.theme-dark .account-avatar-panel {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .account-avatar-panel__label {
  color: #d8e2ef;
}

body.theme-dark .account-avatar-panel__input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef4fb;
}

.notification-shell {
  position: relative;
}

.topbar-notification-shell {
  display: flex;
  justify-content: flex-end;
  margin-right: 0;
}

.notification-bell {
  position: relative;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid #cfe0f7;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  color: var(--brand-blue-dark);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(16, 51, 113, 0.12);
}

.notification-bell:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e7f1ff 100%);
}

.notification-bell__icon {
  width: 1.3rem;
  height: 1.3rem;
  display: inline-flex;
}

.notification-bell__icon svg {
  width: 100%;
  height: 100%;
}

.notification-bell__badge {
  position: absolute;
  top: -0.2rem;
  right: -0.15rem;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  border: 2px solid #f5f9ff;
}

.notification-bell__badge.is-zero {
  background: #a9bad6;
}

.notification-center {
  position: absolute;
  top: calc(100% + 0.9rem);
  right: 0;
  width: min(92vw, 470px);
  background: rgba(23, 23, 27, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  z-index: 80;
}

.notification-center__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.notification-center__title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
}

.notification-center__toggle-all {
  border: 0;
  background: transparent;
  color: #2bb7ff;
  font-weight: 700;
  padding: 0;
}

.notification-center__mark-all {
  border: 0;
  background: transparent;
  color: #7acbff;
  font-weight: 700;
  padding: 0;
}

.notification-center__body {
  display: block;
  max-height: 460px;
  overflow-y: auto;
}

.notification-center__footer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.notification-list {
  padding: 0;
  background: transparent;
  display: grid;
  align-content: start;
  gap: 0;
}

.notification-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  border-radius: 0;
  padding: 1rem;
  display: grid;
  gap: 0.55rem;
}

.notification-item.is-active {
  background: rgba(255, 255, 255, 0.04);
}

.notification-item.is-read {
  opacity: 0.72;
}

.notification-item.is-unread .notification-item__title {
  font-weight: 800;
  color: #ffffff;
}

.notification-item__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.notification-item__title-wrap {
  display: grid;
  gap: 0.3rem;
}

.notification-item__category {
  color: #80838c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notification-item__status-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  border: 1px solid #ff533d;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.notification-item__status-dot.is-read {
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
}

.notification-item__time {
  font-size: 0.82rem;
  color: #9a9da6;
}

.notification-item__title {
  font-size: 1.25rem;
  color: #b9bbc2;
  text-transform: uppercase;
  line-height: 1.25;
}

.notification-item__summary {
  font-size: 0.92rem;
  color: #9ea2ab;
  line-height: 1.55;
}

.notification-item__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.notification-item__time::before {
  content: "◔";
  margin-right: 0.35rem;
  color: #8d9099;
}

.notification-item__detail {
  margin-top: 0.2rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.notification-item__detail-text {
  color: #d3d5db;
  line-height: 1.7;
  font-size: 0.92rem;
}

.notification-detail__empty,
.notification-list__empty {
  color: #9ea2ab;
  line-height: 1.7;
  padding: 1rem;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.account-avatar {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(180deg, #fff 0%, #dce9ff 100%);
  color: var(--brand-blue-dark);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(16, 51, 113, 0.16);
}

.account-avatar-button {
  cursor: pointer;
}

.account-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-avatar__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.account-name {
  display: block;
  font-weight: 700;
  line-height: 1.1;
}

.account-role {
  display: block;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.account-button {
  min-width: 112px;
  border-radius: 999px;
  font-weight: 700;
  padding-inline: 1rem;
}

.account-button-primary {
  color: var(--brand-blue);
}

.btn-action-view,
.btn-action-edit,
.btn-action-delete {
  border-width: 1px;
  font-weight: 700;
  border-radius: 999px;
}

.btn-action-view,
.btn-action-view:hover,
.btn-action-view:focus {
  background: linear-gradient(180deg, #4f8dff 0%, #2f67d5 100%);
  border-color: #2f67d5;
  color: #fff;
}

.btn-action-edit,
.btn-action-edit:hover,
.btn-action-edit:focus {
  background: linear-gradient(180deg, #ffc95c 0%, #f2a929 100%);
  border-color: #f2a929;
  color: #3d2c00;
}

.btn-action-delete,
.btn-action-delete:hover,
.btn-action-delete:focus {
  background: linear-gradient(180deg, #ff6d6d 0%, #dd3f3f 100%);
  border-color: #dd3f3f;
  color: #fff;
}

.btn-action-view.btn-sm,
.btn-action-edit.btn-sm,
.btn-action-delete.btn-sm {
  padding-inline: 0.9rem;
}

.action-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(20, 34, 56, 0.4);
  backdrop-filter: blur(8px);
}

.action-dialog {
  width: min(100%, 440px);
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--brand-border);
  box-shadow: 0 24px 60px rgba(20, 34, 56, 0.22);
  display: grid;
  gap: 1rem;
}

.action-dialog--success {
  animation: action-dialog-celebrate 0.5s cubic-bezier(0.2, 0.9, 0.22, 1.1);
}

.action-dialog__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.action-dialog__kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-dialog__title {
  margin: 0.3rem 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: #203247;
}

.action-dialog__description {
  margin: 0.5rem 0 0;
  color: #61758c;
  line-height: 1.7;
}

.action-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.action-dialog__actions .btn {
  min-width: 118px;
  border-radius: 999px;
  font-weight: 700;
}

.action-dialog--create .action-dialog__icon {
  background: rgba(27, 172, 117, 0.12);
  color: #18875c;
}

.action-dialog--create .action-dialog__kicker {
  color: #18875c;
}

.action-dialog--create #actionDialogConfirm {
  background: linear-gradient(180deg, #2cb673 0%, #1d925b 100%);
  border-color: #1d925b;
  color: #fff;
}

.action-dialog--edit .action-dialog__icon {
  background: rgba(255, 185, 62, 0.15);
  color: #aa6d0e;
}

.action-dialog--edit .action-dialog__kicker {
  color: #aa6d0e;
}

.action-dialog--edit #actionDialogConfirm {
  background: linear-gradient(180deg, #ffbc42 0%, #f29d16 100%);
  border-color: #f29d16;
  color: #3c2a00;
}

.action-dialog--delete .action-dialog__icon {
  background: rgba(227, 74, 74, 0.12);
  color: #c43a3a;
}

.action-dialog--delete .action-dialog__kicker {
  color: #c43a3a;
}

.action-dialog--delete #actionDialogConfirm {
  background: linear-gradient(180deg, #eb5757 0%, #cf3535 100%);
  border-color: #cf3535;
  color: #fff;
}

.action-dialog--success .action-dialog__icon {
  background: radial-gradient(circle at top, rgba(66, 205, 128, 0.24), rgba(32, 171, 96, 0.12));
  color: #17945c;
  box-shadow: 0 0 0 10px rgba(50, 191, 110, 0.08);
}

.action-dialog--success .action-dialog__kicker {
  color: #17945c;
}

.action-dialog--success #actionDialogConfirm {
  background: linear-gradient(180deg, #2cc777 0%, #199d5b 100%);
  border-color: #199d5b;
  color: #fff;
}

@keyframes action-dialog-celebrate {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }

  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.92rem;
  border-radius: 999px;
  background: #eaf4ff;
  color: #2672a3;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-page,
.page-shell,
.admin-page {
  display: grid;
  gap: 1.4rem;
}

.dashboard-hero {
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before,
.dashboard-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.dashboard-hero::before {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(47, 147, 255, 0.18) 0%, transparent 70%);
  top: -120px;
  right: -100px;
}

.dashboard-hero::after {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(28, 79, 180, 0.14) 0%, transparent 70%);
  bottom: -110px;
  left: -90px;
}

.dashboard-intro,
.dashboard-focus-card {
  position: relative;
  z-index: 1;
}

.dashboard-title {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 3.3vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #26394c;
}

.dashboard-subtitle {
  max-width: 760px;
  font-size: 1.18rem;
  line-height: 1.75;
  color: var(--brand-muted);
}

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.dashboard-focus-card {
  padding: 1.6rem;
  border: 1px solid #cfe0f5;
}

.focus-list li {
  padding: 0.95rem 0;
  border-bottom: 1px solid #e6eef8;
  font-size: 1.04rem;
}

.focus-list li:last-child {
  border-bottom: 0;
}

.feature-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-tile {
  min-height: 180px;
  border-radius: 1.35rem;
  padding: 1.35rem;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 18px 45px rgba(21, 56, 126, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.feature-tile::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.feature-tile:hover {
  transform: translateY(-4px);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 24px 55px rgba(21, 56, 126, 0.24);
  color: #fff;
}

.feature-icon {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 1.2rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  font-weight: 800;
  font-size: 1.35rem;
}

.feature-tile h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.55rem;
  font-size: 1.9rem;
  font-weight: 800;
}

.feature-tile p {
  margin: 0;
  max-width: 360px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.02rem;
}

.tile-students { background: linear-gradient(135deg, #286fff 0%, #4a95ff 100%); }
.tile-classes { background: linear-gradient(135deg, #1fb9a6 0%, #63d1a8 100%); }
.tile-teachers { background: linear-gradient(135deg, #ff9a37 0%, #ffc35d 100%); }
.tile-subjects { background: linear-gradient(135deg, #f0626b 0%, #ff7f6d 100%); }
.tile-finance { background: linear-gradient(135deg, #8bc53f 0%, #b6d94a 100%); }
.tile-admin { background: linear-gradient(135deg, #5868ea 0%, #7a83ff 100%); }

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-panel {
  padding: 1.4rem;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.panel-heading span {
  color: var(--brand-muted);
  font-weight: 600;
}

.news-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e7eef7;
}

.news-list li:last-child {
  border-bottom: 0;
}

.news-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  margin-top: 0.4rem;
}

.news-dot-red { background: #f45b5b; }
.news-dot-blue { background: #2f93ff; }
.news-dot-green { background: #8bc53f; }

.event-list {
  display: grid;
  gap: 0.9rem;
}

.event-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e7eef7;
}

.event-item:last-child {
  border-bottom: 0;
}

.event-date {
  border-radius: 1rem;
  background: linear-gradient(180deg, #f1f7ff 0%, #dceaff 100%);
  color: var(--brand-blue-dark);
  text-align: center;
  padding: 0.55rem 0.25rem;
}

.event-date strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.event-date span {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-action-btn {
  min-width: 220px;
  text-align: center;
  text-decoration: none;
  padding: 0.95rem 1.35rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(28, 79, 180, 0.18);
}

.dashboard-action-btn:hover {
  color: #fff;
  transform: translateY(-2px);
}

.auth-shell {
  min-height: calc(100vh - 260px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 560px);
  padding: 1.8rem;
}

.module-grid,
.detail-grid,
.stats-grid {
  display: grid;
  gap: 1.25rem;
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.section-card,
.stat-card,
.filter-card,
.table-card,
.form-card,
.admin-surface {
  padding: 1.25rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-list {
  display: grid;
  gap: 0.8rem;
}

.meta-list dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
}

.meta-list dd {
  margin: 0;
  font-weight: 600;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-item {
  display: inline-flex;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--brand-blue-dark);
  font-weight: 700;
}

.empty-note {
  color: var(--brand-muted);
  font-style: italic;
}

.table-card table td,
.table-card table th {
  vertical-align: middle;
}

.table-card table thead th,
.admin-table th {
  color: var(--brand-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-hover tbody tr:hover {
  background: #f4f9ff;
}

.list-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.check-list {
  min-height: 150px;
}

.btn {
  border-radius: 0.95rem;
}

.btn-primary {
  background: linear-gradient(180deg, #2479dd 0%, #1d58c5 100%);
  border-color: #1d58c5;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(180deg, #1f6bc6 0%, #174ea8 100%);
  border-color: #174ea8;
}

.btn-outline-primary {
  color: var(--brand-blue-dark);
  border-color: #7aa5ef;
  background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: #edf4ff;
  color: var(--brand-blue-dark);
  border-color: #5d8fe2;
}

.form-control,
.form-select,
.form-check-input {
  border-radius: 0.95rem;
}

.password-field {
  position: relative;
}

.password-field .form-floating {
  position: relative;
}

.password-field .form-control {
  padding-right: 3.5rem;
}

.password-field .form-floating > label {
  padding-right: 3.5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4f6075;
  z-index: 3;
}

.date-input-shell {
  position: relative;
}

.date-input-control {
  padding-right: 3.25rem;
}

.date-input-control::placeholder {
  color: #8ca0b8;
  letter-spacing: 0.04em;
}

.date-input-button {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4f6075;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.date-input-button:hover,
.date-input-button:focus {
  background: #edf4ff;
  color: var(--brand-blue-dark);
}

.date-picker {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(18rem, 100%);
  min-width: 17rem;
  padding: 0.9rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 35px rgba(16, 51, 113, 0.18);
  z-index: 20;
}

.date-picker__header,
.date-picker__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.date-picker__title {
  font-weight: 700;
  color: var(--brand-ink);
  text-align: center;
  flex: 1;
  min-width: 0;
}

.date-picker__nav,
.date-picker__action {
  border: 0;
  border-radius: 0.8rem;
  background: #eef4ff;
  color: var(--brand-blue-dark);
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
}

.date-picker__nav {
  flex: 0 0 auto;
}

.date-picker__nav:hover,
.date-picker__nav:focus,
.date-picker__action:hover,
.date-picker__action:focus {
  background: #dfeafd;
}

.date-picker__action--primary {
  background: linear-gradient(180deg, #2479dd 0%, #1d58c5 100%);
  color: #fff;
}

.date-picker__action--primary:hover,
.date-picker__action--primary:focus {
  background: linear-gradient(180deg, #1f6bc6 0%, #174ea8 100%);
}

.date-picker__weekdays,
.date-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
.student-code-field {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
.student-code-field .form-control {
  flex: 1 1 auto;
}
.student-code-reset {
  white-space: nowrap;
  border-radius: 1rem;
}
}

.date-picker__weekdays {
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
}

.date-picker__weekday,
.date-picker__pad {
  display: grid;
  place-items: center;
  min-height: 2rem;
}

.date-picker__weekday {
  color: #6a7f95;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.date-picker__day {
  border: 0;
  border-radius: 0.8rem;
  min-height: 2.35rem;
  background: transparent;
  color: var(--brand-ink);
  font-weight: 600;
}

.date-picker__day:hover,
.date-picker__day:focus {
  background: #edf4ff;
}

.date-picker__day.is-today {
  box-shadow: inset 0 0 0 1px #9dbbf2;
}

.date-picker__day.is-selected {
  background: linear-gradient(180deg, #2479dd 0%, #1d58c5 100%);
  color: #fff;
}

body.theme-dark .date-picker {
  background: rgba(16, 24, 40, 0.98);
  border-color: #31425f;
}

body.theme-dark .date-input-button {
  color: #c8d5e6;
}

body.theme-dark .date-input-button:hover,
body.theme-dark .date-input-button:focus,
body.theme-dark .date-picker__nav,
body.theme-dark .date-picker__action {
  background: rgba(49, 66, 95, 0.82);
  color: #edf3fb;
}

body.theme-dark .date-picker__nav:hover,
body.theme-dark .date-picker__nav:focus,
body.theme-dark .date-picker__action:hover,
body.theme-dark .date-picker__action:focus,
body.theme-dark .date-picker__day:hover,
body.theme-dark .date-picker__day:focus {
  background: rgba(63, 86, 123, 0.9);
}

body.theme-dark .date-picker__title,
body.theme-dark .date-picker__day {
  color: #edf3fb;
}

body.theme-dark .date-picker__weekday {
  color: #c8d5e6;
}

.password-toggle:hover {
  background: rgba(28, 79, 180, 0.08);
  color: var(--brand-blue-dark);
}

.password-toggle__icon {
  width: 1.28rem;
  height: 1.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle__icon svg {
  width: 100%;
  height: 100%;
}

body.theme-dark .password-toggle {
  color: #c7d5e6;
}

body.theme-dark .password-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.form-control,
.form-select {
  border-color: #c9d8ef;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(36, 121, 221, 0.55);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--brand-blue-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.role-grid {
  display: grid;
  gap: 0.75rem;
}

.role-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: #fff;
}

.role-option label {
  font-weight: 700;
}

.role-option small {
  display: block;
  color: var(--brand-muted);
}

.alert-inline,
.auth-side-note {
  border-radius: 1rem;
}

.auth-side-note {
  background: #f2f7ff;
  padding: 1rem;
}

.app-footer {
  padding: 0 1.25rem 1.5rem;
}

.app-footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--brand-muted);
}

.app-footer-inner a {
  color: var(--brand-blue-dark);
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    position: static;
  }

  .page-header {
    align-items: stretch;
  }

  .dashboard-hero,
  .feature-dashboard-grid,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .topbar-brand {
    font-size: 1.25rem;
  }

  .dashboard-title {
    font-size: 2.3rem;
  }

  .dashboard-actions,
  .dashboard-quick-actions,
.account-widget,
.account-actions {
    width: 100%;
  }

  .dashboard-action-btn,
  .account-button {
    width: 100%;
  }
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}