:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #64717d;
  --line: #d9e2e9;
  --surface: #f3f6f8;
  --panel: #ffffff;
  --sidebar: #101820;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --blue: #225ea8;
  --amber: #b7791f;
  --red: #be123c;
  --green: #16803d;
  --violet: #6d28d9;
  --shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.action-confirmation {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(22, 128, 61, 0.3);
  border-radius: 8px;
  padding: 12px;
  background: #ecfdf3;
  color: #14532d;
  box-shadow: var(--shadow);
  font-weight: 900;
}

.action-confirmation .tiny-button {
  min-width: 48px;
  background: #ffffff;
  color: #14532d;
}

.app-shell.signed-out {
  grid-template-columns: 1fr;
}

.app-shell.signed-out .sidebar,
.app-shell.signed-out .topbar,
.app-shell.signed-out .quick-grid,
.app-shell.signed-out .settings-grid {
  display: none !important;
}

.app-shell.signed-in #login {
  display: none !important;
}

.app-shell.signed-out .view:not(#login) {
  display: none !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: var(--sidebar);
  color: #ffffff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 74px;
  max-height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.brand-block h1,
.brand-block p,
.topbar h2,
.topbar p,
.panel h3,
.hero-panel h3 {
  margin: 0;
}

.brand-block h1 {
  font-size: 21px;
}

.brand-block p {
  color: #b9c5ce;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.secondary-action,
.ghost-button,
.primary-action,
.tiny-button {
  border-radius: 8px;
  min-height: 42px;
}

.nav-item {
  width: 100%;
  border: 0;
  padding: 11px 14px;
  background: transparent;
  color: #dce5eb;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.secondary-action {
  display: grid;
  place-items: center;
  border: 0;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-align: center;
}

.file-action {
  cursor: pointer;
}

#importData {
  display: none;
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.signed-out .main-panel {
  padding: 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  position: relative;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: 34px;
}

.event-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.event-controls label {
  min-width: 190px;
}

.compact-action {
  min-height: 41px;
  min-width: 92px;
}

.signin-status {
  flex-basis: 100%;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.profile-menu {
  position: relative;
  align-self: start;
}

.profile-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.profile-panel {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.profile-panel h3 {
  margin: 0;
}

.profile-actions {
  justify-content: space-between;
}

.profile-status {
  color: var(--muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 42px;
}

.checkbox-label input {
  width: auto;
}

.checkbox-group {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.checkbox-group legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input {
  width: auto;
}

.profile-request-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.profile-request-fields legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.profile-request-fields label:has(textarea) {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  align-items: center;
  min-height: 100vh;
  padding: 28px;
  gap: 28px;
}

.login-brand {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.login-logo {
  width: min(360px, 100%);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.login-brand h2 {
  margin: 0;
  font-size: 38px;
}

.login-brand p {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
}

.login-panel {
  box-shadow: var(--shadow);
}

.reset-panel {
  grid-column: 2;
}

.login-results {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.login-result {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
}

.login-result:hover,
.login-result:focus {
  border-color: var(--accent);
  outline: 0;
}

.login-result span,
.login-result small {
  color: var(--muted);
  font-size: 12px;
}

.login-status {
  min-height: 18px;
  text-align: left;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
}

.hero-copy h3 {
  max-width: 680px;
  font-size: 40px;
  line-height: 1.05;
}

.hero-copy p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.support-visual {
  position: relative;
  display: grid;
  min-height: 250px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(34, 94, 168, 0.12)),
    repeating-linear-gradient(0deg, #eef4f6 0, #eef4f6 1px, transparent 1px, transparent 24px);
}

.hero-logo {
  width: min(420px, 82%);
  max-height: 190px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.12);
}

.signal-card {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 14px 26px rgba(17, 24, 39, 0.12);
}

.signal-card strong {
  font-size: 24px;
}

.signal-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 34px;
}

.two-column,
.split-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.split-workspace {
  grid-template-columns: 380px 1fr;
}

.register-layout {
  display: grid;
  gap: 18px;
}

.submit-layout {
  display: grid;
  gap: 18px;
}

.submit-layout .form-panel {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.submit-layout .form-panel h3,
.submit-layout .form-panel label:has(textarea),
.submit-layout .form-panel label:has(input[type="file"]),
.submit-layout .form-panel button {
  grid-column: 1 / -1;
}

.register-layout .form-panel {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.register-layout .form-panel h3,
.register-layout .form-panel button {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}

.panel-heading,
.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.queue-heading {
  align-items: flex-start;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-actions select,
.inline-actions input {
  min-width: 170px;
}

.form-panel,
.response-grid,
.ticket-list,
.task-list,
.customer-list,
.user-management-list,
.bar-list,
.attachment-list,
.note-list {
  display: grid;
  gap: 14px;
}

.primary-action {
  border: 0;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

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

.ghost-button,
.tiny-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.tiny-button {
  min-height: 32px;
  padding: 0 10px;
}

.danger {
  color: var(--red);
}

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

.response-grid article,
.load-item,
.customer-item,
.user-management-card,
.ticket-card,
.note-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.response-grid article,
.load-item {
  display: grid;
  gap: 6px;
}

.response-grid span,
.load-item span,
.customer-item span,
.ticket-card span,
td span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.ticket-card,
.customer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.user-management-card {
  display: grid;
  gap: 14px;
}

.user-management-header,
.user-management-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-management-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.user-management-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.selected-row {
  background: #eef8f6;
}

.status-pill,
.priority-pill {
  display: inline-grid;
  min-width: 74px;
  place-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf2f6;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.priority-pill.critical,
.priority-pill.p1 {
  background: #ffe4e6;
  color: var(--red);
}

.priority-pill.high,
.priority-pill.p2 {
  background: #fff4dc;
  color: var(--amber);
}

.priority-pill.medium,
.priority-pill.p3 {
  background: #e4f0ff;
  color: var(--blue);
}

.priority-pill.low,
.priority-pill.p4 {
  background: #e6f6ed;
  color: var(--green);
}

.status-pill.submitted {
  background: #edf2f6;
  color: #475569;
}

.status-pill.pending,
.status-pill.awaiting-approval {
  background: #fff4dc;
  color: var(--amber);
}

.status-pill.in-progress,
.status-pill.approved {
  background: #e4f0ff;
  color: var(--blue);
}

.status-pill.completed,
.status-pill.not-required {
  background: #e6f6ed;
  color: var(--green);
}

.status-pill.denied {
  background: #ffe4e6;
  color: var(--red);
}

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

.detail-heading h3 {
  margin: 0;
  font-size: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ticket-summary {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
  line-height: 1.55;
}

.ticket-summary p {
  margin: 0;
}

.new-user-profile-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f7fbfa;
}

.new-user-profile-card h4,
.new-user-profile-card p {
  margin: 0;
}

.new-user-profile-card .detail-grid {
  margin-bottom: 0;
}

.new-user-profile-card .detail-grid p {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.new-user-profile-card .detail-grid span {
  color: var(--ink);
  font-weight: 700;
}

.approval-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid #ead6a7;
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}

.approval-panel span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.attachment-list {
  margin-top: 16px;
}

.attachment-list h4 {
  margin: 0;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  color: var(--ink);
  text-decoration: none;
}

.attachment-item:hover {
  border-color: var(--accent);
}

.attachment-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.note-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.note-form button {
  justify-self: start;
}

.note-list {
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  align-items: center;
  gap: 12px;
}

.bar-row span,
.bar-row strong {
  font-size: 13px;
}

.bar-row div {
  height: 12px;
  border-radius: 999px;
  background: #edf2f6;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .app-shell,
  .hero-panel,
  .login-layout,
  .two-column,
  .split-workspace {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar,
  .event-controls,
  .inline-actions,
  .queue-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-menu {
    align-self: flex-end;
  }

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

  .detail-grid,
  .response-grid,
  .checkbox-group,
  .profile-request-fields,
  .submit-layout .form-panel,
  .register-layout .form-panel,
  .user-management-grid {
    grid-template-columns: 1fr;
  }

  .reset-panel {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .action-confirmation {
    left: 18px;
    right: 18px;
    align-items: stretch;
    flex-direction: column;
  }

  .main-panel,
  .sidebar,
  .hero-panel {
    padding: 18px;
  }

  .nav-list,
  .metric-grid,
  .ticket-card,
  .customer-item {
    grid-template-columns: 1fr;
  }

  .user-management-header,
  .user-management-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2,
  .login-brand h2,
  .hero-copy h3 {
    font-size: 28px;
  }

  .support-visual {
    min-height: 220px;
  }
}
