:root {
  --brand-primary: #15324b;
  --brand-accent: #d4a62a;
}

* {
  box-sizing: border-box;
}
html {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #18212b;
  background: #f4f6f8;
}
body {
  margin: 0;
  min-height: 100vh;
}
a {
  color: var(--brand-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
.topbar {
  min-height: 68px;
  background: #fff;
  border-bottom: 1px solid #dfe5ea;
  display: flex;
  align-items: center;
  padding: 0 4vw;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--brand-primary);
  white-space: nowrap;
}
.brand img {
  display: block;
  max-width: 130px;
  max-height: 42px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}
.main-nav a {
  font-weight: 600;
  font-size: 0.94rem;
}
.account-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.account-menu form {
  margin: 0;
}
.nav-toggle {
  display: none;
}
.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 24px 70px;
}
.auth-shell {
  max-width: 480px;
  margin: 8vh auto;
  padding: 24px;
}
footer {
  text-align: center;
  padding: 24px;
  color: #66717c;
  font-size: 0.85rem;
}
.card {
  background: #fff;
  border: 1px solid #e0e5e9;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(25, 42, 58, 0.05);
  margin-bottom: 22px;
}
.auth-card {
  padding: 32px;
}
.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-brand img {
  max-width: 180px;
  max-height: 80px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f7b86;
  font-size: 0.76rem;
  font-weight: 800;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-header h1,
h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  color: #172533;
}
.page-header p {
  margin: 0;
  color: #66717c;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.button:hover {
  filter: brightness(1.07);
  text-decoration: none;
}
.button-secondary {
  background: #e9eef2;
  color: #263746;
}
.button-accent {
  background: var(--brand-accent);
  color: #18212b;
}
.button-danger {
  background: #a72c32;
}
.link-button {
  border: 0;
  background: none;
  color: #8d2228;
  padding: 0;
  cursor: pointer;
}
.grid {
  display: grid;
  gap: 20px;
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stat {
  font-size: 2rem;
  font-weight: 850;
  color: var(--brand-primary);
}
.stat-label {
  color: #66717c;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-full {
  grid-column: 1/-1;
}
.field label {
  font-weight: 700;
  font-size: 0.9rem;
}
.field small {
  color: #687582;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #b9c4cc;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #172533;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--brand-accent) 35%, transparent);
  border-color: var(--brand-primary);
}
.checkbox {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.checkbox input {
  margin-top: 4px;
}
.alert {
  padding: 13px 16px;
  border-radius: 9px;
  margin-bottom: 18px;
  border: 1px solid;
}
.alert-success {
  background: #ecf8f1;
  border-color: #87c6a2;
  color: #155b34;
}
.alert-error {
  background: #fff0f0;
  border-color: #e1a2a5;
  color: #812026;
}
.alert-warning {
  background: #fff8e5;
  border-color: #e5c86c;
  color: #6c5200;
}
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e7ebee;
  vertical-align: top;
}
.data-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #697681;
}
.badge {
  display: inline-flex;
  border-radius: 99px;
  padding: 4px 9px;
  background: #e9eef2;
  color: #304355;
  font-weight: 750;
  font-size: 0.78rem;
}
.badge-approved,
.badge-confirmed,
.badge-resolved {
  background: #dff4e7;
  color: #146136;
}
.badge-open,
.badge-review,
.badge-received {
  background: #e8f0ff;
  color: #235aa0;
}
.badge-urgent,
.badge-rejected,
.badge-changes_requested {
  background: #ffe4e5;
  color: #8c252b;
}
.muted {
  color: #697681;
}
.message {
  border-left: 4px solid #cbd4db;
  padding: 14px 16px;
  margin: 14px 0;
  background: #f8fafb;
  border-radius: 0 9px 9px 0;
}
.message-staff {
  border-left-color: var(--brand-accent);
  background: #fffaf0;
}
.message-internal {
  border-left-color: #922d34;
  background: #fff1f2;
}
.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: #697681;
  margin-bottom: 8px;
}
.detail-list {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
}
.detail-list dt {
  font-weight: 700;
  color: #53616e;
}
.detail-list dd {
  margin: 0;
}
.quick-ticket {
  border-top: 5px solid var(--brand-accent);
}
.empty {
  text-align: center;
  padding: 42px 18px;
  color: #697681;
}
.danger-zone {
  border-color: #e3abad;
}
.code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  word-break: break-all;
  background: #eef2f5;
  padding: 10px;
  border-radius: 7px;
}
.logo-preview {
  max-width: 240px;
  max-height: 100px;
}
@media (max-width: 980px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar {
    flex-wrap: wrap;
    padding: 12px 20px;
  }
  .nav-toggle {
    display: block;
    margin-left: auto;
  }
  .main-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }
  .main-nav.open {
    display: flex;
  }
  .account-menu {
    margin-left: auto;
  }
}
@media (max-width: 640px) {
  .grid-4,
  .grid-2,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .page-shell {
    padding: 24px 15px 60px;
  }
  .page-header {
    flex-direction: column;
  }
  .field-full {
    grid-column: auto;
  }
  .detail-list {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .account-menu {
    width: 100%;
    justify-content: space-between;
  }
  .auth-shell {
    margin: 3vh auto;
    padding: 15px;
  }
}
