:root {
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-border: #e3e8ef;
  --app-text: #122033;
  --app-muted: #667085;
  --app-primary: #0f766e;
  --app-primary-dark: #115e59;
  --app-primary-soft: #d9f5f0;
  --app-warning-soft: #fff7df;
  --app-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  --app-radius: 22px;
}

html {
  font-size: 14px;
  min-height: 100%;
  position: relative;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 35rem),
    var(--app-bg);
  font-family: Inter, Segoe UI, Tahoma, Arial, sans-serif;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(15, 118, 110, 0.25);
}

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

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

.btn-outline-primary {
  color: var(--app-primary);
  border-color: rgba(15, 118, 110, 0.35);
}

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

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 74px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  color: var(--app-text);
  text-decoration: none;
}

.app-brand:hover {
  color: var(--app-text);
}

.app-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: inline-grid;
  place-items: center;
  color: white;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.28);
}

.app-brand-mark-logo {
  padding: 5px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: rgba(255, 255, 255, 0.96);
}

.app-brand-mark-logo img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.app-brand-text small {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.app-topnav {
  flex: 1;
  justify-content: center;
}

.app-nav-link {
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
  color: #344054;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s ease;
}

.app-nav-link:hover,
.app-nav-link:focus {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

.app-user-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text) !important;
  font-weight: 600;
}

.app-auth-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.app-user-link.btn {
  padding: 0.35rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.app-user-link.btn:hover,
.app-user-link.btn:focus {
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(240, 253, 250, 0.88);
}

.app-user-meta {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.app-user-meta strong {
  max-width: 180px;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.app-user-meta small {
  max-width: 180px;
  color: var(--app-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
}

.app-account-menu {
  min-width: 260px;
  padding: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.app-account-menu .dropdown-item {
  border-radius: 0.72rem;
  font-weight: 700;
}

.app-account-header {
  white-space: normal;
}

.app-account-header strong,
.app-account-header small {
  display: block;
}

.app-account-header strong {
  color: var(--app-text);
  font-size: 0.92rem;
}

.app-account-header small {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.app-login-btn {
  border-radius: 999px;
  font-weight: 800;
}

.app-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  font-weight: 800;
}

.app-logout-btn {
  border-radius: 999px;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 132px);
}

.app-sidebar {
  width: 290px;
  padding: 24px 16px;
  border-right: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.78);
}

.app-sidebar-section + .app-sidebar-section {
  margin-top: 22px;
}

.app-sidebar-caption {
  padding: 0 12px 8px;
  color: var(--app-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  color: #344054;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s ease;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus,
.app-sidebar-link.active {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  padding: 30px;
  margin: 0 auto;
}

.app-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--app-muted);
  font-size: 0.84rem;
}

.app-page-meta span {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.09), rgba(255, 255, 255, 0.94)),
    var(--app-surface);
  box-shadow: var(--app-shadow);
}

.app-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.72rem;
  margin-bottom: 14px;
  border-radius: 999px;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.app-hero h1 {
  max-width: 760px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.app-hero p,
.app-roadmap-card p,
.app-card p,
.app-content-card p {
  color: var(--app-muted);
  line-height: 1.7;
}

.app-hero-panel {
  padding: 20px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

.app-hero-panel-title {
  margin-bottom: 14px;
  color: var(--app-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.app-mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--app-border);
}

.app-mini-stat:last-child {
  border-bottom: 0;
}

.app-mini-stat span {
  color: var(--app-muted);
  font-weight: 700;
}

.app-mini-stat strong {
  font-size: 1.5rem;
}

.app-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.app-card,
.app-roadmap-card,
.app-content-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 35px rgba(16, 24, 40, 0.05);
}

.app-card {
  min-height: 220px;
  padding: 24px;
}

.app-card h2,
.app-roadmap-card h2,
.app-content-card h1,
.app-content-card h2 {
  letter-spacing: -0.025em;
}

.app-card h2 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
  font-weight: 800;
}

.app-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-weight: 900;
}

.app-card-muted .app-card-icon {
  background: var(--app-warning-soft);
  color: #a16207;
}

.app-roadmap-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: center;
  margin-top: 24px;
  padding: 28px;
}

.app-roadmap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-roadmap-list span {
  padding: 0.55rem 0.78rem;
  border-radius: 999px;
  color: #344054;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  font-weight: 700;
}

.app-content-card {
  padding: clamp(24px, 4vw, 42px);
}

.app-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.app-policy-grid > div {
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface-soft);
}

.app-policy-grid h2 {
  font-size: 1.05rem;
  font-weight: 800;
}

.app-mobile-identity {
  padding: 16px;
  border-radius: 18px;
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.app-mobile-nav .list-group-item {
  border-color: var(--app-border);
  font-weight: 700;
}

.app-footer {
  padding: 18px 0;
  color: var(--app-muted);
  background: rgba(255, 255, 255, 0.86);
}

.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;
}

@media (max-width: 1199.98px) {
  .app-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-hero,
  .app-roadmap-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .app-main {
    padding: 22px 16px;
  }

  .app-brand {
    min-width: auto;
  }

  .app-brand-text small {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .app-dashboard-grid,
  .app-policy-grid {
    grid-template-columns: 1fr;
  }

  .app-hero {
    padding: 24px;
  }

  .app-card {
    min-height: auto;
  }
}

.app-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.96)),
    var(--app-surface);
  box-shadow: var(--app-shadow);
}

.app-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -0.045em;
}

.app-page-header p {
  max-width: 850px;
  margin: 0;
  color: var(--app-muted);
  line-height: 1.7;
}

.app-alert {
  margin: 18px 0 0;
  border-radius: 18px;
  border: 0;
}

.app-summary-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

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

.app-summary-card {
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 35px rgba(16, 24, 40, 0.04);
}

.app-summary-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-summary-card strong {
  display: block;
  color: var(--app-text);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.app-workspace-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--app-border);
}

.app-toolbar h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.app-toolbar p {
  margin: 0;
  color: var(--app-muted);
}

.app-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(520px, 100%);
}

.app-search-form .form-control {
  min-height: 42px;
  border-radius: 14px;
}

.app-search-form .btn {
  min-height: 42px;
  border-radius: 14px;
}

.app-table-shell {
  overflow-x: auto;
}

.app-table {
  min-width: 980px;
}

.app-table thead th {
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--app-surface-soft);
}

.app-table tbody td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--app-border);
}

.app-table tbody tr:last-child td {
  border-bottom: 0;
}

.app-table-title {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 850;
}

.app-table-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.app-code-pill,
.app-order-pill,
.app-shift-pills span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 850;
}

.app-code-pill {
  padding: 0.18rem 0.55rem;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-size: 0.76rem;
}

.app-order-pill {
  min-width: 36px;
  height: 32px;
  color: #344054;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
}

.app-shift-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-shift-pills span {
  min-width: 44px;
  padding: 0.3rem 0.5rem;
  color: #344054;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  font-size: 0.78rem;
}

.app-status-badge {
  padding: 0.45rem 0.65rem;
  font-weight: 800;
}

.app-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.app-row-actions .btn {
  border-radius: 12px;
  font-weight: 700;
}

.app-empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  color: var(--app-muted);
  text-align: center;
}

.app-empty-state strong {
  color: var(--app-text);
  font-size: 1.1rem;
}

.app-modal-content {
  border: 1px solid var(--app-border);
  border-radius: 24px;
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.app-modal-header,
.app-modal-footer {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
}

.app-modal-header {
  align-items: flex-start;
  padding: 22px 24px;
}

.app-modal-header .modal-title {
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.app-modal-content .modal-body {
  padding: 24px;
}

.app-modal-footer {
  padding: 18px 24px;
}

.app-modal-footer .btn,
.app-modal-content .form-control,
.app-modal-content .form-check-input {
  border-radius: 14px;
}

.app-form-switch {
  padding: 15px 15px 15px 3.2rem;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface-soft);
}

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

  .app-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-search-form {
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  .app-page-header {
    align-items: stretch;
    flex-direction: column;
    padding: 24px;
  }

  .app-summary-grid-4 {
    grid-template-columns: 1fr;
  }

  .app-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .app-toolbar {
    padding: 20px;
  }
}

.app-search-form-wide {
  min-width: min(920px, 100%);
}

.app-search-form .form-select {
  min-height: 42px;
  border-radius: 14px;
}

@media (max-width: 1199.98px) {
  .app-search-form-wide {
    min-width: 0;
  }
}

.app-table-note {
  max-width: 280px;
  color: var(--app-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.app-inline-link {
  color: var(--app-primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.app-inline-link:hover {
  text-decoration: underline;
}

.app-current-attachment {
  padding: 12px 14px;
  border: 1px dashed var(--app-border);
  border-radius: 16px;
  background: var(--app-surface-soft);
}

/* Step 6-R2: professional notifications, searchable staff picker, and attachment uploader */
.app-toast-container {
  position: fixed;
  top: 92px;
  right: 24px;
  z-index: 2000;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.16);
  animation: appToastIn 0.28s ease both;
  pointer-events: auto;
  backdrop-filter: blur(18px);
}

.app-toast-success {
  border-color: rgba(15, 118, 110, 0.22);
}

.app-toast-error {
  border-color: rgba(220, 38, 38, 0.22);
}

.app-toast-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.app-toast-error .app-toast-icon {
  background: linear-gradient(135deg, #dc2626, #f97316);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.2);
}

.app-toast-text {
  color: var(--app-text);
  font-weight: 700;
  line-height: 1.5;
}

.app-toast-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: 1.15rem;
  line-height: 1;
}

.app-toast-close:hover,
.app-toast-close:focus {
  color: var(--app-text);
  background: var(--app-border);
}

.app-toast-hide {
  animation: appToastOut 0.24s ease both;
}

@keyframes appToastIn {
  from {
    transform: translateY(-10px) translateX(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0) translateX(0);
    opacity: 1;
  }
}

@keyframes appToastOut {
  from {
    transform: translateY(0) translateX(0);
    opacity: 1;
  }
  to {
    transform: translateY(-8px) translateX(18px);
    opacity: 0;
  }
}

.app-searchable-field {
  position: relative;
}

.app-searchable-input {
  padding-right: 42px;
  min-height: 42px;
  border-radius: 13px;
}

.app-searchable-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--app-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.app-file-upload {
  min-height: 82px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px dashed rgba(15, 118, 110, 0.38);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(217, 245, 240, 0.7), rgba(255, 255, 255, 0.92));
  cursor: pointer;
  transition: 0.18s ease;
}

.app-file-upload:hover,
.app-file-upload:focus-within {
  border-color: var(--app-primary);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

.app-file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-file-upload-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.18rem;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2);
}

.app-file-upload-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.app-file-upload-copy strong {
  max-width: 100%;
  color: var(--app-primary-dark);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-file-upload-copy small {
  color: var(--app-muted);
  line-height: 1.4;
}

@media (max-width: 767.98px) {
  .app-toast-container {
    top: 78px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .app-toast {
    grid-template-columns: 34px minmax(0, 1fr) 26px;
    border-radius: 16px;
  }

  .app-file-upload {
    min-height: 76px;
  }
}

.app-validation-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 18px;
  color: #991b1b;
  background: linear-gradient(135deg, #fff5f5, #fffafa);
}

.app-validation-panel-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.app-validation-panel-title strong {
  display: block;
  font-weight: 850;
}

.app-validation-panel-title small {
  display: block;
  margin-top: 2px;
  color: #b42318;
  font-weight: 600;
}

.app-validation-panel-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #dc2626;
  font-weight: 900;
}

.app-validation-panel ul {
  margin: 0;
  padding-left: 44px;
}

.app-validation-panel li + li {
  margin-top: 4px;
}

.field-validation-error {
  display: block;
  margin-top: 6px;
  color: #b42318;
  font-weight: 700;
}

.input-validation-error {
  border-color: rgba(220, 38, 38, 0.65) !important;
  background-color: #fffafa;
}

.input-validation-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.14) !important;
}

/* Step 7-R1: Daily Nursing Control Center */
.app-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.app-control-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.06);
}

.app-control-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--app-primary);
}

.app-control-card-header,
.app-control-card-body,
.app-control-card-footer {
  padding-left: 24px;
  padding-right: 24px;
}

.app-control-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 16px;
}

.app-control-card-header h2 {
  margin: 10px 0 0;
  font-size: 1.28rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.app-control-severity {
  flex: 0 0 auto;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.app-control-critical::before {
  background: linear-gradient(180deg, #dc2626, #f97316);
}

.app-control-critical .app-control-severity {
  color: #991b1b;
  background: #fee2e2;
}

.app-control-watch::before {
  background: linear-gradient(180deg, #f59e0b, #facc15);
}

.app-control-watch .app-control-severity {
  color: #92400e;
  background: #fef3c7;
}

.app-control-stable::before {
  background: linear-gradient(180deg, #0f766e, #14b8a6);
}

.app-control-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 24px 18px;
}

.app-control-metrics > div {
  padding: 13px 12px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface-soft);
}

.app-control-metrics span,
.app-control-line span {
  display: block;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.app-control-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--app-text);
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.app-control-card-body {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}

.app-control-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border);
}

.app-control-line strong {
  text-align: end;
}

.app-control-action-text {
  padding: 12px 14px;
  border-radius: 16px;
  color: #344054;
  background: var(--app-surface-soft);
  font-weight: 700;
}

.app-control-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 22px;
  border-top: 1px solid var(--app-border);
  background: rgba(248, 250, 252, 0.75);
}

.app-control-next-step {
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.app-control-compact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-control-compact-stats span {
  padding: 0.48rem 0.7rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: #344054;
  background: var(--app-surface-soft);
  font-weight: 800;
}

.app-control-empty {
  grid-column: 1 / -1;
}

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

@media (max-width: 767.98px) {
  .app-control-card-header,
  .app-control-card-body,
  .app-control-card-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .app-control-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 20px;
    padding-right: 20px;
  }

  .app-control-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-control-line strong {
    text-align: start;
  }
}

/* Step 8-R1: Staffing Support Workspace */
.app-support-coverage {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 8px;
}

.app-support-coverage > div {
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: 15px;
  background: var(--app-surface-soft);
}

.app-support-coverage span {
  display: block;
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.app-support-coverage strong {
  display: block;
  margin-top: 4px;
  color: var(--app-text);
  font-size: 1.3rem;
  line-height: 1;
}

.app-support-assigned {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 320px;
}

.app-support-assigned span {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.app-support-staff-search {
  width: min(320px, 100%);
  min-height: 42px;
  border-radius: 14px;
}

.app-support-staff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 320px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface-soft);
}

.app-support-staff-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: 0.18s ease;
}

.app-support-staff-option:hover,
.app-support-staff-option:focus-within {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.08);
}

.app-support-staff-option input {
  margin-top: 4px;
}

.app-support-staff-option strong {
  display: block;
  color: var(--app-text);
  font-weight: 850;
  line-height: 1.3;
}

.app-support-staff-option small {
  display: block;
  margin-top: 3px;
  color: var(--app-muted);
  font-weight: 650;
  line-height: 1.35;
}

.app-support-staff-option.is-hidden {
  display: none;
}

@media (max-width: 991.98px) {
  .app-support-staff-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .app-support-coverage {
    grid-template-columns: 1fr;
  }
}


/* Step 9-R2: Professional confirmation dialog for all action forms */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
}

.app-confirm-overlay.is-visible {
  display: flex;
}

.app-confirm-dialog {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.24);
  animation: appConfirmIn 0.18s ease-out;
}

.app-confirm-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: #0f766e;
  background: var(--app-primary-soft);
  font-size: 1.5rem;
  font-weight: 950;
}

.app-confirm-dialog[data-confirm-variant="danger"] .app-confirm-icon {
  color: #be123c;
  background: #ffe4e6;
}

.app-confirm-dialog[data-confirm-variant="success"] .app-confirm-icon {
  color: #047857;
  background: #d1fae5;
}

.app-confirm-content {
  min-width: 0;
}

.app-confirm-eyebrow {
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-confirm-dialog h3 {
  margin: 0;
  color: var(--app-text);
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.app-confirm-dialog p {
  margin: 10px 0 0;
  color: #475467;
  font-size: 0.98rem;
  line-height: 1.6;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.app-confirm-cancel,
.app-confirm-primary {
  min-height: 44px;
  padding: 0.72rem 1.05rem;
  border-radius: 14px;
  font-weight: 850;
  transition: 0.16s ease;
}

.app-confirm-cancel {
  border: 1px solid var(--app-border);
  color: #344054;
  background: #ffffff;
}

.app-confirm-cancel:hover,
.app-confirm-cancel:focus {
  background: var(--app-surface-soft);
}

.app-confirm-primary {
  border: 1px solid #0f766e;
  color: #ffffff;
  background: #0f766e;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}

.app-confirm-primary:hover,
.app-confirm-primary:focus {
  background: #0b625c;
}

.app-confirm-dialog[data-confirm-variant="danger"] .app-confirm-primary {
  border-color: #e11d48;
  background: #e11d48;
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.18);
}

.app-confirm-dialog[data-confirm-variant="danger"] .app-confirm-primary:hover,
.app-confirm-dialog[data-confirm-variant="danger"] .app-confirm-primary:focus {
  background: #be123c;
}

.app-confirm-dialog[data-confirm-variant="success"] .app-confirm-primary {
  border-color: #047857;
  background: #047857;
  box-shadow: 0 12px 28px rgba(4, 120, 87, 0.18);
}

.app-confirm-dialog[data-confirm-variant="success"] .app-confirm-primary:hover,
.app-confirm-dialog[data-confirm-variant="success"] .app-confirm-primary:focus {
  background: #065f46;
}

@keyframes appConfirmIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 575.98px) {
  .app-confirm-overlay {
    align-items: flex-end;
    padding: 14px;
  }

  .app-confirm-dialog {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
  }

  .app-confirm-actions {
    flex-direction: column-reverse;
  }

  .app-confirm-cancel,
  .app-confirm-primary {
    width: 100%;
  }
}

/* Step 9-R3: Overtime workflow route, progress, and balance cards */
.app-route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.app-route-card {
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.05);
}

.app-route-card span {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 14px;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-size: 0.8rem;
  font-weight: 950;
}

.app-route-card strong {
  display: block;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.app-route-card p {
  margin: 8px 0 0;
  color: var(--app-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.app-progress-route {
  min-width: 230px;
}

.app-progress-route-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.app-progress-route-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #0f766e);
}

.app-progress-route-steps {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 850;
}

.app-progress-route-steps span.is-done {
  color: var(--app-primary-dark);
}

.app-balance-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: #065f46;
  background: #d1fae5;
  font-weight: 900;
}

@media (max-width: 1199.98px) {
  .app-route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .app-route-grid {
    grid-template-columns: 1fr;
  }

  .app-progress-route {
    min-width: 180px;
  }
}

/* Step 9-R4: Overtime timeline, polished workspace table, and pagination */
.app-table-shell-polished {
  border: 1px solid var(--app-border);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
}

.app-overtime-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
}

.app-overtime-table tbody tr {
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.app-overtime-table tbody tr:hover {
  background: #fbfefe;
  box-shadow: inset 4px 0 0 rgba(13, 148, 136, 0.22);
}

.app-overtime-table td {
  padding-top: 18px;
  padding-bottom: 18px;
  vertical-align: top;
}

.app-workflow-timeline {
  min-width: 430px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 0;
}

.app-workflow-step {
  position: relative;
  display: flex;
  gap: 10px;
  min-height: 60px;
  padding-right: 14px;
}

.app-workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 34px;
  right: 8px;
  height: 3px;
  border-radius: 999px;
  background: #e2e8f0;
}

.app-workflow-step.is-done:not(:last-child)::after {
  background: linear-gradient(90deg, #14b8a6, #0f766e);
}

.app-workflow-dot {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  color: #64748b;
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.app-workflow-step strong {
  display: block;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.1;
}

.app-workflow-step small {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
}

.app-workflow-step.is-done .app-workflow-dot {
  color: #ffffff;
  border-color: #0f766e;
  background: #0f766e;
}

.app-workflow-step.is-done strong {
  color: #0f766e;
}

.app-workflow-step.is-active .app-workflow-dot {
  color: #0f766e;
  border-color: #14b8a6;
  background: #ccfbf1;
}

.app-workflow-step.is-active strong {
  color: #0f766e;
}

.app-workflow-step.is-stopped .app-workflow-dot {
  color: #ffffff;
  border-color: #dc2626;
  background: #dc2626;
}

.app-workflow-step.is-stopped strong {
  color: #b91c1c;
}

.app-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: #ffffff;
}

.app-pagination-summary {
  color: var(--app-muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.app-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-pagination .disabled {
  pointer-events: none;
  opacity: 0.55;
}

.app-pagination-ellipsis {
  color: #94a3b8;
  font-weight: 900;
  padding: 0 2px;
}

.app-page-size-select {
  max-width: 112px;
}

@media (max-width: 1199.98px) {
  .app-workflow-timeline {
    min-width: 360px;
  }
}

@media (max-width: 767.98px) {
  .app-workflow-timeline {
    min-width: 280px;
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .app-workflow-step {
    padding-right: 0;
    padding-bottom: 10px;
  }

  .app-workflow-step:not(:last-child)::after {
    top: 34px;
    left: 16px;
    right: auto;
    width: 3px;
    height: calc(100% - 26px);
  }

  .app-pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-pagination {
    justify-content: flex-start;
  }
}

/* Step 10-R6-R3: Navigation simplification, sidebar collapse, attendance filters and pagination polish */
.app-topbar-actions {
  margin-left: auto;
}

.app-sidebar-toggle {
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 14px;
  color: var(--app-primary-dark);
  background: linear-gradient(135deg, rgba(217, 245, 240, 0.88), rgba(255, 255, 255, 0.96));
  font-weight: 850;
  transition: 0.18s ease;
}

.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus {
  border-color: rgba(15, 118, 110, 0.46);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.app-sidebar-toggle-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--app-primary);
  font-size: 0.9rem;
  line-height: 1;
}

.app-topbar-context {
  align-items: center;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-muted);
  background: rgba(248, 250, 252, 0.85);
  font-size: 0.84rem;
  font-weight: 700;
}

.app-sidebar,
.app-sidebar-link,
.app-sidebar-caption,
.app-sidebar-link span,
.app-main {
  transition: width 0.2s ease, padding 0.2s ease, opacity 0.16s ease, margin 0.2s ease;
}

body.app-sidebar-collapsed .app-sidebar {
  width: 92px;
  padding-left: 12px;
  padding-right: 12px;
}

body.app-sidebar-collapsed .app-sidebar-caption {
  height: 8px;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}

body.app-sidebar-collapsed .app-sidebar-section + .app-sidebar-section {
  margin-top: 14px;
}

body.app-sidebar-collapsed .app-sidebar-link {
  justify-content: center;
  min-height: 46px;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

body.app-sidebar-collapsed .app-sidebar-link span {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
}

body.app-sidebar-collapsed .app-sidebar-link::before {
  content: "•";
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--app-primary-dark);
  background: rgba(217, 245, 240, 0.78);
  font-size: 1.2rem;
  line-height: 1;
}

body.app-sidebar-collapsed .app-sidebar-link.active::before {
  color: #ffffff;
  background: var(--app-primary);
}

body.app-sidebar-collapsed .app-sidebar-toggle-text {
  display: none;
}

.app-filter-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.app-filter-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--app-border);
  background: linear-gradient(135deg, rgba(217, 245, 240, 0.55), rgba(248, 250, 252, 0.9));
}

.app-filter-card-header h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.app-filter-card-header p {
  max-width: 780px;
  margin: 0;
  color: var(--app-muted);
  line-height: 1.6;
}

.app-filter-current {
  min-width: 150px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 18px;
  text-align: end;
  background: rgba(255, 255, 255, 0.86);
}

.app-filter-current span {
  display: block;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-filter-current strong {
  display: block;
  margin-top: 4px;
  color: var(--app-text);
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.app-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(7, minmax(126px, 1fr));
  gap: 12px;
  padding: 22px 24px 24px;
  align-items: end;
}

.app-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.app-filter-field label {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.app-filter-field .form-control,
.app-filter-field .form-select {
  min-height: 44px;
  border-radius: 14px;
  border-color: var(--app-border);
  background-color: #ffffff;
}

.app-filter-search {
  grid-column: span 2;
}

.app-filter-size {
  max-width: 150px;
}

.app-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.app-filter-actions .btn {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.app-toolbar-compact {
  padding: 18px 22px;
}

.app-toolbar-count {
  padding: 0.48rem 0.78rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-size: 0.86rem;
  font-weight: 850;
  white-space: nowrap;
}

.app-attendance-table {
  min-width: 1120px;
}

.app-row-actions-compact {
  gap: 7px;
}

.app-action-btn {
  min-width: 86px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  font-size: 0.82rem;
  font-weight: 850 !important;
  line-height: 1.1;
}

.app-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-top: 1px solid var(--app-border);
  background: rgba(248, 250, 252, 0.8);
}

.app-pagination-summary {
  color: var(--app-muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.app-pagination .page-link {
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  border-radius: 12px !important;
  border-color: var(--app-border);
  color: #344054;
  font-weight: 800;
}

.app-pagination .page-item.active .page-link {
  color: #ffffff;
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.app-pagination .page-item.disabled .page-link {
  color: #98a2b3;
  background: #f8fafc;
}

@media (max-width: 1399.98px) {
  .app-filter-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .app-filter-search {
    grid-column: span 2;
  }
}

@media (max-width: 991.98px) {
  .app-filter-card-header,
  .app-pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-filter-current {
    text-align: start;
  }

  .app-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .app-filter-card-header,
  .app-filter-form,
  .app-pagination-bar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .app-filter-form {
    grid-template-columns: 1fr;
  }

  .app-filter-search {
    grid-column: auto;
  }

  .app-filter-actions {
    justify-content: stretch;
  }

  .app-filter-actions .btn {
    flex: 1 1 100%;
  }

  .app-pagination {
    flex-wrap: wrap;
  }
}

/* Full hide mode for the desktop sidebar collapse requested by the user. */
body.app-sidebar-collapsed .app-sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  border-right: 0;
  overflow: hidden;
}

body.app-sidebar-collapsed .app-sidebar-section {
  display: none;
}

/* Step 10-R7-R3 — Unified filter cards and row actions across operational pages. */
.app-filter-card-compact {
  margin-top: 22px;
}

.app-filter-card-compact .app-filter-form {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  align-items: end;
}

.app-filter-card-compact .app-filter-search {
  grid-column: span 2;
}

.app-filter-form-simple .app-filter-search {
  grid-column: span 3;
}

.app-filter-card-compact .app-filter-actions {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  padding-top: 6px;
}

.app-filter-card-compact .app-filter-actions .btn {
  min-width: 128px;
  padding-left: 1rem;
  padding-right: 1rem;
}

.app-workspace-card .app-toolbar-compact {
  min-height: auto;
  background: rgba(255, 255, 255, 0.72);
}

.app-row-actions,
.app-row-actions form {
  align-items: center;
}

.app-row-actions form {
  display: inline-flex;
  margin: 0;
}

.app-table .app-row-actions .btn,
.app-row-actions .app-action-btn {
  min-width: 92px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 850 !important;
  line-height: 1.1;
  white-space: nowrap;
}

.app-table .app-row-actions .btn.btn-sm {
  min-height: 36px;
}

.app-table .app-row-actions .btn:only-child {
  min-width: 92px;
}

@media (max-width: 1199.98px) {
  .app-filter-card-compact .app-filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-filter-card-compact .app-filter-search,
  .app-filter-form-simple .app-filter-search {
    grid-column: span 2;
  }
}

@media (max-width: 767.98px) {
  .app-filter-card-compact .app-filter-form {
    grid-template-columns: 1fr;
  }

  .app-filter-card-compact .app-filter-search,
  .app-filter-form-simple .app-filter-search {
    grid-column: auto;
  }

  .app-filter-card-compact .app-filter-actions {
    justify-content: stretch;
  }

  .app-filter-card-compact .app-filter-actions .btn {
    width: 100%;
  }

  .app-table .app-row-actions .btn,
  .app-row-actions .app-action-btn {
    min-width: 86px;
  }
}


/* Step 13-R4: professional attachment chips and upload progress */
.app-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: 280px;
  padding: .55rem .72rem;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: .95rem;
  background: linear-gradient(135deg, rgba(240, 253, 250, .95), rgba(255, 255, 255, .96));
  color: #0f766e;
  text-decoration: none;
  font-weight: 800;
}

.app-attachment-chip:hover,
.app-attachment-chip:focus {
  color: #115e59;
  border-color: rgba(15, 118, 110, .38);
  box-shadow: 0 12px 26px rgba(15, 118, 110, .12);
}

.app-attachment-chip-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: .75rem;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.app-attachment-chip span:last-child {
  min-width: 0;
  display: grid;
}

.app-attachment-chip small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #667085;
  font-weight: 650;
}

.app-upload-progress {
  margin-top: .7rem;
  padding: .8rem .9rem;
  border: 1px solid rgba(15, 118, 110, .15);
  border-radius: 1rem;
  background: rgba(240, 253, 250, .72);
}

.app-upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .55rem;
  color: #344054;
  font-size: .86rem;
  font-weight: 800;
}

.app-upload-progress-track {
  height: .46rem;
  border-radius: 999px;
  background: #dbe7ef;
  overflow: hidden;
}

.app-upload-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  transition: width .22s ease;
}


/* Step 13-R7: Unified modal viewport, sticky footer, and upload UX safety */
.modal .app-modal-content {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.modal .app-modal-content > form {
  min-height: 0;
  max-height: inherit;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.modal .app-modal-content .app-modal-header,
.modal .app-modal-content .app-modal-footer {
  flex: 0 0 auto;
}

.modal .app-modal-content .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal .app-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(226, 232, 240, .95);
  box-shadow: 0 -14px 34px rgba(15, 23, 42, .08);
}

.modal .app-modal-footer .btn {
  min-width: 132px;
}

.modal .app-validation-panel {
  margin-bottom: 1rem;
}

.app-upload-progress {
  display: grid;
  gap: .55rem;
}

.app-upload-progress.d-none {
  display: none !important;
}

.app-upload-progress-header {
  align-items: center;
}

.app-upload-progress-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex: 0 0 auto;
}

.app-upload-progress-actions strong {
  min-width: 56px;
  text-align: right;
}

.app-upload-remove-btn {
  min-height: 32px;
  padding: .28rem .7rem;
  border-radius: .75rem;
  font-weight: 800;
  white-space: nowrap;
}

.app-current-attachment {
  min-height: 54px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .7rem .85rem;
  border: 1px dashed rgba(148, 163, 184, .24);
  border-radius: 1rem;
  background: rgba(248, 250, 252, .78);
}

@media (max-width: 575.98px) {
  .modal .app-modal-content {
    max-height: calc(100vh - 1rem);
    border-radius: 18px;
  }

  .modal .app-modal-content .modal-body {
    padding: 1rem;
  }

  .modal .app-modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: 1rem;
  }

  .modal .app-modal-footer .btn {
    width: 100%;
  }

  .app-upload-progress-header,
  .app-upload-progress-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-upload-progress-actions strong {
    text-align: left;
  }
}


/* Step 13-R8: Unified attachment component */
.app-attachment-list {
  display: grid;
  gap: .6rem;
}

.app-attachment-card {
  display: inline-grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  width: min(100%, 360px);
  padding: .72rem .8rem;
  border: 1px solid rgba(15, 118, 110, .14);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(240, 253, 250, .92), rgba(255, 255, 255, .96));
  color: #344054;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.app-attachment-card:hover,
.app-attachment-card:focus {
  color: #0f5f59;
  border-color: rgba(15, 118, 110, .32);
  box-shadow: 0 14px 30px rgba(15, 118, 110, .10);
  transform: translateY(-1px);
}

.app-attachment-card-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: .9rem;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 10px 22px rgba(15, 118, 110, .18);
}

.app-attachment-card-body {
  min-width: 0;
  display: grid;
  gap: .14rem;
}

.app-attachment-card-body strong {
  max-width: 100%;
  color: #071a33;
  font-size: .88rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-attachment-card-body small {
  max-width: 100%;
  color: #667085;
  font-size: .78rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-attachment-card-action {
  min-width: 54px;
  padding: .32rem .52rem;
  border-radius: .75rem;
  color: #0f766e;
  background: rgba(15, 118, 110, .08);
  font-size: .74rem;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.app-attachment-summary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .62rem;
  border-radius: 999px;
  color: #0f5f59;
  background: rgba(217, 245, 240, .82);
  font-size: .78rem;
  font-weight: 800;
}

.app-attachment-empty {
  display: inline-flex;
  align-items: center;
  padding: .5rem .75rem;
  border: 1px dashed rgba(148, 163, 184, .28);
  border-radius: .85rem;
  color: #667085;
  background: rgba(248, 250, 252, .72);
  font-size: .84rem;
}

@media (max-width: 575.98px) {
  .app-attachment-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .app-attachment-card-action {
    grid-column: 1 / -1;
    justify-self: start;
  }
}


/* Step 13-R9: Read-only system field polish */
.app-readonly-field {
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 1rem;
  color: #344054;
  background: linear-gradient(135deg, rgba(248, 250, 252, .96), rgba(255, 255, 255, .92));
  font-weight: 800;
}


/* Step 13-R10-R4: locked staff context polish */
.app-readonly-input {
  background: linear-gradient(135deg, rgba(248, 250, 252, .96), rgba(255, 255, 255, .92)) !important;
  cursor: not-allowed;
  font-weight: 800;
}


/* Step 13-R10-R6: Modal QA safety layer */
.modal .app-modal-content .app-validation-panel {
  flex: 0 0 auto;
}

.modal .app-modal-content textarea.form-control {
  resize: vertical;
  max-height: 220px;
}

.modal .app-modal-content .app-readonly-field {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal .app-modal-footer {
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(10px);
}

@media (max-height: 760px) {
  .modal .app-modal-content {
    max-height: calc(100vh - .75rem);
  }

  .modal .app-modal-content .modal-body {
    padding-top: .9rem;
    padding-bottom: .9rem;
  }
}

/* Step 13-R16 — Enterprise sidebar information architecture and visual polish. */
.app-sidebar {
  width: 306px;
  min-width: 306px;
  gap: 14px;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 251, 0.92)),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 17rem);
  box-shadow: 14px 0 36px rgba(16, 24, 40, 0.035);
}

.app-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(217, 245, 240, 0.9), rgba(255, 255, 255, 0.94));
}

.app-sidebar-header-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--app-primary), #14b8a6);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.app-sidebar-header-title {
  color: var(--app-text);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.app-sidebar-header-subtitle {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.app-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.app-sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.app-sidebar-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.24);
}

.app-sidebar .app-sidebar-section + .app-sidebar-section {
  margin-top: 10px;
}

.app-sidebar-collapsible {
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.app-sidebar-collapsible.is-open {
  border-color: rgba(15, 118, 110, 0.12);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.035);
}

.app-sidebar .app-sidebar-caption {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0.58rem 0.68rem;
  border: 0;
  border-radius: 16px;
  color: #475467;
  background: transparent;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.68rem;
  font-weight: 900;
}

.app-sidebar .app-sidebar-caption:hover,
.app-sidebar .app-sidebar-caption:focus {
  color: var(--app-primary-dark);
  background: rgba(217, 245, 240, 0.6);
  outline: none;
}

.app-sidebar-caption-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-chevron {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--app-primary-dark);
  background: rgba(217, 245, 240, 0.86);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease;
}

.app-sidebar-collapsible:not(.is-open) .app-sidebar-chevron {
  transform: rotate(-90deg);
  background: rgba(226, 232, 240, 0.78);
}

.app-sidebar-group {
  display: none;
  gap: 6px;
  padding: 0 6px 8px;
}

.app-sidebar-collapsible.is-open .app-sidebar-group {
  display: grid;
}

.app-sidebar .app-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 0.54rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #334155;
  background: transparent;
  font-size: 0.91rem;
  font-weight: 780;
  letter-spacing: -0.01em;
  overflow: hidden;
}

.app-sidebar .app-sidebar-link::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.app-sidebar .app-sidebar-link-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-sidebar-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--app-primary-dark);
  background: rgba(217, 245, 240, 0.86);
  border: 1px solid rgba(15, 118, 110, 0.12);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.app-sidebar-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-mini-badge {
  flex: 0 0 auto;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  color: var(--app-primary-dark);
  background: rgba(217, 245, 240, 0.74);
  border: 1px solid rgba(15, 118, 110, 0.12);
  font-size: 0.64rem;
  font-weight: 900;
}

.app-sidebar .app-sidebar-link:hover,
.app-sidebar .app-sidebar-link:focus {
  color: var(--app-primary-dark);
  border-color: rgba(15, 118, 110, 0.14);
  background: rgba(240, 253, 250, 0.78);
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.045);
  transform: translateX(2px);
}

.app-sidebar .app-sidebar-link:hover .app-sidebar-icon,
.app-sidebar .app-sidebar-link:focus .app-sidebar-icon {
  background: rgba(20, 184, 166, 0.18);
  transform: scale(1.03);
}

.app-sidebar .app-sidebar-link.active {
  color: var(--app-primary-dark);
  border-color: rgba(15, 118, 110, 0.22);
  background:
    linear-gradient(135deg, rgba(217, 245, 240, 0.94), rgba(255, 255, 255, 0.92));
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.10);
}

.app-sidebar .app-sidebar-link.active::before {
  background: var(--app-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.app-sidebar .app-sidebar-link.active .app-sidebar-icon {
  color: #ffffff;
  background: var(--app-primary);
}

.app-sidebar-link-muted {
  opacity: 0.82;
}

.app-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.86);
}

.app-sidebar-user-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-weight: 950;
}

.app-sidebar-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.app-sidebar-user-meta strong,
.app-sidebar-user-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-user-meta strong {
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 900;
}

.app-sidebar-user-meta small {
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.app-mobile-nav {
  display: grid;
  gap: 12px;
}

.app-mobile-nav-section {
  padding: 10px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.72);
}

.app-mobile-nav-caption {
  padding: 0.35rem 0.45rem 0.5rem;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-mobile-nav-link {
  display: block;
  padding: 0.68rem 0.75rem;
  border-radius: 13px;
  color: #334155;
  text-decoration: none;
  font-weight: 800;
}

.app-mobile-nav-link:hover,
.app-mobile-nav-link:focus,
.app-mobile-nav-link.active {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

body.app-sidebar-collapsed .app-sidebar-header,
body.app-sidebar-collapsed .app-sidebar-scroll,
body.app-sidebar-collapsed .app-sidebar-footer {
  display: none;
}

@media (max-width: 1199.98px) {
  .app-sidebar {
    width: 286px;
    min-width: 286px;
  }
}
