:root {
  color-scheme: light;
  --bg: #eef3f1;
  --panel: #ffffff;
  --ink: #101820;
  --muted: #667085;
  --line: #d9e1e5;
  --brand: #6fb441;
  --brand-dark: #315f25;
  --warning: #9a5b00;
  --ok: #287a44;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(16, 24, 32, 0.11);
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .app-shell,
  .main-header,
  .screen,
  .panel,
  .ticket-card,
  .ticket-main,
  .ticket-admin-actions {
    min-width: 0;
  }

  .ticket-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .ticket-topline {
    display: flex;
    gap: 8px;
  }

  .ticket-protocol {
    width: 100%;
    overflow-wrap: anywhere;
  }

  .ticket-status,
  .ticket-urgency,
  .new-reply-badge {
    max-width: 100%;
    height: auto;
    min-height: 28px;
    white-space: normal;
    line-height: 1.25;
  }

  .ticket-admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .ticket-admin-actions input,
  .ticket-admin-actions select,
  .ticket-admin-actions button {
    width: 100%;
    min-width: 0;
  }

  .ticket-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .completion-dialog form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
  }

  .dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #101820;
    color: #fff;
  }

  .dialog-header h2 {
    max-width: 100%;
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .dialog-header .eyebrow {
    margin-bottom: 4px;
  }

  .dialog-header .secondary-button {
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .dialog-body {
    align-content: start;
    gap: 12px;
    min-height: 0;
    max-height: none;
    padding: 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dialog-section,
  .signature-panel {
    padding: 12px;
  }

  .signature-grid,
  .completion-signatures,
  .dialog-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .signature-panel {
    border-color: #cfd8df;
    background: #fbfdfc;
  }

  .signature-pad {
    border-width: 2px;
    background:
      linear-gradient(#ffffff, #ffffff) padding-box,
      linear-gradient(135deg, #6fb441, #101820) border-box;
  }

  .signature-pad canvas {
    height: 220px;
  }

  .completion-dialog textarea {
    min-height: 150px;
    resize: vertical;
  }

  .completion-legal {
    padding: 10px 12px;
    border: 1px solid #d8e0e7;
    border-radius: var(--radius);
    background: #f8fbfa;
  }

  .completion-dialog .actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 -12px -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
  }

  .completion-dialog .actions button {
    width: 100%;
    min-height: 46px;
  }
}

@media (max-width: 380px) {
  .dialog-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dialog-header .secondary-button {
    width: 100%;
  }

  .signature-pad canvas {
    height: 200px;
  }
}

/* Reference match pass: Central de Chamados LF */
:root {
  --bg: #030d0c;
  --panel: rgba(10, 27, 25, 0.86);
  --panel-strong: rgba(13, 34, 31, 0.96);
  --line: rgba(109, 255, 87, 0.26);
  --brand: #72ff58;
  --brand-dark: #31d94c;
  --brand-strong: #a2ff91;
  --ink: #f8fff9;
  --muted: #b8c8c3;
  --radius: 8px;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 0 18%, rgba(105, 255, 87, 0.38), transparent 16rem),
    radial-gradient(circle at 96% 8%, rgba(105, 255, 87, 0.22), transparent 18rem),
    radial-gradient(circle at 85% 62%, rgba(105, 255, 87, 0.11), transparent 18rem),
    linear-gradient(115deg, transparent 0 48%, rgba(106, 255, 87, 0.12) 49%, transparent 50%),
    linear-gradient(25deg, transparent 0 51%, rgba(106, 255, 87, 0.10) 52%, transparent 53%),
    radial-gradient(circle at 18% 86%, rgba(105, 255, 87, 0.16) 0 1px, transparent 2px),
    linear-gradient(135deg, #030d0c, #071614 48%, #03100e);
  background-size: auto, auto, auto, 420px 300px, 360px 260px, 18px 18px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 52% 72%, rgba(110, 255, 88, 0.22), transparent 42%),
    repeating-radial-gradient(ellipse at 52% 72%, rgba(111, 255, 88, 0.34) 0 1px, transparent 1px 12px);
  mask-image: linear-gradient(transparent 12%, #000 54%, transparent 96%);
}

main {
  width: min(100% - 48px, 1460px);
  padding-top: 18px;
}

.topbar {
  width: min(100% - 48px, 1460px);
  height: 64px;
}

.topbar::before {
  height: 64px;
  background: rgba(3, 13, 12, 0.80);
  border-bottom: 1px solid rgba(114, 255, 88, 0.24);
  backdrop-filter: blur(18px);
}

.brand-logo-small {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.brand span {
  font-size: 0.92rem;
}

.company-tagline {
  font-size: 0.64rem;
  color: rgba(223, 255, 220, 0.72);
}

.login-screen {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  align-items: center;
  min-height: calc(100vh - 112px);
  gap: 52px;
  padding: 38px 68px;
  border: 1px solid rgba(114, 255, 88, 0.40);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(5, 16, 15, 0.96), rgba(6, 19, 18, 0.72)),
    radial-gradient(circle at 0 25%, rgba(114, 255, 88, 0.28), transparent 16rem),
    radial-gradient(circle at 76% 18%, rgba(114, 255, 88, 0.13), transparent 13rem),
    linear-gradient(rgba(114, 255, 88, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 255, 88, 0.045) 1px, transparent 1px);
  background-size: auto, auto, auto, 78px 78px, 78px 78px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 26px 90px rgba(0, 0, 0, 0.40);
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -24%;
  height: 48%;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(114, 255, 88, 0.24), transparent 58%),
    repeating-radial-gradient(ellipse at 50% 100%, rgba(114, 255, 88, 0.45) 0 1px, transparent 1px 11px);
  transform: perspective(460px) rotateX(58deg);
  transform-origin: bottom;
}

.login-copy {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.login-copy::before {
  left: 12%;
  right: auto;
  bottom: 12%;
  width: 155px;
  border-width: 3px;
  border-radius: 12px;
  opacity: 0.52;
}

.login-copy::after {
  left: calc(12% + 124px);
  right: auto;
  bottom: 7%;
  width: 62px;
  height: 62px;
  border-width: 3px;
  opacity: 0.62;
}

.login-copy h1 {
  max-width: 520px;
  font-size: clamp(3.2rem, 6vw, 5.15rem);
  line-height: 0.92;
}

.login-copy h1::after {
  content: "";
  display: block;
  width: 0;
}

.login-copy p:not(.eyebrow) {
  max-width: 540px;
  font-size: 1rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card {
  justify-self: end;
  width: min(100%, 340px);
  padding: 28px;
  border-color: rgba(180, 255, 155, 0.36) !important;
  background:
    radial-gradient(circle at 100% 0, rgba(143, 255, 119, 0.25), transparent 9rem),
    rgba(17, 34, 31, 0.78) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), 0 0 28px rgba(114, 255, 88, 0.22);
}

.login-card h2 {
  font-size: 1.7rem;
}

input,
select,
textarea {
  min-height: 42px;
  border-radius: 7px;
  color: #f8fff9 !important;
  border-color: rgba(195, 255, 178, 0.18) !important;
  background: rgba(19, 36, 34, 0.90) !important;
}

.primary-button {
  min-height: 46px;
  border-radius: 9px;
  font-weight: 950;
}

.app-screen {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(114, 255, 88, 0.36);
  border-radius: 12px;
  background: rgba(4, 15, 14, 0.58);
}

.page-heading {
  padding: 18px 20px 6px;
}

.page-heading h1,
.admin-heading-copy h1 {
  font-size: clamp(2rem, 3vw, 2.55rem);
}

.metrics {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
}

.metrics article {
  min-height: 76px;
  border-color: rgba(114, 255, 88, 0.22);
  background: rgba(13, 34, 31, 0.76) !important;
}

.panel {
  padding: 18px;
  border-color: rgba(114, 255, 88, 0.25) !important;
  background:
    linear-gradient(135deg, rgba(114, 255, 88, 0.055), transparent 38%),
    rgba(9, 26, 24, 0.78) !important;
}

.panel-header {
  margin-bottom: 12px;
}

.toolbar,
.admin-search-row,
.client-search-row {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(114, 255, 88, 0.14);
  background: rgba(7, 20, 19, 0.72);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  width: 100%;
}

.toolbar select,
.toolbar button,
.admin-search-row input {
  width: 100%;
}

.ticket-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  border-left: 2px solid var(--brand);
  background:
    linear-gradient(90deg, rgba(114, 255, 88, 0.09), transparent 44%),
    rgba(10, 28, 26, 0.90) !important;
}

.ticket-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--brand), transparent);
  box-shadow: 0 0 20px rgba(114, 255, 88, 0.55);
}

.ticket-topline {
  gap: 7px;
}

.ticket-status,
.ticket-urgency,
.new-reply-badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.70rem;
}

.ticket-admin-actions {
  align-content: start;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(114, 255, 88, 0.15);
  background: rgba(5, 17, 16, 0.72);
}

.ticket-admin-actions button {
  min-height: 42px;
}

.client-ticket .ticket-card {
  grid-template-columns: 1fr;
}

.client-ticket .ticket-card .ticket-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 420px);
  gap: 18px;
}

.client-ticket .ticket-card .ticket-main::after {
  align-self: center;
  height: 32px;
  margin: 0;
  background:
    radial-gradient(circle at 0 50%, #55ff65 0 7px, transparent 8px),
    radial-gradient(circle at 33% 50%, #55ff65 0 7px, transparent 8px),
    radial-gradient(circle at 66% 50%, rgba(185, 212, 205, 0.95) 0 7px, transparent 8px),
    radial-gradient(circle at 100% 50%, rgba(185, 212, 205, 0.95) 0 7px, transparent 8px),
    linear-gradient(90deg, #55ff65 0 34%, rgba(185, 212, 205, 0.34) 34% 100%);
}

.dialog-header {
  background: rgba(4, 15, 14, 0.98);
}

@media (max-width: 1180px) {
  .login-screen {
    padding: 30px;
    gap: 26px;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  main,
  .topbar {
    width: min(100% - 18px, 1460px);
  }

  .login-screen {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .login-card {
    justify-self: stretch;
    width: 100%;
  }

  .login-copy h1 {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }

  .client-ticket .ticket-card .ticket-main,
  .ticket-card {
    grid-template-columns: 1fr;
  }

  .metrics,
  .toolbar {
    grid-template-columns: 1fr;
  }
}

/* Final cascade lock for LF dark visual theme */
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 16%, rgba(84, 255, 85, 0.30), transparent 18rem),
    radial-gradient(circle at 88% 18%, rgba(95, 255, 105, 0.16), transparent 20rem),
    radial-gradient(circle at 22% 94%, rgba(71, 255, 92, 0.10), transparent 18rem),
    linear-gradient(rgba(80, 255, 86, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 255, 86, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #06110f 0%, #0a1917 45%, #07100f 100%);
  background-size: auto, auto, auto, 96px 96px, 96px 96px, auto;
}

.login-card,
.panel,
.metrics article,
.ticket-card,
.dialog-section,
.signature-panel,
.client-card,
.portal-module,
.portal-stats article,
.claim-ticket-box,
.completion-summary,
.completion-signatures figure,
.sla-alert-panel,
.empty-state,
.notification-panel {
  color: var(--ink);
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--panel) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card {
  border-color: rgba(135, 255, 119, 0.30) !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(118, 255, 101, 0.22), transparent 14rem),
    rgba(17, 35, 32, 0.82) !important;
}

.login-card h2,
.panel h2,
.page-heading h1,
.ticket-card h3 {
  color: #ffffff;
}

.page-heading p,
.panel-subtitle,
.ticket-meta,
.ticket-description,
.ticket-attachments,
.client-card span,
.client-card small,
.portal-module p,
.completion-summary p,
.sla-alert-panel p,
.form-message,
.hint {
  color: var(--muted);
}

label {
  color: rgba(235, 255, 238, 0.88);
}

input,
select,
textarea {
  color: #f5fff7 !important;
  border-color: rgba(151, 255, 139, 0.17) !important;
  background: rgba(11, 26, 24, 0.82) !important;
}

.primary-button {
  color: #041108;
  background: linear-gradient(180deg, #8eff72 0%, #4bef55 100%);
  box-shadow: 0 14px 32px rgba(92, 255, 82, 0.26);
}

.secondary-button {
  color: rgba(235, 255, 238, 0.92);
  border-color: rgba(125, 255, 113, 0.24);
  background: rgba(12, 29, 27, 0.72);
}

.ticket-admin-actions,
.toolbar,
.admin-search-row {
  border-color: rgba(125, 255, 113, 0.14);
  background: rgba(6, 20, 18, 0.62);
}

/* LF Tecnologia visual refresh - interface only */
:root {
  color-scheme: dark;
  --bg: #06110f;
  --panel: rgba(13, 31, 29, 0.78);
  --panel-strong: rgba(16, 38, 35, 0.92);
  --ink: #f4fff8;
  --muted: #a7b9b4;
  --line: rgba(119, 255, 127, 0.18);
  --brand: #6dff57;
  --brand-dark: #35d84e;
  --brand-strong: #9bff8e;
  --warning: #ffd84d;
  --ok: #53ff7a;
  --danger: #ff5b66;
  --radius: 8px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  --glow: 0 0 28px rgba(80, 255, 92, 0.22);
}

html {
  background: #06110f;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 16%, rgba(84, 255, 85, 0.30), transparent 18rem),
    radial-gradient(circle at 88% 18%, rgba(95, 255, 105, 0.16), transparent 20rem),
    radial-gradient(circle at 22% 94%, rgba(71, 255, 92, 0.10), transparent 18rem),
    linear-gradient(rgba(80, 255, 86, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 255, 86, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #06110f 0%, #0a1917 45%, #07100f 100%);
  background-size: auto, auto, auto, 96px 96px, 96px 96px, auto;
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before {
  inset: 0;
  opacity: 0.75;
  background:
    linear-gradient(30deg, transparent 0 48%, rgba(90, 255, 102, 0.13) 49%, transparent 50% 100%),
    linear-gradient(150deg, transparent 0 50%, rgba(90, 255, 102, 0.10) 51%, transparent 52% 100%);
  background-size: 340px 220px, 420px 280px;
}

main {
  width: min(100% - 56px, 1380px);
  padding: 22px 0 36px;
}

.topbar {
  width: min(100% - 56px, 1380px);
  height: 70px;
  gap: 16px;
}

.topbar::before {
  height: 70px;
  background: rgba(4, 15, 13, 0.78);
  border-bottom: 1px solid rgba(109, 255, 87, 0.18);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.brand {
  color: #ffffff;
  letter-spacing: 0;
}

.brand-logo-small {
  width: 38px;
  height: 38px;
  border-color: rgba(135, 255, 119, 0.50);
  background: rgba(5, 15, 13, 0.8);
  box-shadow: 0 0 18px rgba(88, 255, 92, 0.22);
}

.company-tagline {
  color: rgba(221, 255, 224, 0.72);
  letter-spacing: 0.22em;
}

.admin-nav {
  padding: 4px;
  border: 1px solid rgba(129, 255, 117, 0.18);
  border-radius: var(--radius);
  background: rgba(11, 31, 28, 0.78);
}

.admin-nav-button,
.client-role-filter-button {
  color: rgba(232, 255, 235, 0.82);
  border-radius: 6px;
}

.admin-nav-button:hover,
.client-role-filter-button:hover,
.admin-nav-button.active,
.client-role-filter-button.active {
  color: #031008;
  background: linear-gradient(180deg, #8cff71, #4bea54);
  box-shadow: 0 0 18px rgba(109, 255, 87, 0.28);
}

.notification-button {
  color: var(--ink);
  border-color: rgba(120, 255, 111, 0.22);
  background: rgba(13, 31, 29, 0.82);
}

.notification-count {
  color: #06110f;
  background: var(--brand);
}

.notification-panel,
.login-card,
.panel,
.metrics article,
.ticket-card,
.dialog-section,
.signature-panel,
.client-card,
.portal-module,
.portal-stats article,
.claim-ticket-box,
.completion-summary,
.completion-signatures figure,
.sla-alert-panel,
.empty-state {
  color: var(--ink);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-screen {
  min-height: calc(100vh - 108px);
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.65fr);
  gap: 28px;
}

.login-copy {
  align-items: flex-start;
  min-height: 560px;
  padding: clamp(28px, 5vw, 72px);
  text-align: left;
  border: 1px solid rgba(103, 255, 91, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(4, 12, 12, 0.92), rgba(4, 12, 12, 0.58)),
    radial-gradient(circle at 2% 24%, rgba(103, 255, 91, 0.32), transparent 15rem),
    linear-gradient(rgba(105, 255, 93, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 255, 93, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, #091512, #10231f);
  background-size: auto, auto, 82px 82px, 82px 82px, auto;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.login-copy::before {
  content: "";
  position: absolute;
  right: 18%;
  bottom: 11%;
  width: min(260px, 34vw);
  aspect-ratio: 1.35;
  border: 4px solid rgba(99, 255, 91, 0.35);
  border-radius: 14px;
  filter: drop-shadow(0 0 24px rgba(98, 255, 91, 0.22));
  opacity: 0.75;
}

.login-copy::after {
  right: 17%;
  bottom: 8%;
  left: auto;
  width: 76px;
  height: 76px;
  border: 4px solid rgba(99, 255, 91, 0.42);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 28px rgba(99, 255, 91, 0.16);
}

.login-copy h1 {
  max-width: 620px;
  color: #ffffff;
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.login-copy h1::first-line {
  color: #ffffff;
}

.login-copy p {
  max-width: 610px;
  color: rgba(235, 255, 238, 0.84);
  font-size: 1.05rem;
}

.login-copy .eyebrow,
.eyebrow {
  color: var(--brand-strong);
  letter-spacing: 0;
}

.login-card {
  align-self: center;
  padding: 30px;
  border-color: rgba(135, 255, 119, 0.30);
  background:
    radial-gradient(circle at 100% 0%, rgba(118, 255, 101, 0.22), transparent 14rem),
    rgba(17, 35, 32, 0.82);
  box-shadow: var(--shadow), var(--glow);
}

.login-card h2,
.panel h2,
.page-heading h1 {
  color: #ffffff;
}

label {
  color: rgba(235, 255, 238, 0.88);
}

input,
select,
textarea {
  color: #f5fff7;
  border-color: rgba(151, 255, 139, 0.17);
  background: rgba(11, 26, 24, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input::placeholder,
textarea::placeholder {
  color: rgba(201, 225, 216, 0.50);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(125, 255, 113, 0.75);
  box-shadow: 0 0 0 3px rgba(109, 255, 87, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

select option {
  color: #06110f;
  background: #f6fff7;
}

.primary-button,
.secondary-button,
.danger-button {
  border-radius: 7px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  color: #041108;
  background: linear-gradient(180deg, #8eff72 0%, #4bef55 100%);
  box-shadow: 0 14px 32px rgba(92, 255, 82, 0.26);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(92, 255, 82, 0.34);
}

.secondary-button {
  color: rgba(235, 255, 238, 0.92);
  border-color: rgba(125, 255, 113, 0.24);
  background: rgba(12, 29, 27, 0.72);
}

.secondary-button:hover {
  border-color: rgba(125, 255, 113, 0.46);
  background: rgba(20, 49, 44, 0.88);
}

.danger-button {
  color: #ffe8ea;
  border-color: rgba(255, 91, 102, 0.38);
  background: rgba(118, 22, 34, 0.28);
}

.page-heading {
  align-items: start;
  padding: 22px 0 18px;
}

.page-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.page-heading p,
.panel-subtitle,
.ticket-meta,
.ticket-description,
.ticket-attachments,
.client-card span,
.client-card small,
.portal-module p,
.completion-summary p,
.sla-alert-panel p,
.form-message,
.hint {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 10px;
  width: 100%;
}

.metrics article {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  overflow: hidden;
}

.metrics article::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 14px rgba(109, 255, 87, 0.65);
}

.metrics span {
  padding-left: 17px;
  color: rgba(225, 255, 229, 0.80);
  font-size: 0.78rem;
}

.metrics strong {
  color: #ffffff;
  font-size: 1.8rem;
}

.panel {
  border-radius: 10px;
}

.panel-header.admin-header,
.panel-header {
  gap: 16px;
  align-items: center;
}

.toolbar,
.admin-search-row,
.client-search-row {
  border-color: rgba(125, 255, 113, 0.13);
}

.toolbar {
  padding: 8px;
  border: 1px solid rgba(125, 255, 113, 0.12);
  border-radius: 8px;
  background: rgba(7, 22, 20, 0.58);
}

.toolbar select,
.admin-search-row input,
.client-search-row input {
  min-height: 42px;
}

.admin-search-row {
  justify-content: stretch;
  padding: 12px;
  border: 1px solid rgba(125, 255, 113, 0.12);
  border-radius: 8px;
  background: rgba(7, 22, 20, 0.52);
}

.admin-search-row input {
  width: 100%;
}

.panel-divider {
  border-color: rgba(125, 255, 113, 0.12);
}

.ticket-card {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  gap: 12px;
  padding: 14px;
  border-color: rgba(125, 255, 113, 0.18);
  background:
    linear-gradient(90deg, rgba(103, 255, 91, 0.05), transparent 38%),
    rgba(12, 30, 28, 0.78);
}

.ticket-card:hover {
  border-color: rgba(125, 255, 113, 0.50);
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 24px rgba(103, 255, 91, 0.16);
}

.ticket-card h3 {
  color: #ffffff;
}

.ticket-protocol {
  color: rgba(235, 255, 238, 0.92);
}

.ticket-status,
.ticket-urgency,
.new-reply-badge {
  min-height: 24px;
  border: 1px solid rgba(125, 255, 113, 0.22);
  color: #07110c;
  background: linear-gradient(180deg, #8eff72, #4bef55);
}

.ticket-status.progress {
  color: #ddecff;
  background: rgba(59, 130, 246, 0.20);
  border-color: rgba(96, 165, 250, 0.42);
}

.ticket-status.waiting,
.ticket-urgency.sla-warning {
  color: #fff3bf;
  background: rgba(255, 216, 77, 0.14);
  border-color: rgba(255, 216, 77, 0.42);
}

.ticket-status.done,
.ticket-urgency.sla-done {
  color: #aaffb8;
  background: rgba(83, 255, 122, 0.14);
  border-color: rgba(83, 255, 122, 0.42);
}

.ticket-status.cancelled,
.ticket-urgency.sla-overdue,
.new-reply-badge {
  color: #ffd8dc;
  background: rgba(255, 91, 102, 0.16);
  border-color: rgba(255, 91, 102, 0.42);
}

.ticket-admin-actions {
  padding: 12px;
  border-color: rgba(125, 255, 113, 0.14);
  background: rgba(6, 20, 18, 0.62);
}

.ticket-images {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}

.ticket-image {
  border-color: rgba(125, 255, 113, 0.15);
  background: rgba(7, 22, 20, 0.68);
}

summary {
  color: var(--brand-strong);
}

.ticket-history {
  color: rgba(224, 244, 235, 0.78);
}

.client-ticket .ticket-card {
  grid-template-columns: 1fr;
}

.client-ticket .ticket-card .ticket-main::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 0 50%, #55ff65 0 5px, transparent 6px),
    radial-gradient(circle at 33% 50%, #55ff65 0 5px, transparent 6px),
    radial-gradient(circle at 66% 50%, rgba(185, 212, 205, 0.95) 0 5px, transparent 6px),
    radial-gradient(circle at 100% 50%, rgba(185, 212, 205, 0.95) 0 5px, transparent 6px),
    linear-gradient(90deg, #55ff65 0 34%, rgba(185, 212, 205, 0.30) 34% 100%);
}

.file-drop {
  border-color: rgba(125, 255, 113, 0.22);
  background: rgba(9, 25, 23, 0.66);
}

.file-icon {
  color: #06110f;
  background: var(--brand);
}

.dialog-header {
  color: #ffffff;
  border-color: rgba(125, 255, 113, 0.16);
  background: rgba(4, 16, 14, 0.96);
}

.ticket-dialog,
.image-dialog {
  color: var(--ink);
  border: 1px solid rgba(125, 255, 113, 0.22);
  background: rgba(12, 30, 28, 0.96);
}

.dialog-body,
.image-dialog-body {
  background: rgba(7, 17, 16, 0.88);
}

.dialog-grid,
.signature-grid,
.completion-signatures {
  color: var(--ink);
}

.signature-pad {
  border-color: rgba(125, 255, 113, 0.28);
  background: #f7fff8;
}

.empty-state {
  border-style: dashed;
  color: rgba(225, 255, 229, 0.72);
}

.client-role-filter {
  border-color: rgba(125, 255, 113, 0.16);
  background: rgba(8, 23, 21, 0.68);
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-copy {
    min-height: 430px;
  }
}

@media (max-width: 860px) {
  main,
  .topbar {
    width: min(100% - 24px, 1380px);
  }

  .topbar {
    min-height: 70px;
    height: auto;
    padding: 10px 0;
  }

  .login-copy::before,
  .login-copy::after {
    opacity: 0.38;
  }

  .ticket-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  main,
  .topbar {
    width: min(100% - 18px, 1380px);
  }

  body {
    background-size: auto, auto, auto, 70px 70px, 70px 70px, auto;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .login-copy {
    min-height: 300px;
    padding: 24px 18px;
  }

  .login-copy h1 {
    font-size: clamp(2.2rem, 12vw, 3.1rem);
  }

  .login-card,
  .panel {
    padding: 16px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header,
  .page-heading {
    align-items: stretch;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .ticket-card {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .brand span {
    max-width: 138px;
  }

  .login-copy {
    min-height: 250px;
  }
}

@media (max-width: 720px) {
  .admin-nav {
    display: flex;
    gap: 8px;
    padding: 2px 0 8px;
    scroll-snap-type: x proximity;
  }

  .admin-nav-button {
    flex: 1 0 max(138px, 42%);
    min-height: 44px;
    padding: 0 12px;
    scroll-snap-align: start;
    text-align: center;
    white-space: nowrap;
  }

  .admin-nav-button.hidden {
    display: none;
  }

  .panel-header.admin-header {
    gap: 14px;
  }

  .panel-header.admin-header h2 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .panel-subtitle {
    line-height: 1.45;
  }

  .admin-search-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .claim-ticket-action {
    order: -2;
    width: 100%;
    min-height: 50px;
    font-size: 1rem;
  }

  .claimable-ticket .ticket-admin-actions {
    align-content: start;
  }

  .claimable-ticket .claim-ticket-action {
    box-shadow: 0 12px 22px rgba(111, 180, 65, 0.22);
  }

  .ticket-card.claimable-ticket {
    border-color: rgba(111, 180, 65, 0.45);
  }

  .portal-stats,
  .portal-modules {
    grid-template-columns: 1fr;
  }

  .portal-module {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .admin-nav-button {
    flex-basis: 72%;
  }

  .panel-header.admin-header h2 {
    font-size: 1.35rem;
  }
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(111, 180, 65, 0.1), transparent 36%),
    var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 44px);
  color: #f6fff2;
  background: #101820;
}

.brand,
.page-heading,
.panel-header,
.ticket-topline,
.toolbar,
.metrics {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 22px;
  margin-right: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.admin-nav-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: rgba(246, 255, 242, 0.82);
  background: transparent;
  font-weight: 800;
}

.admin-nav-button:hover,
.admin-nav-button.active {
  color: #102016;
  background: var(--brand);
}

.company-tagline {
  margin-left: auto;
  margin-right: 0;
  color: #b7e36d;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-nav:not(.hidden) + #logoutBtn {
  margin-left: 18px;
}

.notification-center {
  position: relative;
  margin-left: auto;
}

.admin-nav:not(.hidden) ~ .notification-center {
  margin-left: 16px;
}

.notification-button {
  position: relative;
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #102016;
  background: var(--brand);
  border-radius: var(--radius);
}

.notification-button span {
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 900;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: #b91c1c;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(216, 224, 231, 0.95);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-panel small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.notification-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  margin-top: 12px;
  overflow: auto;
}

.notification-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdf9;
}

.notification-list article.unread {
  border-color: #bde7a6;
  background: #f1faea;
}

.notification-list span {
  color: #344054;
  line-height: 1.4;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(111, 180, 65, 0.85);
  border-radius: var(--radius);
  color: var(--brand);
  background: #17231f;
  font-weight: 900;
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 46px;
}

.login-screen {
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 34px;
  align-items: center;
}

.login-copy h1,
.page-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.04;
}

.login-copy p,
.page-heading p {
  max-width: 620px;
  color: #344054;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-heading-copy .eyebrow {
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.login-card,
.panel,
.metrics article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card,
.panel {
  padding: 24px;
}

.login-card h2,
.panel h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.stack-form,
.ticket-form,
.ticket-admin-actions {
  display: grid;
  gap: 14px;
}

.stack-form,
.ticket-form {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.file-drop {
  position: relative;
  min-height: 132px;
  place-items: center;
  text-align: center;
  border: 1.5px dashed #a5b79d;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(111, 180, 65, 0.08), transparent),
    #fbfdf9;
  padding: 20px;
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #102016;
  background: var(--brand);
  border-radius: var(--radius);
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
}

.file-drop small {
  color: var(--muted);
  font-weight: 500;
}

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.preview-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.preview-item img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
}

.preview-item span {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(111, 180, 65, 0.18);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  color: #102016;
  background: var(--brand);
}

.secondary-button {
  color: var(--ink);
  background: #e8eef0;
}

.danger-button {
  color: #7f1d1d;
  background: #fee2e2;
}

.danger-button:hover {
  background: #fecaca;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.panel-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.app-screen {
  display: grid;
  gap: 18px;
}

.page-heading {
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.panel-header {
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header {
  align-items: flex-start;
}

.toolbar {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar input {
  min-width: min(360px, 100%);
}

.toolbar select {
  min-width: 170px;
}

#companyFilter {
  min-width: 220px;
}

.admin-search-row {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-search-row input {
  width: min(520px, 100%);
}

.metrics {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metrics article {
  min-width: 128px;
  padding: 14px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
}

.ticket-list {
  display: grid;
  gap: 12px;
}

.client-list {
  display: grid;
  gap: 10px;
}

.client-search-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(260px, 420px);
  align-items: stretch;
  gap: 12px;
  margin: 0 0 14px;
}

.client-search-row input {
  width: 100%;
  min-height: 46px;
}

.client-role-filter {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4f8f6;
}

.client-role-filter-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  color: #344054;
  background: transparent;
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.client-role-filter-button:hover {
  color: #102016;
  background: #e7efe9;
}

.client-role-filter-button.active {
  color: #102016;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(111, 180, 65, 0.22);
}

.client-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.client-card strong,
.client-card span,
.client-card small {
  display: block;
}

.client-card strong {
  margin-bottom: 6px;
}

.client-card-summary {
  min-width: 0;
}

.client-card span,
.client-card small {
  color: var(--muted);
  line-height: 1.45;
}

.client-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.client-card-actions .ticket-status {
  margin-right: 4px;
  flex: 0 0 auto;
}

.client-card-actions button {
  min-height: 40px;
  padding: 0 12px;
}

.client-edit-form {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ticket-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.client-ticket .ticket-card {
  grid-template-columns: 1fr;
}

.client-ticket .ticket-admin-actions {
  display: none;
}

.ticket-topline {
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ticket-protocol {
  font-size: 0.92rem;
}

.ticket-status,
.ticket-urgency {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #e9f7df;
  font-size: 0.78rem;
  font-weight: 800;
}

.ticket-urgency {
  background: #f0f5f0;
  border: 1px solid #dbe8d8;
}

.ticket-urgency.sla-warning {
  color: #7a4a00;
  background: #fff4db;
  border-color: #f7d38a;
}

.ticket-urgency.sla-overdue {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fecaca;
}

.ticket-urgency.sla-done {
  color: var(--ok);
  background: #e4f6ea;
  border-color: #bfe8ca;
}

.ticket-card.ticket-sla-warning {
  border-color: #f7c76d;
}

.ticket-card.ticket-sla-overdue {
  border-color: #fca5a5;
}

.sla-alert-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #f7d38a;
  border-radius: var(--radius);
  background: #fff8e8;
}

.sla-alert-panel h3,
.sla-alert-panel p {
  margin: 0;
}

.sla-alert-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.sla-alert-panel ul {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sla-alert-panel li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #f5dfad;
  border-radius: var(--radius);
  background: #fffdf8;
}

.sla-alert-panel em {
  font-style: normal;
  font-weight: 900;
}

.sla-alert-warning {
  color: #7a4a00;
}

.sla-alert-overdue {
  color: #991b1b;
}

.new-reply-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #7f1d1d;
  background: #fee2e2;
  font-size: 0.78rem;
  font-weight: 800;
}

.ticket-status.progress {
  color: #0f4f68;
  background: #dff4fb;
}

.ticket-status.waiting {
  color: var(--warning);
  background: #fff4db;
}

.ticket-status.done {
  color: var(--ok);
  background: #e4f6ea;
}

.ticket-status.cancelled {
  color: #7f1d1d;
  background: #fee2e2;
}

.ticket-card h3 {
  margin: 0 0 8px;
}

.ticket-meta,
.ticket-description,
.ticket-attachments {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ticket-description {
  margin-top: 8px;
  color: #344054;
}

.ticket-attachments {
  margin-top: 8px;
  font-size: 0.88rem;
}

.ticket-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ticket-image {
  overflow: hidden;
  width: 100%;
  min-height: 0;
  padding: 0;
  cursor: zoom-in;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ticket-image img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
}

.ticket-image span {
  display: block;
  padding: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

details {
  margin-top: 12px;
}

.details-action {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.ticket-history {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #344054;
  font-size: 0.86rem;
  line-height: 1.55;
}

.completion-summary {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #caeab6;
  border-radius: var(--radius);
  background: #f7fcf3;
}

.completion-summary span {
  display: block;
  color: var(--brand-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.completion-summary strong {
  display: block;
  margin-top: 3px;
}

.completion-summary p {
  margin: 0;
  color: #344054;
  line-height: 1.55;
  white-space: pre-wrap;
}

.completion-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.completion-signatures figure {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.completion-signatures img {
  width: 100%;
  height: 86px;
  object-fit: contain;
  border-bottom: 1px solid var(--line);
}

.completion-signatures figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.empty-state {
  padding: 26px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.ticket-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: 88vh;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 32, 0.28);
}

.ticket-dialog::backdrop,
.image-dialog::backdrop {
  background: rgba(16, 24, 32, 0.55);
}

.image-dialog {
  width: min(980px, calc(100% - 28px));
  max-height: 92vh;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 32, 0.28);
}

.image-dialog-body {
  display: grid;
  place-items: center;
  padding: 16px;
  background: #101820;
}

.image-dialog-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}

.dialog-header h2 {
  margin: 0;
}

.dialog-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dialog-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.dialog-section.full {
  grid-column: 1 / -1;
}

.dialog-section h3 {
  margin: 0 0 10px;
}

.dialog-section p {
  margin: 6px 0;
  color: #344054;
  line-height: 1.5;
}

.completion-dialog .dialog-body {
  gap: 18px;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.signature-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.signature-pad {
  overflow: hidden;
  border: 1px solid #cfd8df;
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 190px;
  cursor: crosshair;
}

.completion-legal {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.comment-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.conversation-section {
  background: #fbfdf9;
}

.chat-thread {
  display: grid;
  gap: 10px;
}

.message-bubble {
  width: min(86%, 620px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.message-bubble strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.message-bubble p {
  margin: 0;
  color: var(--ink);
}

.admin-message {
  justify-self: end;
  border-color: #caeab6;
  background: #f0fae9;
}

.client-message {
  justify-self: start;
  border-color: #d8e0e7;
  background: #ffffff;
}

@media (max-width: 860px) {
  .login-screen,
  .form-grid,
  .ticket-card,
  .dialog-grid,
  .signature-grid,
  .completion-signatures,
  .sla-alert-panel,
  .sla-alert-panel li {
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-heading,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-nav {
    width: 100%;
    margin: 0;
    order: 3;
  }

  .admin-nav-button {
    flex: 1;
  }

  .company-tagline {
    margin: 0;
    font-size: 0.74rem;
  }

  .toolbar,
  .metrics {
    justify-content: stretch;
  }
}

/* Visual refinement inspired by Chamado 1.0 */
body {
  background:
    linear-gradient(180deg, rgba(20, 36, 29, 0.05), transparent 340px),
    radial-gradient(circle at 82% 18%, rgba(111, 180, 65, 0.10), transparent 260px),
    var(--bg);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
}

.topbar::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: -1;
  height: 72px;
  background: rgba(16, 24, 32, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-small {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  background: #fff;
}

.login-screen {
  min-height: calc(100vh - 112px);
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 0.74fr);
  gap: 28px;
}

.login-screen.auth-signup {
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 0.82fr);
}

.login-copy {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px;
  text-align: center;
  color: #f9fafb;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(9, 15, 20, 0.88), rgba(9, 15, 20, 0.62)),
    url("assets/hero-cftv.png") center/cover,
    linear-gradient(135deg, #101820, #315f25);
  box-shadow: var(--shadow);
}

.login-copy::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--brand), #b7e36d, var(--brand-dark));
}

.login-logo {
  position: absolute;
  left: 28px;
  top: 28px;
  width: 74px;
  height: 74px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.30);
}

.login-copy h1 {
  max-width: 760px;
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
}

.login-copy p {
  max-width: 620px;
  color: rgba(249, 250, 251, 0.86);
}

.login-copy .eyebrow {
  color: #b7e36d;
  opacity: 1;
}

.login-card,
.panel,
.metrics article,
.ticket-card,
.dialog-section {
  border: 1px solid rgba(216, 224, 231, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card {
  position: relative;
  padding: 30px;
}

.text-button {
  width: max-content;
  min-height: 0;
  margin-top: 10px;
  padding: 0;
  color: var(--brand-dark);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.text-button:hover {
  color: var(--brand-strong);
  background: transparent;
  text-decoration: underline;
}

.form-message {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-message.error {
  color: #991b1b;
}

.form-message.success {
  color: var(--brand-dark);
}

.primary-button {
  box-shadow: 0 12px 24px rgba(111, 180, 65, 0.24);
}

.ticket-admin-actions {
  padding: 12px;
  border: 1px solid #edf1f4;
  border-radius: var(--radius);
  background: #f8fbfa;
}

.portal-panel {
  display: grid;
  gap: 16px;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-stats article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.portal-stats span,
.portal-module span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.7rem;
}

.portal-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.portal-module {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid #caeab6;
  border-radius: var(--radius);
  background: #f7fcf3;
}

.portal-module.locked {
  border-color: var(--line);
  background: #f8fbfa;
}

.portal-module h3 {
  margin: 8px 0 6px;
}

.portal-module p {
  margin: 0;
  color: #344054;
  line-height: 1.45;
}

.portal-module button {
  width: 100%;
}

.claim-ticket-box {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #caeab6;
  border-radius: var(--radius);
  background: #f4fbef;
}

.claim-ticket-box strong {
  color: var(--brand-dark);
}

.claim-ticket-box span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.ticket-card {
  transition: border-color 160ms ease, transform 160ms ease;
}

.ticket-card:hover {
  border-color: rgba(111, 180, 65, 0.55);
  transform: translateY(-1px);
}

.dialog-header {
  background: #101820;
  color: #fff;
}

.dialog-header .eyebrow {
  color: #b7e36d;
}

.dialog-header .secondary-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    min-height: 72px;
    padding: 12px 0;
  }

  .admin-nav {
    width: 100%;
    margin: 0;
  }

  .admin-nav-button {
    flex: 1;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-copy {
    min-height: 430px;
  }

  .login-logo {
    width: 62px;
    height: 62px;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  button,
  input,
  select {
    min-height: 44px;
  }

  body {
    background:
      linear-gradient(180deg, rgba(20, 36, 29, 0.05), transparent 240px),
      var(--bg);
  }

  main {
    width: min(100% - 20px, 1160px);
    padding: 14px 0 28px;
  }

  .topbar {
    width: min(100% - 20px, 1180px);
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .brand-logo-small {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  .company-tagline {
    grid-column: 1 / -1;
    order: 4;
    width: 100%;
    margin: 0;
    font-size: 0.7rem;
    text-align: center;
    white-space: normal;
  }

  .admin-nav {
    grid-column: 1 / -1;
    order: 5;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .notification-center {
    margin-left: 0;
    justify-self: end;
  }

  .admin-nav:not(.hidden) ~ .notification-center {
    margin-left: 0;
  }

  #logoutBtn {
    min-height: 40px;
    padding: 0 12px;
    justify-self: end;
  }

  .notification-button {
    width: 40px;
    min-height: 40px;
  }

  .notification-panel {
    position: fixed;
    top: 74px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 90px);
    overflow: auto;
  }

  .login-screen {
    min-height: auto;
    gap: 14px;
  }

  .login-copy {
    min-height: 320px;
    padding: 24px 18px;
  }

  .login-copy h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .login-card,
  .panel {
    padding: 18px;
  }

  .login-card {
    width: 100%;
  }

  .page-heading {
    gap: 12px;
  }

  .page-heading h1 {
    font-size: clamp(2.2rem, 14vw, 3.5rem);
  }

  .admin-heading-copy .eyebrow {
    font-size: 0.9rem;
  }

  .metrics {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metrics article {
    min-width: 0;
    padding: 12px;
  }

  .toolbar,
  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .toolbar select,
  .toolbar input,
  .toolbar button,
  .actions button,
  .admin-search-row input,
  .client-search-row input {
    width: 100%;
  }

  .admin-search-row,
  .client-search-row {
    justify-content: stretch;
  }

  .client-search-row {
    grid-template-columns: 1fr;
  }

  .client-role-filter {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .client-role-filter-button {
    flex: 1 0 auto;
  }

  .form-grid,
  .preview-list,
  .ticket-card,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .ticket-card {
    padding: 14px;
    overflow: hidden;
  }

  .ticket-topline {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ticket-card h3 {
    font-size: 1.02rem;
    line-height: 1.35;
  }

  .ticket-meta,
  .ticket-description,
  .ticket-attachments {
    overflow-wrap: anywhere;
  }

  .ticket-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-admin-actions {
    padding: 10px;
  }

  .ticket-admin-actions button {
    width: 100%;
  }

  details,
  summary {
    width: 100%;
  }

  .client-card {
    padding: 12px;
    overflow: hidden;
  }

  .client-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .client-card-actions .ticket-status,
  .client-card-actions button {
    width: 100%;
    min-width: 0;
    margin-right: 0;
    justify-content: center;
    text-align: center;
  }

  .ticket-dialog,
  .image-dialog {
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
  }

  .dialog-header {
    gap: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-body {
    padding: 14px;
    max-height: calc(100dvh - 122px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .message-bubble {
    width: 100%;
    overflow-wrap: anywhere;
  }

  .sla-alert-panel {
    padding: 14px;
  }

  .sla-alert-panel li {
    align-items: stretch;
  }
}

@media (max-width: 420px) {
  .metrics,
  .client-card-actions,
  .ticket-images {
    grid-template-columns: 1fr;
  }

  .login-copy {
    min-height: 250px;
    padding: 22px 16px;
  }

  .login-logo {
    width: 52px;
    height: 52px;
    left: 18px;
    top: 18px;
  }

  .login-copy h1 {
    font-size: clamp(1.85rem, 11vw, 2.65rem);
  }

  .login-copy p {
    font-size: 0.95rem;
  }

  .brand span {
    max-width: 145px;
  }

  .admin-nav-button {
    min-width: 120px;
  }

  .page-heading h1 {
    font-size: clamp(1.95rem, 12vw, 2.8rem);
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .ticket-card,
  .ticket-admin-actions,
  .ticket-main {
    min-width: 0;
  }

  .ticket-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .ticket-protocol {
    width: 100%;
    overflow-wrap: anywhere;
  }

  .ticket-status,
  .ticket-urgency,
  .new-reply-badge {
    max-width: 100%;
    height: auto;
    white-space: normal;
    line-height: 1.25;
  }

  .ticket-admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .ticket-admin-actions input,
  .ticket-admin-actions select,
  .ticket-admin-actions button {
    width: 100%;
    min-width: 0;
  }

  .ticket-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .completion-dialog form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
  }

  .dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #101820;
    color: #fff;
  }

  .dialog-header h2 {
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .dialog-header .secondary-button {
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .dialog-body {
    align-content: start;
    gap: 12px;
    min-height: 0;
    max-height: none;
    padding: 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .signature-grid,
  .completion-signatures,
  .dialog-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dialog-section,
  .signature-panel {
    padding: 12px;
  }

  .signature-panel {
    background: #fbfdfc;
  }

  .signature-pad {
    border-width: 2px;
  }

  .signature-pad canvas {
    height: 220px;
  }

  .completion-dialog textarea {
    min-height: 150px;
    resize: vertical;
  }

  .completion-legal {
    padding: 10px 12px;
    border: 1px solid #d8e0e7;
    border-radius: var(--radius);
    background: #f8fbfa;
  }

  .completion-dialog .actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 -12px -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
  }

  .completion-dialog .actions button {
    width: 100%;
    min-height: 46px;
  }
}

@media (max-width: 380px) {
  .dialog-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dialog-header .secondary-button {
    width: 100%;
  }

  .signature-pad canvas {
    height: 200px;
  }
}

/* Fundo inferior sem desenho decorativo em todas as telas. */
body::after { content: none !important; display: none !important; background: none !important; }
