:root {
  --ampro-bg: #f6f7fb;
  --ampro-surface: #ffffff;
  --ampro-text: #182033;
  --ampro-muted: #64748b;
  --ampro-border: #d9e0ea;
  --ampro-primary: #176b87;
  --ampro-primary-dark: #104f63;
  --ampro-accent: #d97706;
  --ampro-success: #168a5b;
  --ampro-danger: #c2413d;
  --ampro-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}

html {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--ampro-bg);
  color: var(--ampro-text);
  letter-spacing: 0;
}

body {
  background:
    linear-gradient(180deg, #f8fafc 0%, var(--ampro-bg) 36%, #f3f5f9 100%);
  color: var(--ampro-text);
}

.container {
  max-width: 1440px;
}

.ampro-shell {
  min-height: calc(100vh - 56px);
}

.ampro-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #12313f;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.ampro-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f3c969;
  color: #172033;
  font-weight: 800;
}

.ampro-nav-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}

.ampro-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 36px;
  padding: .45rem .7rem;
  border-radius: 8px;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
  font-size: .88rem;
  transition: background-color .15s ease, color .15s ease;
}

.ampro-nav-link:hover,
.ampro-nav-link.is-active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.ampro-user-chip {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: .35rem .55rem;
}

main.container {
  padding-top: 1.35rem;
  padding-bottom: 2rem;
}

.ampro-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.ampro-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ampro-text);
  line-height: 1.2;
}

.ampro-page-subtitle {
  color: var(--ampro-muted);
  font-size: .92rem;
  margin-top: .28rem;
}

.ampro-card,
main article,
main form.bg-white,
main .bg-white {
  border-color: var(--ampro-border) !important;
  border-radius: 8px !important;
  box-shadow: var(--ampro-shadow);
}

.ampro-card {
  background: var(--ampro-surface);
  border: 1px solid var(--ampro-border);
}

.ampro-stat-card {
  position: relative;
  overflow: hidden;
}

.ampro-stat-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent, var(--ampro-primary));
}

.ampro-card-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef6f8;
  color: var(--ampro-primary);
}

a,
button {
  text-underline-offset: 3px;
}

button,
.btn,
a[class*="bg-"],
button[class*="bg-"] {
  border-radius: 8px !important;
  font-weight: 700;
}

.ampro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 36px;
  padding: .45rem .85rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
}

.ampro-btn-primary {
  background: var(--ampro-primary);
  color: white;
}

.ampro-btn-primary:hover {
  background: var(--ampro-primary-dark);
}

.ampro-btn-soft {
  background: #e9f4f6;
  color: var(--ampro-primary-dark);
}

.ampro-btn-neutral {
  background: #eef2f7;
  color: #334155;
}

input,
select,
textarea {
  border-color: var(--ampro-border) !important;
  border-radius: 8px !important;
  color: var(--ampro-text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ampro-primary) !important;
  box-shadow: 0 0 0 3px rgba(23,107,135,.14) !important;
  outline: none !important;
}

label {
  color: #475569;
  font-weight: 650;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  background: #f1f5f9 !important;
}

th {
  color: #475569;
  font-weight: 800;
  white-space: nowrap;
}

td,
th {
  border-color: #e6ebf2 !important;
}

tbody tr {
  transition: background-color .12s ease;
}

tbody tr:hover {
  background: #f8fafc !important;
}

.ampro-flash {
  border-radius: 8px;
  padding: .75rem 1rem;
  border: 1px solid;
}

.ampro-footer {
  color: #7a8798;
  border-top: 1px solid var(--ampro-border);
  background: rgba(255,255,255,.7);
}

@media (max-width: 768px) {
  .ampro-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  main.container {
    padding-inline: .85rem;
  }

  table {
    font-size: .86rem;
  }
}

@media print {
  .ampro-topbar,
  .ampro-footer {
    display: none !important;
  }

  body {
    background: white;
  }
}


/* Inner page polish */
main h1 {
  color: var(--ampro-text);
  letter-spacing: 0;
}

main [class*="rounded-xl"],
main [class*="rounded-2xl"] {
  border-radius: 8px !important;
}

main .shadow,
main .shadow-sm,
main .shadow-md {
  box-shadow: var(--ampro-shadow) !important;
}

main a.text-blue-600,
main a.text-blue-700,
main button.text-blue-700 {
  color: var(--ampro-primary) !important;
  font-weight: 700;
}

main a.text-gray-700,
main a.text-amber-600 {
  font-weight: 700;
}

main form.inline button,
main td form button {
  font-weight: 700;
}

.ampro-dense-table td,
.ampro-dense-table th {
  padding: .72rem 1rem;
}

.ampro-empty {
  padding: 2rem;
  text-align: center;
  color: var(--ampro-muted);
}


/* Form/detail page polish */
.ampro-page {
  max-width: 1180px;
  margin-inline: auto;
}

.ampro-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ampro-eyebrow {
  color: var(--ampro-primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: .2rem;
}

.ampro-btn-secondary {
  background: #eef2f7;
  color: #334155;
  border: 1px solid var(--ampro-border);
}

.ampro-btn-secondary:hover {
  background: #e2e8f0;
}

.ampro-flash {
  border: 1px solid;
  border-radius: 8px;
  padding: .85rem 1rem;
}

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

.ampro-dl dt {
  color: var(--ampro-muted);
  font-size: .82rem;
  margin-bottom: .2rem;
}

.ampro-dl dd {
  color: var(--ampro-text);
  font-weight: 800;
  margin: 0;
  word-break: break-word;
}

.ltr {
  direction: ltr;
  text-align: left;
}

@media (max-width: 720px) {
  .ampro-page-header {
    align-items: stretch;
  }
  .ampro-page-header > div:last-child,
  .ampro-page-header > a {
    width: 100%;
  }
  .ampro-page-header .ampro-btn {
    flex: 1 1 auto;
  }
  .ampro-dl {
    grid-template-columns: 1fr;
  }
}


/* Order workflow polish */
.ampro-metric {
  border: 1px solid var(--ampro-border);
  border-radius: 8px;
  padding: 1rem;
  background: #f8fafc;
}

.ampro-progress {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.ampro-progress span {
  display: block;
  height: 100%;
  background: var(--ampro-primary);
}

.ampro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: .78rem;
  font-weight: 800;
}

.ampro-line-item,
.ampro-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--ampro-border);
  border-radius: 8px;
  padding: .85rem;
}

.ampro-stage-btn {
  min-height: 30px;
  padding: .25rem .55rem;
  border: 1px solid var(--ampro-border);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
}

.ampro-stage-btn.is-active {
  background: var(--ampro-primary);
  border-color: var(--ampro-primary);
  color: #fff;
}

.ampro-empty {
  border: 1px dashed var(--ampro-border);
  border-radius: 8px;
  padding: 1rem;
  color: var(--ampro-muted);
  background: #f8fafc;
}

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

.ampro-table th,
.ampro-table td {
  padding: .75rem;
  border-bottom: 1px solid var(--ampro-border);
  text-align: right;
  vertical-align: middle;
}

.ampro-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  white-space: nowrap;
}

.ampro-link-danger {
  color: #be123c;
  font-weight: 800;
}

.ampro-link-danger:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .ampro-line-item,
  .ampro-file-row {
    align-items: stretch;
    flex-direction: column;
  }
}
