@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --ink: #1b2733;
  --muted: #5d6b78;
  --line: #cbd5df;
  --paper: #f5f7fa;
  --panel: #ffffff;
  --navy: #17365d;
  --teal: #1769aa;
  --mint: #e8f1f8;
  --coral: #b84a3b;
  --yellow: #e6b93d;
  --shadow: 0 2px 7px rgba(27, 39, 51, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }
.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: white; background: var(--navy); border-radius: 2px; font-size: 13px; }
.brand-name { font-size: 16px; letter-spacing: 0; }
.brand-name span { color: var(--teal); }
.nav { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.nav a { padding: 8px 12px; border-radius: 2px; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--mint); }
.nav .nav-cta { color: white; background: var(--navy); }
.nav .nav-cta:hover { color: white; background: var(--teal); }
.nav-user { max-width: 150px; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1040px; margin: 0 auto; padding: 38px 0 60px; }
.centered-section { max-width: 900px; margin-right: auto; margin-left: auto; }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: 'Space Grotesk', sans-serif; letter-spacing: 0; line-height: 1.15; }
h1 { max-width: 740px; font-size: clamp(30px, 4vw, 46px); }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
.lede { max-width: 610px; margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 42px; }
.hero-actions { display: flex; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 2px; padding: 10px 15px; color: white; background: var(--teal); font: inherit; font-weight: 700; cursor: pointer; }
.button:hover { color: white; background: #12568b; }
.button.secondary { color: var(--navy); background: white; border: 1px solid var(--line); }
.button.secondary:hover { background: #eaf4f1; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-link { display: block; color: inherit; }
.stat-link:hover { color: inherit; }
.stat-link:hover .stat { border-color: var(--teal); }
.stat { padding: 18px; min-height: 112px; background: var(--panel); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { display: block; margin-top: 12px; font-family: 'Space Grotesk', sans-serif; font-size: 38px; font-weight: 700; }
.stat-open { border-top: 3px solid #d6b449; }
.stat-progress { border-top: 3px solid var(--teal); }
.stat-closed { border-top: 3px solid #8995a1; }
.stat-pending { border-top: 3px solid #c77b30; }
.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 23px 25px 18px; border-bottom: 1px solid var(--line); }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 25px; }
.ticket-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid #edf2f2; }
.ticket-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ticket-id { color: var(--teal); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; }
.ticket-subject { display: block; margin-bottom: 4px; font-weight: 700; }
.ticket-meta { color: var(--muted); font-size: 12px; }
.ticket-time { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 11px; white-space: nowrap; }
.empty { padding: 28px 0 6px; color: var(--muted); }
.callout { padding: 22px; color: white; background: var(--navy); border-radius: 2px; box-shadow: var(--shadow); }
.callout h2 { max-width: 270px; font-size: 26px; }
.callout p { color: #c8d9df; font-size: 14px; }
.callout .button { margin-top: 12px; color: var(--navy); background: var(--yellow); }
.callout .button:hover { background: #ffd875; }
.page-heading { margin-bottom: 30px; }
.form-panel { max-width: 790px; margin-right: auto; margin-left: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 11px 12px; color: var(--ink); background: #fff; font: inherit; outline: none; }
select { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 11px 12px; color: var(--ink); background: #fff; font: inherit; outline: none; }
input:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22, 125, 120, .12); }
select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 105, 170, .12); }
textarea { min-height: 150px; resize: vertical; }
.form-note { margin: -4px 0 22px; color: var(--muted); font-size: 12px; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.alert { margin-bottom: 20px; padding: 13px 15px; color: #8f3e31; background: #fff0ed; border: 1px solid #f6c4bb; border-radius: 8px; font-size: 13px; }
.success { margin-bottom: 20px; padding: 13px 15px; color: #21695e; background: var(--mint); border: 1px solid #a9ddcb; border-radius: 8px; font-size: 13px; }
.field-help { margin-top: -2px; color: var(--muted); font-size: 12px; }
.engineer-panel { margin-bottom: 20px; }
.engineer-grid { overflow: hidden; border: 1px solid var(--line); }
.engineer-row { display: grid; grid-template-columns: 1fr 110px 110px; gap: 14px; align-items: center; min-height: 48px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.engineer-row:first-child { border-top: 0; }
.engineer-header { min-height: 36px; color: var(--muted); background: #f3f6f9; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.engineer-row > span:not(.status-chip) { color: var(--muted); font-size: 12px; }
.engineer-row .status-chip { justify-content: center; width: 78px; }
.engineer-link { color: var(--ink); }
.engineer-link:hover { color: var(--teal); }
.engineer-row a.status-chip:hover { color: inherit; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 4px 7px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: #f7f9fb; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-chip b { color: var(--ink); }
.status-open { color: #8a6500; background: #fff8df; border-color: #ecd68a; }
.status-progress { color: #145b91; background: #eaf4fb; border-color: #b8d4e8; }
.status-resolved { color: #21695e; background: #eaf6f1; border-color: #b9dfcf; }
.status-closed { color: var(--muted); background: #f0f2f4; }
.status-pending { color: #965916; background: #fff1df; border-color: #e6bd86; }
.priority-chip { display: inline-flex; width: max-content; padding: 4px 7px; border: 1px solid var(--line); border-radius: 2px; font-size: 11px; font-weight: 700; }
.priority-low { color: #21695e; background: #eaf6f1; border-color: #b9dfcf; }
.priority-medium { color: #8a6500; background: #fff8df; border-color: #ecd68a; }
.priority-high { color: #8f3e31; background: #fff0ed; border-color: #f6c4bb; }
.sla-cell { display: grid; gap: 3px; min-width: 150px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.sla-cell small { color: #965916; font-weight: 700; }
.sla-ok, .sla-warning { position: relative; padding-left: 13px; color: var(--muted); font-weight: 600; }
.sla-ok::before, .sla-warning::before { position: absolute; top: .55em; left: 0; width: 7px; height: 7px; border-radius: 50%; content: ''; transform: translateY(-50%); }
.sla-ok::before { background: #21735b; }
.sla-warning::before { background: #c44232; }
.sla-settings-grid { border: 1px solid var(--line); }
.sla-settings-header, .sla-settings-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sla-settings-header { color: var(--muted); background: #f6faf9; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sla-settings-row:last-child { border-bottom: 0; }
.sla-settings-row input { margin: 0; }
.table-wrap { overflow-x: auto; }
.ticket-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.ticket-table th { color: var(--muted); background: #f6faf9; font-size: 11px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.ticket-table th, .ticket-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ticket-table td { font-size: 13px; }
.ticket-table tr:last-child td { border-bottom: 0; }
.ticket-number { color: var(--teal); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; }
.message-cell { max-width: 310px; color: var(--muted); white-space: normal; }
.table-action { color: var(--teal); font-size: 12px; font-weight: 700; }
.footer { padding: 22px 0 35px; color: var(--muted); font-size: 12px; }
.auth-page { min-height: 100vh; background: var(--paper); }
.auth-shell { max-width: 1180px; margin: 0 auto; padding: 28px; }
.auth-layout { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 130px); margin: 0 auto; }
.auth-intro h1 { max-width: 600px; font-size: clamp(38px, 5vw, 64px); }
.auth-card { width: 380px; max-width: calc(100vw - 36px); }
.auth-card h2 { margin-bottom: 26px; font-size: 25px; }
.auth-subtitle { margin: 8px 0 28px; color: var(--muted); font-size: 14px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-foot { color: var(--muted); font-size: 12px; }
@media (max-width: 780px) {
  .shell { padding: 0 18px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 18px 0; }
  .nav { width: 100%; justify-content: space-between; gap: 2px; }
  .nav a { padding: 8px 9px; font-size: 12px; }
  .nav-user { display: none; }
  main { padding-top: 42px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .engineer-row { grid-template-columns: 1fr 90px 90px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .sla-settings-header, .sla-settings-row { grid-template-columns: 1fr 1fr; }
  .sla-settings-header span:first-child, .sla-settings-row strong { grid-column: 1 / -1; }
  .field.full { grid-column: auto; }
  .auth-shell { padding: 18px; }
  main { padding-right: 0; padding-left: 0; }
  .auth-layout { min-height: calc(100vh - 105px); padding: 30px 0; }
  .auth-intro h1 { font-size: 42px; }
}
@media (max-width: 430px) {
  h1 { font-size: 39px; }
  .stats { gap: 9px; }
  .stat { min-height: 120px; padding: 17px; }
  .stat-value { font-size: 30px; }
  .ticket-row { grid-template-columns: 44px 1fr; gap: 10px; }
  .ticket-time { grid-column: 2; }
  .engineer-row { grid-template-columns: 1fr 70px 70px; gap: 8px; padding-right: 10px; padding-left: 10px; }
  .engineer-row .status-chip { width: 58px; }
}
