:root {
  --ink: #071126;
  --navy: #0a2a66;
  --blue: #1f6feb;
  --paper: #f4f7fb;
  --white: #ffffff;
  --line: #dbe6f5;
  --muted: #5a6b81;
  --red: #c53030;
  --shadow: 0 22px 70px rgba(7, 17, 38, 0.14);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.shared-language-switcher {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.shared-language-switcher button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--navy);
  background: transparent;
  font-weight: 950;
}

.shared-language-switcher button.is-active {
  color: var(--white);
  background: var(--navy);
}

.client-login {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.62fr);
  min-height: 100vh;
}

.login-copy {
  display: grid;
  align-content: center;
  padding: clamp(32px, 7vw, 92px);
  color: var(--white);
  background:
    linear-gradient(rgba(5, 11, 24, 0.84), rgba(5, 11, 24, 0.84)),
    url("assets/nextgenit-logo.jpg") center / cover no-repeat,
    #050b18;
}

.logo-link img,
.portal-logo img {
  width: 220px;
  height: 82px;
  object-fit: contain;
  padding: 5px;
  border-radius: 8px;
  background: var(--ink);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.login-copy h1 {
  max-width: 780px;
  margin: 22px 0 0;
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  line-height: 0.95;
}

.login-copy p:not(.eyebrow) {
  max-width: 660px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.12rem;
  line-height: 1.55;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 5vw, 56px);
  background: var(--white);
}

.login-card h2,
.welcome-panel h1,
.panel-heading h2 {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

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

.login-card button,
.ticket-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
  font-weight: 900;
}

.login-card .text-button,
.text-button {
  min-height: auto;
  border: 0;
  padding: 0;
  color: var(--navy);
  background: transparent;
  font-weight: 900;
  text-align: left;
}

.login-message,
.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.login-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.portal-app {
  min-height: 100vh;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(18px);
}

.portal-logo img {
  width: 188px;
  height: 68px;
}

.portal-header nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.portal-header nav button,
.logout {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: var(--white);
  padding: 0 14px;
  font-weight: 900;
}

.portal-header nav button.is-active {
  color: var(--white);
  background: var(--navy);
}

.portal-main {
  padding: clamp(18px, 4vw, 44px);
}

.welcome-panel {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 8px;
  color: var(--white);
  background:
    radial-gradient(circle at 82% 20%, rgba(31, 111, 235, 0.34), transparent 30%),
    var(--ink);
}

.welcome-panel p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.74);
}

.welcome-panel a {
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(7, 17, 38, 0.06);
}

.metric {
  min-height: 112px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 18px;
  color: var(--navy);
  font-size: 2rem;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.ticket-list,
.guide-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.ticket-card,
.guide-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.ticket-card strong,
.ticket-card span,
.guide-list strong,
.guide-list span {
  display: block;
}

.ticket-card span,
.guide-list span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--navy);
  background: #e8f0fb;
  font-size: 0.75rem;
  font-weight: 900;
}

.ticket-form {
  display: grid;
  gap: 16px;
  max-width: 860px;
  padding: 0 0 18px;
}

.ticket-form > label,
.ticket-form .form-row,
.ticket-form > button,
.form-message {
  margin-inline: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ticket-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.ticket-table {
  overflow: hidden;
}

.ticket-row {
  display: grid;
  grid-template-columns: 96px minmax(220px, 1fr) 140px 130px 120px 110px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.ticket-actions button,
.assistant-form button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--white);
  background: var(--navy);
  font-weight: 900;
}

.portal-assistant {
  margin-bottom: 14px;
}

.assistant-messages {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 14px;
}

.assistant-messages article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdff;
  color: var(--muted);
}

.assistant-messages article.user-message {
  color: var(--ink);
  background: #eff6ff;
}

.assistant-form {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.ticket-row:last-child {
  border-bottom: 0;
}

.ticket-row.header {
  color: var(--muted);
  background: #f7fafc;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.reset-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.reset-dialog::backdrop {
  background: rgba(7, 17, 38, 0.58);
}

@media (max-width: 980px) {
  .client-login,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .portal-header {
    grid-template-columns: 1fr;
  }

  .portal-header nav {
    justify-content: start;
    overflow-x: auto;
  }

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

  .welcome-panel {
    display: grid;
    align-items: start;
  }
}

@media (max-width: 680px) {
  .metric-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .ticket-toolbar {
    display: grid;
  }

  .ticket-row {
    grid-template-columns: 1fr;
  }

  .ticket-row.header {
    display: none;
  }
}
