:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #182230;
  --muted: #5c6b7a;
  --border: #d9e1ea;
  --primary: #2363eb;
  --primary-dark: #174cc0;
  --success-bg: #e8fff1;
  --success-text: #08613a;
  --soft-bg: #f7f9fc;
  --warning-bg: #fff4e5;
  --warning-text: #8c5400;
  --shadow: 0 14px 40px rgba(18, 38, 63, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  padding: 22px 20px 48px;
}

.hero,
.app-shell {
  width: min(100%, 1320px);
  margin: 0 auto;
}

.hero {
  margin-bottom: 14px;
}

.hero-copy {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.subcopy {
  margin: 10px auto 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.controls-card,
.mode-card,
.result-card,
.upload-card,
.sample-card,
.table-card {
  background: var(--card);
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.controls-card,
.mode-card {
  padding: 20px;
}

.card-header,
.table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-header h2,
.bulk-intro h3,
.table-header h4 {
  margin: 0 0 8px;
}

.card-header p,
.bulk-intro p,
.table-header p,
.upload-hint,
.result-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.info-button {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.logic-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f6f9ff;
  border: 1px solid #d8e5ff;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.field span {
  font-weight: 600;
  font-size: 0.95rem;
}

.field-compact {
  justify-content: flex-end;
}

.field-static {
  justify-content: flex-end;
}

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

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(35, 99, 235, 0.15);
  border-color: var(--primary);
}

.toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 500;
  min-height: 44px;
}

.toggle-option input {
  width: 18px;
  height: 18px;
}

.milestone-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.milestone-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--soft-bg);
}

.milestone-card strong {
  display: block;
  margin-bottom: 4px;
}

.milestone-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: #eef3f8;
}

.mode-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: transparent;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.mode-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(18, 38, 63, 0.08);
}

.mode-panel {
  margin-top: 18px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.actions,
.bulk-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

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

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

.primary-btn:disabled {
  background: #9ab5f7;
  cursor: not-allowed;
}

.secondary-btn {
  background: #eef3f8;
  color: var(--text);
}

.result-card {
  margin-top: 18px;
  padding: 18px;
}

.result-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
}

.result-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

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

.deadline-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfdff;
  padding: 14px;
}

.deadline-item .label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.deadline-item .value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.deadline-item .meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.static-pill {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-weight: 600;
}

.bulk-intro {
  margin-bottom: 16px;
}

.upload-card,
.sample-card,
.table-card {
  padding: 18px;
}

.upload-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

.sample-card {
  margin-top: 14px;
  background: #fcfdff;
}

.sample-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.sample-card pre {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #0f1720;
  color: #dce7f8;
  overflow: auto;
}

.bulk-actions {
  margin: 14px 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
}

.status-note {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-note.in-sla {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-note.out-sla {
  background: #ffe7e7;
  color: #a11b1b;
}

.status-note.due-today {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.site-footer {
  padding: 0 20px 34px;
}

.site-footer-inner {
  width: min(100%, 1320px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.site-footer-links a:hover {
  color: var(--text);
}

.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 40px rgba(18, 38, 63, 0.16);
}

.cookie-banner-copy strong {
  display: block;
  margin-bottom: 6px;
}

.cookie-banner-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cookie-banner-copy a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-banner[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .deadline-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .page {
    padding: 18px 14px 36px;
  }

  .controls-card,
  .mode-card,
  .result-card,
  .upload-card,
  .sample-card,
  .table-card {
    padding: 18px;
    border-radius: 20px;
  }

  .actions,
  .bulk-actions {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .site-footer {
    padding: 0 14px 26px;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner {
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 14px;
  }

  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }
}
