:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --text: #172033;
  --text-soft: #64748b;
  --text-muted: #94a3b8;
  --background: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --sidebar: #111827;
  --sidebar-text: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --sidebar-width: 250px;
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body:has(.modal:not([hidden])) {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  color: var(--text);
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 7px;
  font-size: 1rem;
}

p {
  margin-bottom: 16px;
  color: var(--text-soft);
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

/* Branding */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

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

.brand-logo {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: 0 7px 18px rgba(79, 70, 229, 0.25);
  font-size: 0.75rem;
  font-weight: 900;
}

.brand-text {
  font-size: 1.08rem;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Buttons */

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition),
    color var(--transition), border-color var(--transition),
    background var(--transition);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 7px 16px rgba(79, 70, 229, 0.2);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.button-secondary {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-dark);
  background: var(--surface-soft);
}

.button-outline {
  color: var(--primary);
  border-color: #c7d2fe;
  background: transparent;
}

.button-outline:hover:not(:disabled) {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-light);
}

.button-success {
  color: #fff;
  border-color: var(--success);
  background: var(--success);
}

.button-danger {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-light);
}

.button-small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.button-full {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-dark);
  background: var(--surface-soft);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Public navigation */

.public-navbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 14px max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.public-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--text-soft);
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Landing */

.landing-page {
  background:
    radial-gradient(circle at 10% 5%, rgba(99, 102, 241, 0.1), transparent 30%),
    var(--surface);
}

.landing-hero {
  display: grid;
  max-width: 1180px;
  min-height: 650px;
  margin: 0 auto;
  padding: 90px 24px;
  align-items: center;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
  gap: 80px;
}

.landing-hero-content h1 {
  max-width: 700px;
  margin-bottom: 22px;
  font-size: clamp(2.4rem, 5vw, 4.15rem);
}

.landing-description {
  max-width: 650px;
  margin-bottom: 30px;
  font-size: 1.08rem;
}

.landing-actions,
.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-highlights {
  gap: 22px;
  margin: 32px 0 0;
  padding: 0;
  color: var(--text-soft);
  list-style: none;
}

.hero-highlights li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-highlights li::before {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: var(--success);
  background: var(--success-light);
  content: "✓";
  font-size: 0.7rem;
}

.hero-summary-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
}

.summary-card-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.summary-card-header p {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.landing-progress {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.landing-progress li {
  position: relative;
  display: flex;
  min-height: 74px;
  gap: 14px;
}

.landing-progress li:not(:last-child)::after {
  position: absolute;
  top: 34px;
  bottom: 6px;
  left: 16px;
  width: 1px;
  background: var(--border);
  content: "";
}

.landing-progress li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  border: 1px solid #c7d2fe;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 800;
}

.landing-progress strong,
.landing-progress small {
  display: block;
}

.landing-progress small {
  color: var(--text-soft);
}

.landing-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 90px 24px;
}

.landing-section-heading {
  max-width: 650px;
  margin: 0 auto 45px;
  text-align: center;
}

.landing-section-heading h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.feature-grid,
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature-card,
.workflow-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feature-card {
  min-height: 235px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card h3 {
  margin-top: 32px;
}

.feature-number {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.landing-level-section {
  max-width: none;
  padding-right: max(24px, calc((100% - 1180px) / 2));
  padding-left: max(24px, calc((100% - 1180px) / 2));
  background: var(--surface-soft);
}

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

.workflow-card > span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 800;
}

.workflow-card p {
  margin-bottom: 0;
}

.landing-cta {
  display: flex;
  max-width: 1132px;
  margin: 30px auto 100px;
  padding: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(135deg, #312e81, var(--primary));
  box-shadow: 0 20px 50px rgba(49, 46, 129, 0.25);
}

.landing-cta h2,
.landing-cta p,
.landing-cta .eyebrow {
  color: #fff;
}

.landing-cta p {
  margin-bottom: 0;
}

.landing-cta .button-primary {
  color: var(--primary);
  border-color: #fff;
  background: #fff;
}

.public-footer {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 35px max(24px, calc((100% - 1180px) / 2));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.public-footer p {
  max-width: 430px;
  margin: 10px 0 0;
  font-size: 0.85rem;
}

.public-footer nav {
  display: flex;
  gap: 18px;
}

/* Public form */

.public-page {
  background:
    radial-gradient(circle at 80% 5%, rgba(99, 102, 241, 0.09), transparent 28%),
    var(--background);
}

.public-main {
  width: min(850px, calc(100% - 40px));
  margin: 0 auto;
  padding: 65px 0 90px;
}

.hero-section {
  max-width: 700px;
  margin-bottom: 32px;
}

.hero-section h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.form-card,
.content-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-card {
  padding: 30px;
}

.content-card {
  padding: 24px;
}

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

.section-header h2 {
  margin-bottom: 4px;
}

.section-header p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Forms */

.form-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 21px;
}

.form-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label,
.search-field > span {
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

input:read-only {
  color: var(--text-soft);
  background: var(--surface-soft);
}

input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  accent-color: var(--primary);
}

.field-help,
.form-group small {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.field-error {
  color: var(--danger) !important;
}

.form-actions,
.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.filter-form {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 14px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
}

.search-field {
  display: flex;
  width: min(360px, 100%);
  flex-direction: column;
  gap: 7px;
}

.table-toolbar {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
}

/* Alerts */

.alert {
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.88rem;
}

.form-card > .alert {
  margin-bottom: 24px;
}

.alert-info {
  color: #075985;
  border-color: #bae6fd;
  background: var(--info-light);
}

.alert-error {
  color: #991b1b;
  border-color: #fecaca;
  background: var(--danger-light);
}

.alert-success {
  color: #166534;
  border-color: #bbf7d0;
  background: var(--success-light);
}

/* Login */

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 35px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.17), transparent 30%),
    var(--background);
}

.auth-main {
  width: 100%;
}

.auth-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  margin-bottom: 34px;
}

.auth-header {
  margin-bottom: 25px;
}

.auth-form {
  display: grid;
  gap: 19px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 100px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  padding: 6px 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  color: var(--primary);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-footer {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Desktop sidebar */

.app-page {
  background: var(--background);
}

.sidebar {
  position: fixed;
  z-index: 100;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 20px 15px;
  color: var(--sidebar-text);
  background: var(--sidebar);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.sidebar .brand {
  color: #fff;
}

.sidebar .brand-logo {
  box-shadow: none;
}

.sidebar-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-close {
  display: none;
  color: var(--sidebar-text);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-navigation {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding-top: 20px;
  overflow-y: auto;
}

.sidebar-label {
  margin: 18px 11px 7px;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-label:first-child {
  margin-top: 0;
}

.sidebar-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

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

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout:hover {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

.app-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 240ms ease;
}

/* App navbar */

.navbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
}

.navbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.navbar p {
  margin: 2px 0 0;
  font-size: 0.8rem;
}

.navbar-left,
.navbar-right,
.user-menu {
  display: flex;
  align-items: center;
}

.navbar-left {
  min-width: 0;
  gap: 13px;
}

.navbar-right {
  gap: 18px;
}

.menu-button {
  display: none;
}

.user-menu {
  gap: 10px;
}

.user-menu > div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-menu strong {
  font-size: 0.86rem;
}

.user-menu small {
  color: var(--text-soft);
  font-size: 0.73rem;
}

.user-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 800;
}

.user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  font-size: 0.76rem;
}

.notification-button {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-soft);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
}

.notification-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  margin-left: 4px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--danger);
  font-size: 0.67rem;
}

.app-content {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 28px 30px 50px;
}

.app-content > * + * {
  margin-top: 22px;
}

/* Dashboard */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-card {
  display: flex;
  min-width: 0;
  min-height: 145px;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-label {
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-value {
  display: block;
  overflow: hidden;
  margin-bottom: 6px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-card a,
.dashboard-card small {
  margin-top: auto;
  color: var(--text-soft);
  font-size: 0.77rem;
}

.dashboard-card a {
  color: var(--primary);
  font-weight: 700;
}

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

/* Tables */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
}

.data-table td {
  font-size: 0.84rem;
}

.data-table tbody tr:not(.empty-table-row):hover {
  background: #fafaff;
}

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

.empty-table-row td {
  padding: 0;
}

.empty-state {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  text-align: center;
}

.empty-state::before {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-light);
  content: "—";
}

.empty-state p {
  margin-bottom: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 18px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

/* Badges */

.status-badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pending {
  color: #92400e;
  background: var(--warning-light);
}

.status-assigned {
  color: #3730a3;
  background: #e0e7ff;
}

.status-in-progress {
  color: #075985;
  background: var(--info-light);
}

.status-completed,
.status-active {
  color: #166534;
  background: var(--success-light);
}

.status-approved {
  color: #5b21b6;
  background: #ede9fe;
}

.status-paid {
  color: #166534;
  background: #bbf7d0;
}

.status-inactive,
.status-cancelled {
  color: #991b1b;
  background: var(--danger-light);
}

/* Detail */

.back-link {
  display: inline-block;
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 700;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.detail-header h2 {
  margin-bottom: 3px;
  font-size: 1.7rem;
}

.detail-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--text-soft);
  font-size: 0.84rem;
}

.detail-list dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Timeline */

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

.timeline-item {
  position: relative;
  min-height: 58px;
  padding: 0 0 18px 30px;
}

.timeline-item::before {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 0;
  width: 13px;
  height: 13px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  outline: 1px solid var(--border-dark);
  background: var(--border-dark);
  content: "";
}

.timeline-item:not(:last-child)::after {
  position: absolute;
  top: 19px;
  bottom: 0;
  left: 6px;
  width: 1px;
  background: var(--border);
  content: "";
}

.timeline-item.active::before {
  outline-color: var(--primary);
  background: var(--primary);
}

.timeline-item.completed::before {
  outline-color: var(--success);
  background: var(--success);
}

.timeline-item strong,
.timeline-item time,
.timeline-item span {
  display: block;
}

.timeline-item time,
.timeline-item span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

/* Profile */

.profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 17px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}

.profile-metadata {
  display: grid;
  width: min(600px, 60%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 25px;
}

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

.security-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

/* Modal and toast */

.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  padding: 18px 22px;
}

.modal-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  display: grid;
  padding: 22px;
  gap: 18px;
}

.modal-footer {
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.toast-container {
  position: fixed;
  z-index: 1100;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(380px, calc(100% - 44px));
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.toast-success {
  color: #166534;
  border-color: #bbf7d0;
}

.toast-error {
  color: #991b1b;
  border-color: #fecaca;
}

.toast-close {
  padding: 0;
  border: 0;
  color: currentColor;
  background: transparent;
  font-size: 1.2rem;
}

/* Tablet */

@media (max-width: 1100px) {
  .landing-hero {
    gap: 45px;
  }

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

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

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

  .profile-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-metadata {
    width: 100%;
  }
}

/* Off-canvas sidebar */

@media (max-width: 850px) {
  .public-navbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .public-navigation {
    width: 100%;
    overflow-x: auto;
  }

  .landing-hero {
    min-height: auto;
    padding-top: 65px;
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .feature-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-cta {
    margin-right: 24px;
    margin-left: 24px;
    align-items: flex-start;
    flex-direction: column;
  }

  .public-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-page .sidebar {
    position: fixed;
    z-index: 200;
    inset: 0 auto 0 0;
    width: min(280px, 84vw);
    height: 100dvh;
    padding: 20px 15px;
    transform: translateX(-105%);
    visibility: hidden;
    box-shadow: none;
  }

  .app-page .sidebar.sidebar-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 18px 0 50px rgba(15, 23, 42, 0.32);
  }

  .app-page .sidebar-header {
    padding-bottom: 18px;
  }

  .app-page .sidebar-navigation {
    display: flex;
    flex: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    padding-top: 20px;
  }

  .app-page .sidebar-label {
    display: block;
  }

  .app-page .sidebar-link {
    min-height: 42px;
    justify-content: flex-start;
    padding: 9px 12px;
    text-align: left;
  }

  .app-page .sidebar-footer {
    display: block;
  }

  .app-page .sidebar-close {
    display: inline-grid;
  }

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

  .navbar {
    position: sticky;
    top: 0;
    min-height: 72px;
    padding: 12px 20px;
  }

  .menu-button {
    display: inline-grid;
    color: var(--text);
    background: var(--surface);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */

@media (max-width: 650px) {
  body {
    font-size: 14px;
  }

  .public-navbar {
    padding: 13px 18px;
  }

  .public-navigation {
    gap: 3px;
  }

  .public-navigation .nav-link {
    padding: 8px;
    font-size: 0.82rem;
  }

  .public-navigation .button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .landing-hero,
  .landing-section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .landing-hero {
    padding-top: 50px;
    padding-bottom: 60px;
  }

  .landing-hero-content h1 {
    font-size: 2.35rem;
  }

  .hero-highlights {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .feature-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

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

  .landing-section {
    padding-top: 65px;
    padding-bottom: 65px;
  }

  .landing-cta {
    margin: 10px 18px 70px;
    padding: 30px 24px;
  }

  .public-main {
    width: min(100% - 30px, 850px);
    padding-top: 45px;
  }

  .form-card,
  .content-card {
    padding: 19px;
  }

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

  .form-group-full {
    grid-column: auto;
  }

  .form-actions,
  .filter-actions {
    width: 100%;
  }

  .form-actions .button,
  .filter-actions .button {
    flex: 1;
  }

  .auth-card {
    padding: 26px 21px;
  }

  .navbar {
    min-height: 68px;
    padding: 10px 14px;
  }

  .navbar h1 {
    font-size: 1.05rem;
  }

  .navbar p,
  .notification-button,
  .user-menu > div {
    display: none;
  }

  .navbar-right {
    gap: 8px;
  }

  .menu-button {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .app-content {
    padding: 20px 14px 40px;
  }

  .dashboard-grid,
  .finance-summary,
  .profile-statistics {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    min-height: 125px;
  }

  .section-header,
  .detail-header,
  .detail-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-header > .button,
  .section-header > button,
  .detail-status,
  .detail-status .button {
    width: 100%;
  }

  .detail-list > div {
    flex-direction: column;
    gap: 4px;
  }

  .detail-list dd {
    text-align: left;
  }

  .profile-header {
    align-items: flex-start;
  }

  .profile-metadata {
    grid-template-columns: 1fr;
  }

  .security-item {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    justify-content: space-between;
  }

  .modal {
    padding: 10px;
  }

  .modal-content {
    max-height: calc(100vh - 20px);
  }

  .modal-header,
  .modal-footer {
    padding: 15px 17px;
  }

  .modal-body {
    padding: 17px;
  }

  .modal-footer .button {
    flex: 1;
  }
}