:root {
  color-scheme: light;
  --canvas: #f5f8fb;
  --surface: #fff;
  --ink: #111c30;
  --muted: #4b5a70;
  --line: #d5dee8;
  --blue: #03669b;
  --blue-deep: #00527e;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1 { margin: 0; letter-spacing: -.035em; line-height: 1.18; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:is(button, input, a, summary):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.access { min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: 24px 24px 8vh; }
.login-card { width: min(100%, 390px); padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 20px #17345a0b; }
.wordmark { font-size: 1.25rem; font-weight: 750; letter-spacing: -.04em; margin: 0; }
.login-card .wordmark { color: var(--muted); margin-bottom: 20px; }
.login-card h1 { font-size: 1.85rem; margin-bottom: 24px; }
.login-card form { display: grid; gap: 8px; }
label { color: var(--muted); font-size: .875rem; font-weight: 650; }
input { min-width: 0; height: 44px; width: 100%; border: 1px solid #abb9ca; border-radius: 7px; background: var(--surface); color: var(--ink); padding: 8px 12px; }
.login-card label:not(:first-child) { margin-top: 8px; }
.password-field { position: relative; }
.password-field input { padding-right: 85px; }
.password-field button { position: absolute; right: 4px; top: 2px; min-height: 40px; }
.primary { min-height: 44px; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: 7px; font-weight: 700; }
.primary:hover { background: var(--blue-deep); }
.login-card .primary { margin-top: 14px; }
.error { color: #9f261c; font-size: .9rem; margin: 4px 0 12px; }

.topbar { min-height: 64px; padding: 8px clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.text-button { color: var(--muted); background: none; border: 0; min-height: 40px; padding: 6px 10px; font-size: .875rem; font-weight: 650; border-radius: 6px; }
.text-button:hover { background: #eaf0f6; color: var(--ink); }
.queue { max-width: 1320px; margin: 0 auto; padding: 34px 28px 60px; }
.queue h1 { font-size: clamp(1.65rem, 3.1vw, 2.25rem); }
.toolbar { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin: 24px 0 18px; }
.switch { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.switch button, .date-filter button { min-height: 38px; border-radius: 6px; background: var(--surface); color: var(--ink); padding: 6px 14px; font-weight: 650; font-size: .875rem; }
.switch button { border: 0; }
.switch button:hover, .date-filter button:hover { background: #edf3f8; }
.switch button[aria-pressed="true"] { background: var(--blue); color: white; }
.date-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.date-filter label { display: grid; gap: 4px; }
.date-filter input { width: 150px; font-size: .875rem; height: 38px; padding: 5px 8px; }
.date-filter button { border: 1px solid #abb9ca; }

.table-frame { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 15px 16px; text-align: left; }
th { background: #f8fafc; color: #33445c; font-size: .875rem; font-weight: 700; }
th:first-child { border-top-left-radius: 9px; }
th:last-child { border-top-right-radius: 9px; }
td { border-top: 1px solid var(--line); font-size: .94rem; line-height: 1.48; overflow-wrap: anywhere; }
.client { width: 18%; }
.reason { width: 18%; }
.summary { width: 36%; }
.queued { width: 14%; min-width: 115px; font-variant-numeric: tabular-nums; }
.case-status { width: 14%; min-width: 155px; }
.client strong, .client .phone, .client a { display: block; }
.phone { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
a { color: var(--blue-deep); font-weight: 650; text-underline-offset: .16em; }
.client a { margin-top: 4px; width: fit-content; font-size: .875rem; }
.case-menu { position: relative; }
.badge { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; min-height: 34px; padding: 5px 10px; border-radius: 6px; font-weight: 700; font-size: .855rem; }
.case-menu .badge { cursor: pointer; list-style: none; }
.case-menu .badge::-webkit-details-marker { display: none; }
.case-menu .badge::after { content: ""; width: 6px; height: 6px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.pendiente { color: #795009; background: #fff1cf; }
.en_atencion { color: #075683; background: #e2f1fb; }
.resuelto { color: #215843; background: #e6f2eb; }
.case-menu button { position: absolute; right: 0; top: calc(100% + 4px); z-index: 2; padding: 9px 13px; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); box-shadow: 0 6px 16px #152b4919; white-space: nowrap; font-size: .875rem; }
.case-menu button:hover { background: #edf3f8; }
.queue-message { padding: 22px 16px; text-align: center; color: var(--muted); margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 760px) {
  .queue { padding: 26px 16px 60px; }
  .toolbar { align-items: start; flex-direction: column; }
  .date-filter { width: 100%; }
  .date-filter label { flex: 1 1 105px; min-width: 0; }
  .date-filter input { width: 100%; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 15px; border-top: 1px solid var(--line); }
  tr:first-child { border-top: 0; }
  td.client, td.reason, td.summary, td.queued, td.case-status { display: block; width: auto; min-width: 0; padding: 0; border: 0; }
  td.client { grid-area: 1 / 1; }
  td.case-status { grid-area: 1 / 2; }
  td.reason, td.summary { grid-column: 1 / -1; }
  td.reason { margin-top: 4px; font-weight: 650; }
  td.queued { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
}
