:root {
  --navy: #063f75;
  --navy-deep: #06345f;
  --blue: #0b8fd3;
  --blue-dark: #0879b7;
  --cyan: #16b4e8;
  --page: #eef6fb;
  --line: #d7e4ee;
  --text: #172638;
  --muted: #5f7186;
  --green: #166534;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1260px; margin: auto; padding: 11px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-logo { width: 52px; height: 52px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { color: var(--navy-deep); font-size: 15px; line-height: 1.25; }
.brand small { color: var(--blue); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.staff-link { font-size: 12px; font-weight: 700; color: var(--navy); text-decoration: none; white-space: nowrap; }
.staff-link:hover { text-decoration: underline; }

.page-shell { max-width: 1260px; margin: auto; padding: 32px 28px 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.eyebrow { margin: 0 0 5px; color: var(--blue-dark); text-transform: uppercase; font-weight: 800; font-size: 11px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: 28px; line-height: 1.2; color: var(--navy-deep); }
.page-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.system-message { background: #fff3e7; border: 1px solid #f7c78f; color: #8a4a0a; padding: 12px 16px; margin-bottom: 20px; border-radius: 6px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 38px rgba(6, 52, 95, 0.06); min-height: 650px; }
.create-column { padding: 30px 36px 36px; min-width: 0; }
.tracking-column { border-left: 1px solid var(--line); background: #f9fcfe; min-width: 0; }
.tracking-sticky { position: sticky; top: 0; padding: 30px 26px; }
.section-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 25px; }
.section-number { display: inline-grid; place-items: center; flex: 0 0 28px; height: 28px; color: var(--blue-dark); background: #e8f5fd; border-radius: 5px; font-size: 11px; font-weight: 800; }
.section-heading h2 { margin: 2px 0 4px; font-size: 17px; line-height: 1.25; color: var(--navy-deep); }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { margin-bottom: 17px; min-width: 0; }
.field label { display: block; color: var(--navy-deep); font-size: 11px; text-transform: uppercase; font-weight: 800; margin-bottom: 7px; }
.field label span { color: #bd332e; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; border: 1px solid #ccdce8; border-radius: 6px; background: #fff; color: var(--text); padding: 10px 12px; outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,143,211,0.13); }
.field textarea { resize: vertical; min-height: 115px; }
.field input[type="file"] { font-size: 11px; padding: 8px; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.form-actions { display: flex; align-items: center; gap: 18px; padding-top: 5px; }
.form-actions p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; font-weight: 700; font-size: 12px; white-space: nowrap; }
.button:disabled { opacity: 0.6; cursor: wait; }
.button-primary { background: var(--blue-dark); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--navy); }
.button-secondary { background: #fff; color: var(--navy); border-color: #b8d0e2; }
.button-secondary:hover:not(:disabled) { background: #eaf5fc; }
.confirmation { border: 1px solid #a9dfbe; border-left: 4px solid #16834b; background: #f0fdf4; border-radius: 6px; padding: 15px 16px; margin-bottom: 26px; color: #14532d; }
.confirmation strong { display: block; font-size: 14px; margin-bottom: 5px; }
.confirmation p { margin: 0 0 8px; line-height: 1.5; font-size: 12px; }
.confirmation p:last-child { margin: 0; }
.confirmation code { font-size: 12px; background: #fff; padding: 2px 5px; border: 1px solid #bbdfc5; border-radius: 4px; overflow-wrap: anywhere; }

.tracking-empty { padding: 20px 0 30px; color: var(--muted); border-bottom: 1px solid var(--line); }
.tracking-empty strong { color: var(--navy-deep); font-size: 13px; }
.tracking-empty p { font-size: 12px; line-height: 1.55; margin: 7px 0 0; }
.tracking-status .ticket-code { color: var(--navy-deep); font-weight: 800; font-size: 19px; margin-bottom: 4px; overflow-wrap: anywhere; }
.tracking-status .ticket-title { font-size: 13px; font-weight: 700; line-height: 1.5; margin-bottom: 16px; overflow-wrap: anywhere; }
.status-pill { display: inline-block; background: #e7f4fd; color: #075985; border-radius: 4px; padding: 5px 8px; font-size: 11px; font-weight: 800; }
.status-pill.resolved, .status-pill.closed { background: #e9f8ed; color: var(--green); }
.status-pill.waiting_client { background: #fff1e7; color: #a44b0a; }
.status-list { list-style: none; padding: 0 0 0 7px; margin: 20px 0; border-left: 2px solid #cedfea; }
.status-list li { position: relative; color: var(--muted); padding: 0 0 15px 17px; font-size: 12px; }
.status-list li:last-child { padding-bottom: 0; }
.status-list li::before { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #c6d9e7; border: 2px solid #f9fcfe; left: -7px; top: 2px; }
.status-list li.done { color: var(--navy-deep); font-weight: 700; }
.status-list li.done::before { background: var(--blue); }
.ticket-meta { border-top: 1px solid var(--line); padding-top: 15px; display: grid; gap: 10px; }
.ticket-meta dt { font-size: 10px; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.ticket-meta dd { margin: 2px 0 0; font-size: 12px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.reopen-box { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.reopen-box h3 { color: var(--navy-deep); font-size: 13px; margin-bottom: 5px; }
.reopen-box p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.reopen-box .button { width: 100%; }
.lookup-form { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; }
.lookup-form h3 { color: var(--navy-deep); font-size: 13px; margin-bottom: 17px; }
.lookup-form .field { margin-bottom: 13px; }
.inline-message { color: #9a3412; font-size: 11px; line-height: 1.5; margin: 10px 0 0; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .tracking-column { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); }
  .tracking-sticky { position: static; }
}

@media (max-width: 620px) {
  .header-inner { padding: 10px 16px; }
  .brand-logo { width: 42px; height: 42px; }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 9px; }
  .staff-link { font-size: 10px; white-space: normal; text-align: right; max-width: 95px; }
  .page-shell { padding: 22px 12px 40px; }
  h1 { font-size: 23px; }
  .create-column, .tracking-sticky { padding: 23px 17px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-actions { display: block; }
  .form-actions .button { width: 100%; }
  .form-actions p { margin-top: 9px; }
}
