@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e4e9f0;
  --border-strong: #cdd5e0;
  --text: #0f172a;
  --text-muted: #5b6b82;
  --text-soft: #8a98ad;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #15803d;
  --success-hover: #166534;
  --success-soft: #e8f7ee;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fdecec;
  --warning: #b45309;
  --warning-soft: #fff4de;
  --purple: #6d28d9;
  --purple-soft: #f1ebff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #aab6c8;
  --sidebar-hover: #1b2539;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.22);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);
  --sidebar-width: 256px;
  --topbar-height: 64px;
}

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

[hidden] {
  display: none !important;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.5;
  font-weight: 800;
}

p {
  margin: 0;
}

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

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

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

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ltr {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: right;
}

.num {
  font-variant-numeric: tabular-nums;
}

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

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

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-center {
  text-align: center;
}

.fw-bold {
  font-weight: 700;
}

.nowrap {
  white-space: nowrap;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 16px;
}

.mt-4 {
  margin-top: 24px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn.is-busy {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

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

.btn-secondary:hover {
  background: var(--surface-muted);
  color: var(--text);
}

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

.btn-success:hover {
  background: var(--success-hover);
  color: #fff;
}

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

.btn-danger:hover {
  background: var(--danger-hover);
  color: #fff;
}

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

.btn-soft-danger:hover {
  background: #fad6d6;
  color: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: #e9edf3;
  color: var(--text);
}

.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.85rem;
}

.btn-lg {
  min-height: 48px;
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: #e9edf3;
  color: var(--text);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

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

.form-hint {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.form-control,
.form-select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

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

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

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

.form-select {
  appearance: none;
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b82' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 14px;
}

.input-validation-error {
  border-color: var(--danger) !important;
}

.form-error,
.field-validation-error {
  font-size: 0.82rem;
  color: var(--danger);
}

.field-validation-valid {
  display: none;
}

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

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
}

.form-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.input-icon {
  position: relative;
  display: block;
}

.input-icon .icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-icon .form-control {
  padding-inline-start: 40px;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.alert ul {
  margin: 0;
  padding-inline-start: 18px;
}

.alert-danger {
  background: var(--danger-soft);
  border-color: #f6caca;
  color: var(--danger-hover);
}

.alert-success {
  background: var(--success-soft);
  border-color: #bfe8cf;
  color: var(--success-hover);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: #f7dca8;
  color: var(--warning);
}

.alert-info {
  background: var(--primary-soft);
  border-color: #cddcfd;
  color: var(--primary-hover);
}

.validation-summary-valid {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.8;
  white-space: nowrap;
}

.badge-gray {
  background: #eef1f5;
  color: #475569;
}

.badge-blue {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.badge-green {
  background: var(--success-soft);
  color: var(--success);
}

.badge-amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-purple {
  background: var(--purple-soft);
  color: var(--purple);
}

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

.card + .card {
  margin-top: 20px;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius) var(--radius);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.45rem;
}

.page-subtitle {
  margin-top: 4px;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.stat-icon.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-icon.amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.stat-icon.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.grid-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.grid-aside-start {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.grid-aside > .card + .card,
.grid-aside-start > .card + .card,
.grid-2 > .card + .card {
  margin-top: 0;
}

.stack > * + * {
  margin-top: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th {
  padding: 12px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: #fafbfd;
}

.table tfoot td {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.table .actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.cell-title {
  font-weight: 600;
}

.cell-sub {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.toolbar .form-control,
.toolbar .form-select {
  width: auto;
  min-width: 150px;
  flex: 1 1 170px;
}

.toolbar .toolbar-search {
  flex: 2 1 260px;
}

.tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  background: #e9edf3;
  border-radius: 10px;
}

.tab {
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pager-link {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.pager-link:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

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

.pager-link:disabled {
  opacity: 0.45;
  cursor: default;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .icon {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  color: var(--text-soft);
}

.empty-state-title {
  font-weight: 700;
  color: var(--text);
}

[data-list] {
  transition: opacity 0.15s;
}

.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

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

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

.detail-list dd {
  margin: 2px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.section-title {
  margin: 20px 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.public-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav form {
  margin: 0;
}

.site-main {
  flex: 1;
}

.site-footer {
  padding: 20px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.85rem;
  text-align: center;
}

.hero {
  padding: 72px 0 56px;
  background: radial-gradient(circle at 85% 0%, #dbe7ff 0, transparent 45%), linear-gradient(180deg, #f7f9fd, var(--bg));
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
}

.hero-eyebrow {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-title {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.4;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

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

.hero-panel {
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.flow-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}

.flow-step:last-child {
  border-bottom: 0;
}

.flow-step-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.flow-step-title {
  font-weight: 700;
}

.flow-step-text {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.features {
  padding: 24px 0 72px;
}

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

.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature .stat-icon {
  margin-bottom: 14px;
}

.feature h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

.auth {
  display: grid;
  place-items: center;
  padding: 48px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-card.wide {
  max-width: 580px;
}

.auth-header {
  margin-bottom: 24px;
  text-align: center;
}

.auth-header h1 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

.auth-footer {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

.message-page {
  display: grid;
  place-items: center;
  padding: 72px 16px;
  text-align: center;
}

.message-code {
  color: var(--primary);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.message-page h1 {
  margin: 14px 0 8px;
  font-size: 1.4rem;
}

.message-page p {
  margin-bottom: 20px;
  color: var(--text-muted);
}

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

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-height);
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.sidebar-brand:hover {
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-section {
  padding: 14px 12px 6px;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 0.93rem;
  font-weight: 500;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

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

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #64748b;
  font-size: 0.78rem;
}

.sidebar-overlay {
  display: none;
}

.app-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin-inline-start: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.sidebar-toggle {
  display: none;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu form {
  margin: 0;
}

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

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-role {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding: 28px 24px 48px;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  animation: fade-in 0.15s ease;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}

.modal-dialog:focus {
  outline: none;
}

.modal-dialog.modal-sm {
  max-width: 420px;
}

.modal-dialog.modal-lg {
  max-width: 860px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-body .modal-footer {
  margin: 20px -20px -20px;
}

.modal-loading {
  display: grid;
  place-items: center;
  min-height: 160px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.confirm-body {
  padding: 28px 24px 8px;
  text-align: center;
}

.confirm-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--warning-soft);
  color: var(--warning);
}

.confirm-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-icon .icon {
  width: 28px;
  height: 28px;
}

.confirm-message {
  margin: 8px 0 12px;
  color: var(--text-muted);
}

.toast-container {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--success);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-error {
  border-inline-start-color: var(--danger);
}

.toast-warning {
  border-inline-start-color: var(--warning);
}

.toast-message {
  flex: 1;
}

.toast-close {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.list-group {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.list-item.selectable {
  cursor: pointer;
}

.list-item.selectable:hover {
  background: var(--surface-muted);
}

.list-item.active {
  background: var(--primary-soft);
  box-shadow: inset -3px 0 0 var(--primary);
}

.list-item-title {
  font-weight: 600;
}

.list-item-meta {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vehicle-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.vehicle-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vehicle-title {
  font-weight: 700;
}

.plate {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.vehicle-card .detail-list {
  gap: 8px 16px;
}

.vehicle-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.product-result:last-child {
  border-bottom: 0;
}

.product-result-meta {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.product-result-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
}

.qty-control button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: var(--surface-muted);
  cursor: pointer;
}

.qty-control button:hover:not(:disabled) {
  background: #e9edf3;
}

.qty-control button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.qty-control .icon {
  width: 16px;
  height: 16px;
}

.qty-control input {
  width: 52px;
  height: 32px;
  padding: 0;
  border: 0;
  border-inline: 1px solid var(--border);
  text-align: center;
  -moz-appearance: textfield;
}

.qty-control input:focus {
  outline: none;
  background: var(--primary-soft);
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.summary-total {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 1.15rem;
  font-weight: 800;
}

.sticky-card {
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
}

.invoice-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

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

.timeline li {
  position: relative;
  padding-inline-start: 28px;
  padding-bottom: 18px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -6px;
  inset-inline-start: 7px;
  width: 2px;
  background: var(--border);
}

.timeline li:last-child::before {
  display: none;
}

.timeline li::after {
  content: "";
  position: absolute;
  top: 7px;
  inset-inline-start: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.timeline li.done::after {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.timeline-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.timeline-date {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.gateway {
  max-width: 480px;
  margin: 48px auto;
}

.gateway-amount {
  margin: 8px 0 20px;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
}

.result-icon.success {
  background: var(--success-soft);
  color: var(--success);
}

.result-icon.failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-icon .icon {
  width: 36px;
  height: 36px;
}

.gateway-actions {
  display: grid;
  gap: 10px;
}

.gateway-actions form {
  margin: 0;
}

.result-card {
  max-width: 560px;
  margin: 24px auto;
}

.result-details {
  margin: 24px 0;
  padding: 16px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  text-align: right;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.toolbar .input-icon .form-control {
  width: 100%;
  min-width: 0;
}

.toolbar form {
  margin: 0;
}

.card-header .form-select {
  width: auto;
  min-width: 140px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented label {
  position: relative;
  flex: 1 1 140px;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.segmented input:checked + span {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.segmented input:focus-visible + span {
  box-shadow: var(--focus-ring);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
}

.summary-item + .summary-item {
  border-inline-start: 1px solid var(--border);
}

.summary-label {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.inset-alert {
  margin: 16px 20px 0;
}

.text-end {
  text-align: left;
}

.order-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.order-line-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-line-total {
  margin-inline-start: auto;
  font-weight: 700;
  white-space: nowrap;
}

.order-summary {
  padding: 16px 20px;
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius) var(--radius);
}

.page-title .badge {
  margin-inline-start: 8px;
  vertical-align: middle;
}

.invoice-head {
  border-bottom: 1px solid var(--border);
}

.bordered-box {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.img-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 100px;
  padding: 12px;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #eef2f8 0 12px, #e6ebf4 12px 24px);
  border: 2px dashed #c3cde0;
  border-radius: inherit;
  color: #6b7a94;
  text-align: center;
}

.img-slot .icon {
  width: 30px;
  height: 30px;
  opacity: 0.7;
}

.img-slot-text {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
}

.img-slot-file {
  font-size: 0.72rem;
  opacity: 0.85;
  overflow-wrap: anywhere;
}

img.cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

img.contain {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb {
  display: block;
  flex-shrink: 0;
  width: 72px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
}

.thumb .img-slot {
  min-height: 0;
  padding: 2px;
  border-width: 1px;
}

.thumb .img-slot .icon {
  width: 18px;
  height: 18px;
}

.thumb .img-slot-text,
.thumb .img-slot-file {
  display: none;
}

.cell-media {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-wide {
  grid-column: 1 / -1;
}

.message-body {
  font-weight: 500;
  line-height: 1.9;
  white-space: pre-line;
}

.cover-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

a.stat-link {
  display: block;
  color: inherit;
}

.stat-link {
  border-radius: var(--radius);
  cursor: pointer;
}

.stat-link .stat-card {
  height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-link:hover .stat-card {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.stat-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@media (max-width: 1100px) {
  .grid-aside,
  .grid-aside-start {
    grid-template-columns: minmax(0, 1fr);
  }

  .sticky-card {
    position: static;
  }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(100%);
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  body.sidebar-open .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(15, 23, 42, 0.45);
  }

  .app-main {
    margin-inline-start: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

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

@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  .content {
    padding: 20px 16px 40px;
  }

  .topbar {
    padding: 0 16px;
  }

  .user-meta {
    display: none;
  }

  .form-row,
  .detail-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-body,
  .modal-body {
    padding: 16px;
  }

  .modal-body .modal-footer {
    margin: 16px -16px -16px;
  }

  .card-header,
  .toolbar,
  .pager {
    padding-inline: 16px;
  }

  .toolbar .form-control,
  .toolbar .form-select,
  .toolbar .input-icon {
    min-width: 0;
    flex-basis: 100%;
  }

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

  .summary-item + .summary-item {
    border-inline-start: 0;
    border-top: 1px solid var(--border);
  }

  .auth-card {
    padding: 24px 20px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .modal {
    padding: 16px 10px;
  }

  .hero {
    padding: 40px 0;
  }

  .product-result {
    flex-direction: column;
    align-items: stretch;
  }

  .product-result-side {
    justify-content: space-between;
  }
}
