@font-face {
  font-family: "JetBrains Mono";
  src: url("/css/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #157347;
  --brand-dark: #0d5132;
  --brand-soft: #e8f5ee;
  --brand-ring: rgba(21, 115, 71, 0.15);
  --ink: #18231d;
  --muted: #67756c;
  --border: #e1e8e3;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --bg: #f1f5f2;
  --sidebar: #0f3d2b;
  --sidebar-dark: #0a2e20;
  --danger: #c0392b;
  --warning: #b7791f;
  --info: #1d6fb8;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(15, 61, 43, 0.05);
  --shadow: 0 14px 38px rgba(15, 61, 43, 0.08);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--brand-dark);
}

.font-monospace,
code,
pre,
kbd,
samp {
  font-family: var(--mono) !important;
}

.btn-success {
  --bs-btn-bg: #157347;
  --bs-btn-border-color: #157347;
  --bs-btn-hover-bg: #0d5c39;
  --bs-btn-hover-border-color: #0d5c39;
  --bs-btn-active-bg: #0a4d2f;
  --bs-btn-active-border-color: #0a4d2f;
  --bs-btn-disabled-bg: #157347;
  --bs-btn-disabled-border-color: #157347;
}

.btn-outline-success {
  --bs-btn-color: #157347;
  --bs-btn-border-color: #157347;
  --bs-btn-hover-bg: #157347;
  --bs-btn-hover-border-color: #157347;
}

.form-control:focus,
.form-select:focus {
  border-color: #7bc4a2;
  box-shadow: 0 0 0 0.2rem var(--brand-ring);
}

/* ============================== APP SHELL ============================== */

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

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: 272px;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.9rem 1rem;
  color: #eaf5ef;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-dark) 100%);
  box-shadow: 16px 0 42px rgba(10, 46, 32, 0.18);
  transition: width 0.25s ease, transform 0.25s ease;
  overflow: hidden auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.35rem 0.5rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2fbf78, #157347);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.brand-mark-lg {
  width: 54px;
  height: 54px;
  font-size: 1.45rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.brand-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: rgba(234, 245, 239, 0.65);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: rgba(234, 245, 239, 0.78);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-link i {
  font-size: 1.12rem;
  flex: 0 0 1.3rem;
  text-align: center;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 #49d18c;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: rgba(234, 245, 239, 0.62);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #dff3e8;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 0.72rem;
}

.app-main {
  min-height: 100vh;
  margin-left: 272px;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0.55rem 1.4rem;
  background: linear-gradient(90deg, var(--brand) 0%, #1a8353 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(15, 61, 43, 0.16);
}

.topbar-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.45rem;
}

.topbar-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.topbar-title {
  flex-grow: 1;
  min-width: 0;
  font-size: 0.9rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: right;
}

.topbar-user-name {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.1;
}

.topbar-user-role {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
}

.app-content {
  flex-grow: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.6rem;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.6rem 1.4rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.sidebar-backdrop {
  display: none;
}

@media (min-width: 992px) {
  .sidebar-collapsed .app-sidebar {
    width: 86px;
  }

  .sidebar-collapsed .app-main {
    margin-left: 86px;
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .sidebar-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .sidebar-collapsed .sidebar-brand,
  .sidebar-collapsed .sidebar-link {
    justify-content: center;
  }

  .sidebar-collapsed .sidebar-footer {
    align-items: center;
  }

  .sidebar-collapsed .sidebar-footer .btn {
    width: 42px !important;
    padding-inline: 0;
    font-size: 0;
  }

  .sidebar-collapsed .sidebar-footer .btn i {
    font-size: 0.95rem;
    margin: 0 !important;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    width: min(280px, calc(100vw - 52px));
    transform: translateX(-102%);
  }

  .app-main {
    margin-left: 0;
  }

  .sidebar-open {
    overflow: hidden;
  }

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

  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(8, 24, 17, 0.45);
    backdrop-filter: blur(1px);
  }
}

/* ============================== LOGIN ============================== */

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  background: var(--bg);
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 3.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 15% 20%, rgba(73, 209, 140, 0.28), transparent 42%),
    radial-gradient(circle at 85% 90%, rgba(29, 111, 184, 0.28), transparent 45%),
    linear-gradient(160deg, #0f3d2b 0%, #0a2e20 100%);
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.login-brand-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.login-brand-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.login-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.login-hero-copy h1 {
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.login-hero-copy p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0;
}

.login-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.login-feature {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-feature i {
  font-size: 1.25rem;
  color: #6ee7a8;
}

.login-feature strong {
  font-size: 0.88rem;
}

.login-feature span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.45;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 2.5rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.4rem;
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-demo {
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border);
}

.login-demo-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

@media (max-width: 991.98px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }
}

@media (max-width: 575.98px) {
  .login-card {
    padding: 1.6rem;
    border-radius: 18px;
  }

  .login-panel {
    padding: 1rem;
  }
}

/* ============================== PANELS & CARDS ============================== */

.panel {
  padding: 1.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel.p-0 {
  padding: 0 !important;
}

.panel-heading {
  margin-bottom: 1.1rem;
}

.panel-heading p {
  font-size: 0.84rem;
}

.page-heading h1 {
  letter-spacing: -0.02em;
  font-weight: 700;
}

.page-heading p {
  font-size: 0.9rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.metric-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 13px;
  font-size: 1.35rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric-label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.tone-green .metric-icon {
  background: #e4f6ec;
  color: #157347;
}

.tone-blue .metric-icon {
  background: #e5f0fb;
  color: #1d6fb8;
}

.tone-amber .metric-icon {
  background: #fdf3e2;
  color: #b7791f;
}

.tone-rose .metric-icon {
  background: #fce9e7;
  color: #c0392b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 1.2rem;
  align-items: start;
}

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

@media (max-width: 991.98px) {
  .metric-grid,
  .metric-grid-3,
  .metric-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .metric-grid,
  .metric-grid-3,
  .metric-grid-4 {
    grid-template-columns: 1fr;
  }

  .app-content {
    padding: 1rem;
  }

  .app-footer {
    flex-direction: column;
    padding-inline: 1rem;
  }
}

/* ============================== DASHBOARD ============================== */

.today-summary {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  flex-wrap: wrap;
}

.donut {
  position: relative;
  width: 186px;
  height: 186px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.donut-hole {
  position: absolute;
  inset: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border);
}

.donut-hole strong {
  font-size: 1.85rem;
  line-height: 1.1;
}

.donut-hole span {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.today-counts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-grow: 1;
  min-width: 170px;
}

.today-count-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 0.88rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-dot.status-H {
  background: #157347;
}

.status-dot.status-S {
  background: #d69e2e;
}

.status-dot.status-I {
  background: #1d6fb8;
}

.status-dot.status-A {
  background: #c0392b;
}

.checkin-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.checkin-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  background:
    radial-gradient(circle at 0% 0%, rgba(21, 115, 71, 0.1), transparent 35%),
    var(--surface);
}

/* ============================== STATUS BADGES ============================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 46px;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge.status-H,
.status-badge.status-hadir {
  background: #e4f6ec;
  color: #0f6b41;
  border-color: #b9e6cf;
}

.status-badge.status-S {
  background: #fdf3e2;
  color: #9a6414;
  border-color: #f2d9ab;
}

.status-badge.status-I {
  background: #e5f0fb;
  color: #175c99;
  border-color: #bdd8f4;
}

.status-badge.status-A {
  background: #fce9e7;
  color: #a12b1f;
  border-color: #f3c5bf;
}

.status-badge.status-empty {
  background: #f1f4f2;
  color: #8a978e;
  border-color: #e0e6e2;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 1rem;
}

.status-dot-inline {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  vertical-align: middle;
}

.status-dot-inline.status-H {
  background: #157347;
}

.status-dot-inline.status-S {
  background: #d69e2e;
}

.status-dot-inline.status-I {
  background: #1d6fb8;
}

.status-dot-inline.status-A {
  background: #c0392b;
}

.status-dot-inline.status-empty {
  background: #dbe2dd;
}

/* ============================== TABLES ============================== */

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  font-size: 0.87rem;
}

.table > :not(caption) > * > * {
  padding: 0.72rem 0.8rem;
  border-color: #edf1ee;
  vertical-align: middle;
}

.table thead th {
  background: #f8faf9;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover > * {
  background: #fbfdfb;
}

.progress-thin {
  height: 6px;
  border-radius: 999px;
  background: #e8eeea;
}

.progress-thin .progress-bar {
  border-radius: 999px;
}

/* ============================== ATTENDANCE TABLE ============================== */

.attendance-table-wrap {
  max-height: 70vh;
}

.table-absence {
  min-width: max-content;
  font-size: 0.82rem;
}

.table-absence thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f3f7f4;
}

.table-absence th:nth-child(1),
.table-absence td:nth-child(1) {
  position: sticky;
  left: 0;
  width: 48px;
  min-width: 48px;
  background: #fff;
  z-index: 2;
}

.table-absence th:nth-child(2),
.table-absence td:nth-child(2) {
  position: sticky;
  left: 48px;
  width: 100px;
  min-width: 100px;
  background: #fff;
  z-index: 2;
}

.table-absence th:nth-child(3),
.table-absence td:nth-child(3) {
  position: sticky;
  left: 148px;
  min-width: 210px;
  background: #fff;
  z-index: 2;
  box-shadow: 8px 0 12px -10px rgba(15, 61, 43, 0.35);
}

.table-absence thead th:nth-child(1),
.table-absence thead th:nth-child(2),
.table-absence thead th:nth-child(3) {
  z-index: 5;
  background: #eef5f0;
}

.table-absence tbody tr.row-editable td {
  background: #fcfffd;
}

.table-absence tbody tr.row-editable:hover td {
  background: #f5fbf7;
}

.table-absence .row-index {
  color: var(--muted);
  text-align: center;
}

.day-column {
  width: 36px;
  min-width: 36px;
  padding: 0.35rem 0.2rem !important;
  text-align: center;
  line-height: 1.05;
}

.day-column span {
  display: block;
  font-size: 0.78rem;
}

.day-column small {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  color: #98a49c;
}

.day-column.day-holiday {
  background: #fdf2f8 !important;
  color: #9d174d;
}

.day-column.day-holiday small {
  color: #c9739e;
}

.day-column.day-today {
  background: #e4f6ec !important;
  color: #0f6b41;
  box-shadow: inset 0 -3px 0 #157347;
}

.day-column.day-today small {
  color: #157347;
}

.cell-select {
  width: 33px;
  height: 29px;
  padding: 0;
  border: 1px solid #dfe6e1;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  background-color: #fff;
  color: #54625a;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.cell-select:focus {
  outline: 2px solid var(--brand-ring);
  border-color: var(--brand);
}

.cell-select:disabled {
  opacity: 0.55;
  cursor: progress;
}

.cell-select.status-H {
  background: #e4f6ec;
  border-color: #74c69d;
  color: #0f6b41;
}

.cell-select.status-S {
  background: #fdf3e2;
  border-color: #e7c27d;
  color: #8c5a0f;
}

.cell-select.status-I {
  background: #e5f0fb;
  border-color: #83b6e6;
  color: #175c99;
}

.cell-select.status-A {
  background: #fce9e7;
  border-color: #e89e95;
  color: #a12b1f;
}

.cell-select.status-N {
  background: #f8faf9;
  border-color: #e2e8e4;
}

.attendance-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

/* ============================== FILTERS ============================== */

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.9rem;
  align-items: end;
}

.filter-grid .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.filter-grid-students {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

/* ============================== CALENDAR ============================== */

.attendance-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.calendar-head {
  padding: 0.3rem 0;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.calendar-cell {
  min-height: 82px;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  overflow: hidden;
}

.calendar-cell.calendar-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-cell.calendar-holiday {
  background: #fdf6f9;
  border-color: #f6dce8;
}

.calendar-cell.calendar-today {
  box-shadow: 0 0 0 2px rgba(21, 115, 71, 0.35);
  border-color: #6ec59a;
}

.calendar-day {
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.calendar-status .status-badge {
  min-width: 0;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
}

.calendar-note {
  margin-top: 0.2rem;
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.record-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #edf1ee;
  font-size: 0.82rem;
}

.record-list li:last-child {
  border-bottom: 0;
}

/* ============================== MODAL ============================== */

.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(9, 30, 20, 0.48);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(9, 30, 20, 0.28);
}

.modal-card.modal-sm {
  max-width: 380px;
}

.modal-card.modal-lg {
  max-width: 760px;
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.modal-card-body {
  padding: 1.4rem;
  overflow-y: auto;
}

.modal-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
}

/* ============================== MISC ============================== */

.app-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--muted);
  background: var(--bg);
}

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

.empty-state h3 {
  color: var(--ink);
}

.profile-list {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.profile-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #edf1ee;
}

.profile-list dt {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}

.profile-list dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.alert {
  border-radius: 12px;
  font-size: 0.87rem;
}

.badge {
  font-weight: 600;
}

.form-label {
  font-weight: 600;
  font-size: 0.84rem;
}

.input-group-text {
  background: var(--surface-soft);
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
