:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --navy: #17324d;
  --teal: #0f766e;
  --danger: #b42318;
  --success-bg: #e8f6ef;
  --success: #146c43;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--teal);
}

.app-nav {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.navbar-brand {
  color: var(--navy);
  font-weight: 800;
}

.nav-link {
  color: var(--ink);
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.logout-form button,
.secondary-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 13px;
  text-decoration: none;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 28px auto;
}

.login-page {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 18px 45px rgba(23, 32, 51, .08);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 800;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 18px;
  font-weight: 800;
}

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

.form-stack,
.ticket-form {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 700;
  color: #2a364a;
}

.form-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}

.btn-primary-wide,
.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
}

.btn-primary-wide:hover,
.card-action:hover {
  background: #0b5f59;
  color: #fff;
}

.compact {
  width: auto;
  min-width: 150px;
}

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

.alert-success,
.alert-warning,
.validation-summary {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b7dfca;
}

.alert-warning {
  background: #fff7e6;
  color: #8a5600;
  border: 1px solid #f1d19a;
}

.validation-summary {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffccc7;
}

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

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

.project-card,
.content-band,
.form-section,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 22px;
}

.project-card h2 {
  margin: 12px 0 4px;
}

.project-card p {
  color: var(--muted);
}

.project-card .partner {
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 700;
}

.card-topline span,
.ticket-badges span {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ecfdf3;
  color: #067647;
  font-size: .82rem;
  font-weight: 800;
}

.card-action {
  margin-top: auto;
}

.content-band,
.empty-state {
  margin-top: 22px;
  padding: 24px;
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.ticket-title {
  font-weight: 800;
}

.ticket-meta {
  color: var(--muted);
  font-size: .92rem;
}

.ticket-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ticket-form {
  max-width: 880px;
}

.form-section {
  display: grid;
  gap: 10px;
  padding: 22px;
}

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

.segmented-control label {
  margin: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: center;
}

.segmented-control input:checked + span {
  border-color: var(--teal);
  background: #ecfdf3;
  color: #075e55;
  box-shadow: inset 0 0 0 1px var(--teal);
}

.request-kind[hidden] {
  display: none;
}

.upload-box {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 128px;
  border: 1px dashed #98a8bc;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.upload-box small,
.file-list {
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1160px);
    margin: 18px auto;
  }

  .login-panel,
  .form-section,
  .content-band,
  .empty-state {
    padding: 18px;
  }

  .page-header,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-row {
    grid-template-columns: 1fr;
  }

  .project-grid,
  .segmented-control {
    grid-template-columns: 1fr;
  }

  .ticket-badges {
    justify-content: flex-start;
  }
}
