:root {
  --itra-orange: #ff7a1a;
  --itra-orange-dark: #d95f00;
  --itra-orange-soft: #fff2e8;
  --itra-ink: #111827;
  --itra-muted: #667085;
  --itra-border: #e5e7eb;
  --itra-bg: #f5f7fb;
  --itra-card: #ffffff;
  --itra-green: #047857;
  --itra-red: #b42318;
  --itra-yellow: #b7791f;
  --itra-blue: #175cd3;
  --shadow: 0 14px 35px rgba(15, 23, 42, .08);
  --radius: 18px;
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--itra-ink);
  background: var(--itra-bg)
}

a {
  color: inherit;
  text-decoration: none
}

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

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

label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 8px
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  color: #111827;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--itra-orange);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, .13)
}

small,
.hint {
  color: var(--itra-muted);
  font-size: 12.5px;
  line-height: 1.45
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.auth-brand {
  background: linear-gradient(145deg, #ff861f, #f97316);
  padding: 52px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-logo {
  max-width: 440px;
  width: 80%;
  height: auto
}

.auth-brand h1 {
  font-size: 48px;
  line-height: 1.04;
  margin: 42px 0 18px
}

.auth-brand p {
  font-size: 18px;
  line-height: 1.6;
  max-width: 640px;
  opacity: .94
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
}

.auth-card {
  width: 100%;
  max-width: 510px;
  background: white;
  border: 1px solid var(--itra-border);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 32px;
  margin: 0 0 8px
}

.auth-card .sub {
  color: var(--itra-muted);
  margin: 0 0 26px;
  line-height: 1.5
}

.auth-card .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.auth-footer {
  margin-top: 22px;
  color: var(--itra-muted);
  font-size: 14px
}

.auth-footer a {
  color: var(--itra-orange-dark);
  font-weight: 800
}

.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  color: #d1d5db;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  background: #ff7a1a;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 24px;
}

.sidebar-logo img {
  width: 100%;
  display: block
}

.nav-section {
  margin-top: 18px
}

.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: #9ca3af;
  font-weight: 800;
  margin: 18px 10px 8px
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  color: #e5e7eb;
  font-weight: 700;
  font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 122, 26, .15);
  color: #fff
}

.nav-link.active {
  border: 1px solid rgba(255, 122, 26, .38)
}

.user-mini {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  background: #1f2937;
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
}

.main {
  padding: 28px;
}

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

.eyebrow {
  color: var(--itra-muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em
}

h1 {
  font-size: 34px;
  margin: 6px 0
}

h2 {
  font-size: 22px;
  margin: 0 0 14px
}

h3 {
  font-size: 17px;
  margin: 0 0 10px
}

.page-subtitle {
  color: var(--itra-muted);
  margin: 0;
  line-height: 1.5
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap
}

.btn {
  border: none;
  border-radius: 13px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--itra-orange-dark)
}

.btn-outline {
  background: white;
  color: var(--itra-orange-dark);
  border: 1px solid #ffb57d
}

.btn-soft {
  background: var(--itra-orange-soft);
  color: #9a4a00
}

.btn-danger {
  background: #fee4e2;
  color: var(--itra-red)
}

.card {
  background: var(--itra-card);
  border: 1px solid var(--itra-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi {
  padding: 20px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--itra-border);
  box-shadow: var(--shadow)
}

.kpi span {
  display: block;
  color: var(--itra-muted);
  font-size: 13px;
  font-weight: 800
}

.kpi strong {
  display: block;
  font-size: 30px;
  margin-top: 8px
}

.filters {
  display: grid;
  grid-template-columns: 1.2fr .7fr .7fr auto;
  gap: 12px;
  align-items: end;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--itra-border);
  border-radius: 16px
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
  background: white
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--itra-border);
  text-align: left;
  font-size: 14px;
  vertical-align: top
}

th {
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #344054
}

tr:last-child td {
  border-bottom: none
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-draft {
  background: #f2f4f7;
  color: #344054
}

.badge-submitted {
  background: #e0f2fe;
  color: #026aa2
}

.badge-review {
  background: #fff7ed;
  color: #c2410c
}

.badge-approved {
  background: #dcfce7;
  color: #166534
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b
}

.badge-appeal {
  background: #fef3c7;
  color: #92400e
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px
}

.field-full {
  grid-column: 1/-1
}

.divider {
  height: 1px;
  background: var(--itra-border);
  margin: 22px 0
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.step {
  background: #fff;
  border: 1px solid var(--itra-border);
  border-radius: 14px;
  padding: 14px;
  min-height: 94px;
}

.step .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f2f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #344054;
  margin-bottom: 10px;
}

.step.active {
  border-color: #ffb57d;
  background: #fff7ed
}

.step.active .n {
  background: var(--itra-orange);
  color: white
}

.step.done {
  border-color: #bbf7d0;
  background: #f0fdf4
}

.step.done .n {
  background: var(--itra-green);
  color: white
}

.timeline {
  border-left: 3px solid #e5e7eb;
  margin-left: 12px;
  padding-left: 22px
}

.t-item {
  position: relative;
  margin-bottom: 22px
}

.t-item:before {
  content: "";
  position: absolute;
  left: -32px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--itra-orange);
  border: 3px solid white;
  box-shadow: 0 0 0 2px #fed7aa
}

.t-item strong {
  display: block
}

.t-item span {
  display: block;
  color: var(--itra-muted);
  font-size: 13px;
  margin-top: 3px
}

.note-box {
  background: #f8fafc;
  border: 1px solid var(--itra-border);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.5;
  color: #475467
}

.footer-actions {
  position: sticky;
  bottom: 0;
  background: rgba(245, 247, 251, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--itra-border);
  padding: 16px 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.public-note {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* =====================================================
   SIDEBAR COLLAPSIBLE MENU
   ===================================================== */

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  background: transparent;
  border: none;

  padding: 12px 12px;
  border-radius: 12px;

  color: #e5e7eb;
  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  transition: all .2s ease;
}

.nav-group-toggle:hover {
  background: rgba(255, 122, 26, .15);
  color: #ffffff;
}

.nav-group-toggle.open {
  background: rgba(255, 122, 26, .15);
  color: #ffffff;
}

.nav-group-toggle .arrow {
  transition: transform .25s ease;
  font-size: 12px;
}

.nav-group-toggle.open .arrow {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  margin-top: 4px;
  margin-bottom: 8px;
}

.submenu.open {
  display: block;
}

.nav-sub {
  padding-left: 32px;
  font-size: 13px;
  color: #cbd5e1;
}

.nav-sub:hover {
  color: #ffffff;
}

.nav-sub.active {
  background: rgba(255, 122, 26, .15);
  color: #ffffff;
  border: 1px solid rgba(255, 122, 26, .38);
}

.nav-group-toggle span:first-child {
  text-align: left;
  flex: 1;
}

.mobile-menu-button,
.mobile-menu-close,
.sidebar-overlay {
  display: none;
}

.form-spacer {
  height: 14px;
}

.auth-error {
  background: #fee4e2;
  color: #991b1b;
  border-color: #fecaca;
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 22px;
}

.auth-options a {
  color: var(--itra-orange-dark);
  font-weight: 800;
  font-size: 14px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

.remember-me input {
  width: auto;
  margin: 0;
}

.auth-submit {
  justify-content: center;
  width: 100%;
}

.mobile-auth-logo {
  display: none;
}

/* ==========================================================
   MEDIA CENTER
   ========================================================== */

.location-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
}

.location-separator {
    color: #9ca3af;
    font-weight: 700;
}


.stacked-fields {
  display: grid;
  gap: 8px;
}

.stacked-fields small {
  display: block;
  margin-bottom: 4px;
  color: var(--itra-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}


.collapsible-section {
  padding: 0;
  overflow: hidden;
}

.section-toggle {
  width: 100%;
  border: none;
  background: #ffffff;
  color: var(--itra-ink);
  padding: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.section-toggle:hover {
  background: #f8fafc;
}

.section-toggle strong {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}

.section-toggle small {
  display: block;
  color: var(--itra-muted);
  font-weight: 500;
  line-height: 1.4;
}

.section-toggle-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--itra-orange-soft);
  color: var(--itra-orange-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  flex: 0 0 auto;
}

.section-body {
  padding: 0 22px 22px;
}

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


@media (max-width:1100px) {
  .app-layout {
    grid-template-columns: 1fr
  }

  .sidebar {
    position: relative;
    height: auto
  }

  .user-mini {
    position: static;
    margin-top: 20px
  }

  .kpi-grid,
  .stepper {
    grid-template-columns: repeat(2, 1fr)
  }

  .filters {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:760px) {
  
  .location-path {
      margin-top: 4px;
  }

  .location-badge {
      font-size: 11px;
      padding: 3px 6px;
  }

  .auth-shell {
    min-height: 100svh;
    display: block;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    min-height: 100svh;
    padding: 18px;
    align-items: center;
    justify-content: center;
  }

  .auth-card {
    width: 100%;
    max-width: none;
    padding: 24px;
    border-radius: 20px;
  }

  .auth-card h2 {
    font-size: 28px;
  }

  .auth-card .sub {
    margin-bottom: 22px;
  }

  .auth-card .row,
  .form-grid,
  .form-grid-3,
  .filters,
  .kpi-grid,
  .stepper {
    grid-template-columns: 1fr;
  }

  .auth-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .auth-submit {
    padding: 14px 16px;
  }

  .mobile-auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
  }

  .mobile-auth-logo img {
    width: 180px;
    max-width: 70%;
    height: auto;
  }

  .auth-panel {
    min-height: 100svh;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .main {
    padding: 18px;
  }

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

  .table-wrap {
    border: none;
    overflow: visible;
  }

  .table-wrap table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
    background: transparent;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr {
    background: #ffffff;
    border: 1px solid var(--itra-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 14px;
  }

  .table-wrap td {
    border-bottom: 1px solid var(--itra-border);
    padding: 10px 0;
    font-size: 14px;
  }

  .table-wrap td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    color: var(--itra-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .table-actions .btn,
  .table-actions form,
  .table-actions button {
    width: 100%;
  }

  .table-actions .btn,
  .table-actions button {
    justify-content: center;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    position: sticky;
    top: 0;
    z-index: 900;

    width: calc(100% - 36px);
    margin: 18px 18px 0;

    border: none;
    border-radius: 14px;

    background: #111827;
    color: #ffffff;

    padding: 13px 16px;

    font-weight: 800;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: 300px;
    max-width: 86vw;
    height: 100vh;

    z-index: 1100;

    transform: translateX(-105%);
    transition: transform .25s ease;

    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;

    position: fixed;
    inset: 0;

    background: rgba(15, 23, 42, .56);
    z-index: 1000;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: 14px;
    right: 14px;

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 999px;

    background: rgba(255,255,255,.12);
    color: #ffffff;

    font-size: 18px;
    font-weight: 900;

    cursor: pointer;
  }

  .sidebar-logo {
    padding-right: 52px;
  }

  .user-mini {
    position: static;
    margin-top: 20px;
  }
}