/*
 * Modern theme layer.
 * Loaded after style.css and overrides the template's look (colors, spacing, radii)
 * without touching its layout mechanics (fixed header, sidebar toggling, mini-sidebar).
 */

:root {
  /* Brand greens, taken from the DHH logo */
  --brand: #1f9d48;
  --brand-hover: #188a3d;
  --brand-600: #178a3c;
  --brand-700: #136f31;
  --brand-800: #0f5a28;
  --brand-900: #0c4721;
  --brand-950: #072c15;
  --brand-50: #effaf2;
  --brand-100: #dcf3e3;
  --brand-200: #b9e6c7;
  --brand-300: #7fd19b;
  --brand-soft: var(--brand-50);
  --brand-ring: rgba(31, 157, 72, 0.2);

  --sidebar-bg: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-950) 100%);
  --sidebar-text: rgba(255, 255, 255, 0.74);
  --sidebar-text-muted: rgba(255, 255, 255, 0.42);
  --sidebar-hover: rgba(255, 255, 255, 0.07);

  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-muted: #f7faf8;
  --border: #e3e9e5;
  --border-strong: #d0d9d3;

  --text: #0f1f17;
  --text-muted: #5c6b63;
  --text-subtle: #94a39a;

  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(12, 71, 33, 0.05);
  --shadow: 0 1px 2px rgba(12, 71, 33, 0.04), 0 6px 20px rgba(12, 71, 33, 0.06);
  --shadow-lg: 0 20px 48px rgba(7, 44, 21, 0.18);
  --shadow-brand: 0 6px 16px rgba(31, 157, 72, 0.28);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ───────── Base ───────── */

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font);
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a {
  color: var(--brand-600);
}

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

hr {
  border-top: 1px solid var(--border) !important;
  opacity: 1;
}

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

.text-primary,
.text-success {
  color: var(--brand-600) !important;
}

::selection {
  background: var(--brand-100);
}

/* ───────── Header ───────── */

.header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(12, 71, 33, 0.02);
}

/* Logo area continues the green sidebar column */
.header .header-left {
  background: var(--brand-900);
  border-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header .header-left .logo {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header .header-left .logo img {
  max-height: 44px;
  width: auto !important;
  max-width: 100% !important;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.header #toggle_btn {
  margin-left: 8px;
}

.header #toggle_btn .bar-icon span {
  background-color: var(--brand-700);
}

.header .page-title-box h3 {
  color: var(--brand-900);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header .user-menu.nav > li > a,
.header .mobile-user-menu > a,
.header .mobile_btn {
  color: var(--text);
}

.header .user-menu.nav > li > a span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

/* Avatar before the user name */
.header .user-menu.nav > li.main-drop > a span::before {
  content: "\f007";
  font-family: "FontAwesome";
  display: inline-block;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #ffffff;
  font-size: 14px;
  box-shadow: var(--shadow-brand);
}

.header .user-menu.nav > li.main-drop > a span::after {
  content: "\f107";
  font-family: "FontAwesome";
  color: var(--text-subtle);
  font-size: 14px;
}

.header .has-arrow .dropdown-toggle::after {
  display: none;
}

/* ───────── Sidebar ───────── */

.sidebar {
  background: var(--sidebar-bg);
  border-right: 0;
}

.sidebar .sidebar-menu {
  padding: 14px 12px 24px;
}

.sidebar .sidebar-menu ul li.menu-title {
  color: var(--sidebar-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 20px 12px 8px;
}

.sidebar .sidebar-menu > ul > li:first-child.menu-title {
  padding-top: 6px;
}

.sidebar .sidebar-menu ul li a,
.sidebar .sidebar-menu ul li a:focus {
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
}

.sidebar .sidebar-menu ul li a i {
  font-size: 20px;
  color: var(--sidebar-text-muted);
}

.sidebar .sidebar-menu ul li a span {
  margin-left: 12px;
}

.sidebar .sidebar-menu ul li a:hover {
  color: #ffffff;
  background-color: var(--sidebar-hover);
}

.sidebar .sidebar-menu ul li a:hover i {
  color: #ffffff;
}

/* Open submenu parent */
.sidebar .sidebar-menu ul li a.subdrop {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.sidebar .sidebar-menu ul li a.subdrop i {
  color: var(--brand-300);
}

/* Current page */
.sidebar .sidebar-menu ul li a.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  box-shadow: var(--shadow-brand);
}

.sidebar .sidebar-menu ul li a.active i {
  color: #ffffff;
}

.sidebar .sidebar-menu ul li a .menu-arrow {
  font-size: 15px;
  top: 11px;
  right: 12px;
  color: var(--sidebar-text-muted);
}

/* Sub-items: a thin guide line with a dot on the current one */
.sidebar .sidebar-menu ul ul {
  position: relative;
  padding: 4px 0 6px;
}

.sidebar .sidebar-menu ul ul::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 6px;
  bottom: 8px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar .sidebar-menu ul ul li a {
  font-size: 13.5px;
  padding: 7px 12px 7px 40px;
  margin: 1px 0;
}

.sidebar .sidebar-menu ul ul a.active,
.sidebar .sidebar-menu ul ul li a.active {
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  font-weight: 600;
}

.sidebar .sidebar-menu ul ul li a.active::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--brand-300);
  box-shadow: 0 0 0 3px rgba(127, 209, 155, 0.25);
}

/* Template scrollbar inside the sidebar */
.sidebar .slimScrollBar {
  background: rgba(255, 255, 255, 0.3) !important;
}

/* ───────── Page ───────── */

/* Soft green band behind the page header */
.page-wrapper {
  background:
    radial-gradient(900px 260px at 0% 0%, rgba(31, 157, 72, 0.12), transparent 70%),
    linear-gradient(180deg, var(--brand-50) 0, var(--bg) 280px);
  background-repeat: no-repeat;
  background-color: var(--bg);
  min-height: 100vh;
}

.page-wrapper > .content,
.content.container-fluid {
  padding: 28px 28px 40px;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-950);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb .breadcrumb-item a {
  color: var(--brand-600);
}

.breadcrumb .breadcrumb-item.active {
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .page-wrapper > .content,
  .content.container-fluid {
    padding: 20px 16px 32px;
  }
}

/* ───────── Cards ───────── */

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

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

.card-body {
  padding: 22px;
}

.card-footer {
  background-color: var(--surface-muted);
  border-top: 1px solid var(--border);
}

.card-title,
.card .card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-950);
}

.profile-box {
  border-radius: var(--radius-lg);
}

/* Dashboard stat widgets */
.dash-widget .card-body .dash-widget-icon {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-brand);
}

.dash-widget .dash-widget-info > h3 {
  color: var(--brand-950);
  font-weight: 700;
}

/* ───────── Buttons ───────── */

.btn {
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-sm {
  font-size: 13px;
  padding: 5px 12px;
}

.btn-lg {
  font-size: 15px;
  padding: 11px 22px;
}

.btn:focus,
.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--brand-ring) !important;
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  border-color: var(--brand-600);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(31, 157, 72, 0.25);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
  background: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #ffffff;
}

.btn-primary.disabled,
.btn-primary:disabled {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: none;
  opacity: 0.55;
}

.btn-outline-primary,
.btn-outline-success {
  color: var(--brand-600);
  border-color: var(--brand-300);
}

.btn-outline-primary:hover,
.btn-outline-success:hover {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-secondary,
.btn-light {
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
}

.btn-secondary:hover,
.btn-light:hover {
  background-color: var(--brand-50);
  border-color: var(--brand-200);
}

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

.btn-info {
  background-color: var(--info);
  border-color: var(--info);
  color: #ffffff;
}

.btn-warning {
  background-color: var(--warning);
  border-color: var(--warning);
  color: #ffffff;
}

/* Page toolbar icon buttons (add, upload, filter, export, ...) */
.btn.rounded-circle,
.view-icons .btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border-radius: 10px !important;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--brand-700) !important;
  box-shadow: var(--shadow-sm);
  vertical-align: middle;
}

.btn.rounded-circle:hover,
.view-icons .btn:hover,
.view-icons .btn.active {
  background: var(--brand-50) !important;
  border-color: var(--brand-300) !important;
  color: var(--brand-800) !important;
  transform: translateY(-1px);
}

.btn.rounded-circle.btn-outline-danger {
  color: var(--danger) !important;
}

.btn.rounded-circle.btn-outline-danger:hover {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

.btn.rounded-circle.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  border-color: var(--brand-600);
  color: #ffffff !important;
  box-shadow: var(--shadow-brand);
}

.btn.rounded-circle.btn-primary:hover {
  background: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #ffffff !important;
}

/* Empty states rendered as <h3 class="alert ..."> */
h3.alert {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted) !important;
  text-align: center;
  padding: 56px 16px;
  margin: 0;
}

h3.alert::before {
  content: "\f0f6";
  font-family: "FontAwesome";
  display: block;
  width: 56px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 22px;
}

/* ───────── Forms ───────── */

.form-group {
  margin-bottom: 16px;
}

label,
.col-form-label,
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control,
.form-select,
select.form-control,
select.select {
  height: 42px;
  font-size: 14px;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control {
  height: auto;
  min-height: 90px;
}

.form-control-sm {
  height: 34px;
  font-size: 13px;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--brand-200);
}

.form-control:focus,
.form-select:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  outline: none;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--surface-muted);
  color: var(--text-muted);
}

.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--brand-ring);
  border-color: var(--brand);
}

.input-group-text {
  background-color: var(--brand-50);
  border-color: var(--border-strong);
  color: var(--brand-700);
}

/* Searchable select (shared/SearchableSelect.tsx) */
.searchable-select {
  position: relative;
  text-align: left;
}

.searchable-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.searchable-select-toggle > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-toggle.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.searchable-select-placeholder {
  color: var(--text-subtle);
}

/* Rendered in the flow (not floating) so it isn't clipped inside popups */
.searchable-select-menu {
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.searchable-select-search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.searchable-select-search i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 13px;
}

.searchable-select-search .form-control {
  padding-left: 32px;
}

.searchable-select-options {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.searchable-select-options button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}

.searchable-select-options button:hover {
  background: var(--brand-50);
  color: var(--brand-800);
}

.searchable-select-options button.is-selected {
  background: var(--brand-100);
  color: var(--brand-800);
  font-weight: 600;
}

.searchable-select-empty {
  padding: 10px;
  color: var(--text-subtle);
  font-size: 13px;
  text-align: center;
}

/* ───────── Tables ───────── */

.table {
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 0;
  --bs-table-striped-bg: #fafcfb;
  --bs-table-hover-bg: var(--brand-50);
}

.table > :not(caption) > * > * {
  padding: 12px 14px;
  border-bottom-color: var(--border);
  vertical-align: middle;
}

.table > thead > tr > th,
.table thead th {
  background-color: var(--brand-50);
  color: var(--brand-800);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-top: 0;
  border-bottom: 1px solid var(--brand-100);
}

.table > :not(:first-child) {
  border-top: 0;
}

.table-hover > tbody > tr {
  transition: background-color 0.12s ease;
}

.table > tfoot > tr > td,
.table > tfoot > tr > th {
  font-weight: 700;
  color: var(--brand-900);
  background-color: var(--brand-50);
  border-top: 2px solid var(--brand-200);
}

.table-responsive {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table-responsive > .table > :last-child > tr:last-child > * {
  border-bottom: 0;
}

.table-bordered > :not(caption) > * > * {
  border-color: var(--border);
}

/* ───────── Badges & status ───────── */

.badge {
  font-weight: 600;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0;
}

.badge-success,
.badge.bg-success {
  background-color: var(--brand-100) !important;
  color: var(--brand-800) !important;
}

.badge-danger,
.badge.bg-danger {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
}

.badge-warning,
.badge.bg-warning {
  background-color: #fef3c7 !important;
  color: #92400e !important;
}

.badge-info,
.badge.bg-info {
  background-color: #dbeafe !important;
  color: #1e40af !important;
}

.badge.bg-primary {
  background-color: var(--brand-100) !important;
  color: var(--brand-800) !important;
}

/* Used by most "Edit" actions */
.badge-dark,
.badge.bg-dark {
  background-color: #e6ebe8 !important;
  color: #1f2a24 !important;
}

.badge.bg-light,
.badge.bg-secondary {
  background-color: #f1f5f3 !important;
  color: var(--text-subtle) !important;
}

/* Status badges get a leading dot */
td > span.badge-success::before,
td > span.badge-danger::before,
td > span.badge-warning::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Clickable action badges in data tables inherit the badge's text color */
td .badge [class*="text-"] {
  color: inherit !important;
}

td .badge {
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

td .badge:hover {
  filter: brightness(0.95);
}

td .badge.bg-light {
  cursor: not-allowed;
}

/* ───────── Dropdowns, modals, nav tabs ───────── */

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  font-size: 14px;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--brand-50);
  color: var(--brand-800);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--brand-100);
  color: var(--brand-800);
}

.modal-content {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  border-color: var(--border);
}

.nav-tabs {
  border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link,
.nav-tabs.nav-tabs-bottom li a {
  color: var(--text-muted);
  font-weight: 500;
  border: 0;
  border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover {
  color: var(--brand-700);
  border-color: transparent;
}

.nav-tabs .nav-link.active,
.nav-tabs.nav-tabs-bottom li a.active {
  color: var(--brand-700);
  background: transparent;
  border-bottom-color: var(--brand);
}

/* ───────── Pagination ───────── */

.pagination {
  gap: 4px;
}

.pagination .page-link {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) !important;
  color: var(--text-muted);
  min-width: 34px;
  text-align: center;
}

.pagination .page-link:hover {
  background-color: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-800);
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  border-color: var(--brand-600);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(31, 157, 72, 0.25);
}

/* ───────── Alerts, progress ───────── */

.alert {
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-800);
}

.progress {
  background-color: var(--brand-50);
  border-radius: 999px;
}

.progress-bar,
.bg-primary {
  background-color: var(--brand) !important;
}

/* ───────── SweetAlert2 ───────── */

.swal2-popup {
  border-radius: var(--radius-lg) !important;
  font-family: var(--font) !important;
  padding: 24px !important;
}

.swal2-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--brand-950) !important;
}

.swal2-html-container,
.swal2-content {
  font-size: 14px !important;
  color: var(--text-muted) !important;
}

.swal2-styled {
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 9px 18px !important;
}

.swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%) !important;
}

.swal2-styled.swal2-cancel {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
}

.swal2-styled:focus {
  box-shadow: 0 0 0 3px var(--brand-ring) !important;
}

/* ───────── Login ───────── */

/* Green upper half with the logo, white card overlapping the split */
.account-page {
  background:
    radial-gradient(700px 360px at 85% 0%, rgba(127, 209, 155, 0.28), transparent 70%),
    linear-gradient(160deg, var(--brand-800) 0%, var(--brand-950) 100%) top / 100% 46% no-repeat,
    var(--bg) !important;
  min-height: 100vh;
}

.account-page .account-box,
.account-page .main-wrapper .account-content .account-box {
  background-color: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.account-page .account-box::before {
  content: "Sign in";
  display: block;
  padding: 26px 32px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-950);
}

.account-page .account-wrapper,
.account-page .main-wrapper .account-content .account-box .account-wrapper {
  padding: 18px 32px 28px;
}

.account-page .main-wrapper .account-content .account-box .account-btn {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  width: 100%;
  height: 46px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-brand);
}

.account-page .main-wrapper .account-content .account-box .account-btn:hover {
  background: var(--brand-700);
}

.account-page .account-footer {
  color: var(--text-subtle);
  font-size: 12.5px;
}

/* ───────── Payroll approval chain (components/payroll) ───────── */

.tone-success { color: var(--brand-700); }
.tone-warning { color: #b45309; }
.tone-danger { color: #b91c1c; }
.tone-info { color: var(--info); }

/* Compact tracker in table cells */
.stage-compact {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  min-width: 170px;
}

.stage-dots {
  display: flex;
  gap: 4px;
}

.stage-dot {
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
}

.stage-dot.is-done { background: var(--brand); }
.stage-dot.is-current { background: #f59e0b; }
.stage-dot.is-returned { background: var(--danger); }

.stage-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Full tracker on the details page */
.stage-tracker {
  display: flex;
  list-style: none;
  margin: 18px 0 8px;
  padding: 0;
  counter-reset: none;
}

.stage-step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 0 4px;
}

/* Connector line to the previous step */
.stage-step + .stage-step::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 50%;
  width: 100%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.stage-step.is-done + .stage-step::before,
.stage-step.is-done + .stage-step.is-current::before {
  background: var(--brand);
}

.stage-marker {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--text-subtle);
}

.stage-step.is-done .stage-marker {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.stage-step.is-current .stage-marker {
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.stage-step.is-returned .stage-marker {
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.stage-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.stage-text strong {
  font-size: 13px;
  color: var(--text);
}

.stage-text small {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .stage-tracker {
    flex-direction: column;
    gap: 14px;
  }

  .stage-step {
    flex-direction: row;
    text-align: left;
  }

  .stage-step + .stage-step::before {
    display: none;
  }
}

/* Approval panel */
.approval-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.approval-panel-actions {
  display: flex;
  gap: 8px;
}

.approval-history-title {
  margin: 22px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-950);
}

.approval-history {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.approval-history li {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 14px 2px;
}

.approval-history li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.approval-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--surface);
}

.approval-history strong {
  display: block;
  font-size: 13.5px;
}

.approval-history small {
  color: var(--text-muted);
  font-size: 12px;
}

.approval-remarks {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text);
}

/* "Waiting for your decision" banner on the Payroll Report */
.awaiting-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}

.awaiting-banner-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fef3c7;
  color: #b45309;
}

.awaiting-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.awaiting-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 12px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.awaiting-chip span {
  font-size: 11.5px;
  font-weight: 500;
  color: #b45309;
}

.awaiting-chip:hover {
  border-color: #f59e0b;
}

/* ───────── Loaders (shared/spinners/Loader.tsx) ───────── */

.app-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.app-loader-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand);
  animation: app-spin 0.8s linear infinite;
}

.app-loader-text {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.app-loader-inline {
  gap: 10px;
}

.app-progress {
  position: relative;
  display: block;
  width: 180px;
  max-width: 60%;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-100);
  overflow: hidden;
}

.app-progress > span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-300), var(--brand));
  animation: app-progress 1.1s ease-in-out infinite;
}

/* Table placeholder rows */
.table > tbody > tr.skeleton-row > td {
  background: transparent;
}

.skeleton-bar {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2ef 0%, #f7faf8 40%, #eef2ef 80%);
  background-size: 200% 100%;
  animation: app-shimmer 1.4s ease-in-out infinite;
}

@keyframes app-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes app-progress {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

@keyframes app-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader-ring,
  .app-progress > span,
  .skeleton-bar {
    animation-duration: 0s;
    animation-iteration-count: 1;
  }

  .app-progress > span {
    left: 0;
    width: 100%;
    opacity: 0.6;
  }
}

/* ───────── Scrollbars ───────── */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}
