:root {
  --stein: #00e5ff;
  --stein-glow: rgba(0, 229, 255, 0.4);
  --stein-700: #00b8cc;
  --stein-900: #008f99;
  
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.25);
  
  --page: #040914; 
  
  --surface: rgba(15, 23, 42, 0.6);
  --surface-solid: #0f172a;
  --surface-soft: rgba(30, 41, 59, 0.5);
  --surface-teal: rgba(0, 229, 255, 0.08);
  
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.15);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --violet: #a855f7;
  --violet-soft: rgba(168, 85, 247, 0.15);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: 
    radial-gradient(circle at 15% 50%, rgba(168, 85, 247, 0.15), transparent 40vw),
    radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.12), transparent 40vw),
    var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  margin-bottom: 6px;
  color: var(--stein);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--stein);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  color: var(--ink);
  background: rgba(4, 9, 20, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
}

.sidebar::after {
  content: "";
  display: block;
  margin-top: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
}

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

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

.nav-item,
.nav-link {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  color: var(--ink-soft);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 200ms ease;
}

.nav-link {
  display: inline-flex;
  align-items: center;
}

.nav-item:hover,
.nav-item.active,
.nav-link:hover {
  color: var(--stein);
  background: var(--surface-teal);
  border-color: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.05);
  transform: translateX(4px);
}

.main {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 32px;
}

.topbar,
.portal-topbar,
.portal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  margin-bottom: 24px;
}

.top-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-button,
.ghost-button,
.icon-button,
.google-button {
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 700;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button {
  padding: 0 20px;
  color: #040914;
  background: var(--stein);
  border: 1px solid var(--stein);
  box-shadow: 0 4px 16px var(--stein-glow);
}

.primary-button:hover {
  background: #00f0ff;
  border-color: #00f0ff;
  box-shadow: 0 6px 24px var(--stein-glow);
  transform: translateY(-2px);
}

.ghost-button {
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  place-items: center;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}

.ghost-link,
.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 200ms ease;
}

.ghost-link:hover {
  border-color: var(--stein);
  color: var(--stein);
  box-shadow: 0 0 12px var(--stein-glow);
}

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

.metric-tile {
  min-height: 110px;
  padding: 20px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.metric-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-tile strong {
  display: block;
  margin-top: 10px;
  color: var(--stein);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.metric-tile.alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), var(--surface));
  border-color: rgba(239, 68, 68, 0.2);
}

.metric-tile.alert strong {
  color: var(--red);
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.section-view {
  display: none;
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-view.active {
  display: block;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.46fr) minmax(380px, 0.86fr);
  gap: 20px;
  align-items: start;
}

.workspace-grid.active,
.portal-grid {
  display: grid;
}

.portal-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
}

.tool-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.ticket-form {
  padding: 28px;
}

.queue-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
}

.queue-panel > .panel-heading {
  margin-bottom: 0;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--stein);
  background: var(--surface-teal);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  gap: 16px;
}

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

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

.span-two {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: all 200ms ease;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 14px;
}

input:disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--stein);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15), 0 0 15px rgba(0, 229, 255, 0.1);
}

/* Fix option contrast in dark mode selects */
select option {
  background: var(--surface-solid);
  color: var(--ink);
}

.file-drop {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  transition: all 200ms ease;
}

.file-drop:hover {
  border-color: var(--stein);
  background: rgba(0, 229, 255, 0.05);
}

.file-drop input {
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

small {
  color: var(--muted);
  font-weight: 500;
}

.compact-filters,
.admin-filters {
  display: grid;
  gap: 12px;
}

.compact-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.compact-filters input[type="search"] {
  grid-column: 1 / -1;
}

.ticket-list {
  display: grid;
  max-height: 740px;
  overflow: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ticket-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  transition: background 200ms ease;
}

.ticket-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ticket-card strong {
  color: var(--ink);
}

.ticket-head,
.ticket-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticket-title {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 700;
  font-size: 1.05rem;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px currentColor;
}

.badge.status-aberto {
  color: #38bdf8; /* light blue */
  background: rgba(56, 189, 248, 0.15);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.badge.status-em-analise,
.badge.status-em-execucao {
  color: #fbbf24; /* amber */
  background: rgba(251, 191, 36, 0.15);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.3);
}

.badge.status-aguardando {
  color: #c084fc; /* violet */
  background: rgba(192, 132, 252, 0.15);
  box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.3);
}

.badge.status-resolvido,
.badge.status-encerrado,
.badge.priority-baixa {
  color: #34d399; /* emerald */
  background: rgba(52, 211, 153, 0.15);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.3);
}

.badge.priority-normal {
  color: #60a5fa; /* blue */
  background: rgba(96, 165, 250, 0.15);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.3);
}

.badge.priority-alta {
  color: #fb923c; /* orange */
  background: rgba(251, 146, 60, 0.15);
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.3);
}

.badge.priority-urgente {
  color: #f87171; /* red */
  background: rgba(248, 113, 113, 0.15);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.3);
}

.empty-state {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

.board-layout,
.reports-grid {
  display: grid;
  gap: 20px;
}

.board-layout .tool-panel,
.reports-grid .tool-panel {
  padding: 24px;
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 16px;
}

.board-column {
  min-height: 280px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.board-column-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.board-column-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mini-card {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 200ms ease;
}

.mini-card:hover {
  border-color: var(--stein);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.1);
}

.mini-card:focus-visible {
  outline: 2px solid var(--stein);
  outline-offset: 3px;
}

.mini-card-content {
  display: grid;
  gap: 6px;
}

.mini-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.card-status-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.card-status-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 180ms ease;
}

.card-status-button:hover:not(:disabled),
.card-status-button:focus-visible {
  color: var(--night);
  background: var(--stein);
  border-color: var(--stein);
}

.card-status-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

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

.bar-list {
  display: grid;
  gap: 16px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--stein-900), var(--stein));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 9, 20, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms ease;
}
.drawer-backdrop:not([hidden]) {
  opacity: 1;
}

body.modal-open {
  overflow: hidden;
}

.ticket-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  display: flex;
  width: min(980px, calc(100vw - 40px));
  max-height: min(86vh, 820px);
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.68);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.96);
  transition:
    opacity 200ms ease,
    transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ticket-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  display: grid;
  gap: 20px;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: transparent;
}

.drawer-section {
  display: grid;
  gap: 14px;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-item {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--stein);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item strong,
.detail-full {
  overflow-wrap: anywhere;
}

.detail-item p {
  margin-bottom: 0;
}

.update-form,
.comment-form {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.checkbox-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--stein);
}

.comment-row,
.history-row {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.comment-row p,
.history-row p {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.comment-row small,
.history-row small,
.mini-card small,
.admin-ticket-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-list a {
  min-height: 36px;
  padding: 8px 14px;
  color: var(--stein);
  text-decoration: none;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
  font-weight: 700;
  transition: all 200ms ease;
}

.attachment-list a:hover {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  max-width: min(440px, calc(100vw - 48px));
  padding: 16px 20px;
  color: #040914;
  background: var(--stein);
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 8px 32px var(--stein-glow);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-page {
  min-height: 100vh;
  /* Redundant bg rule, uses body background */
}

.login-shell {
  display: grid;
  width: min(1180px, 100%);
  min-height: 100vh;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  margin: 0 auto;
  padding: 32px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  min-height: 610px;
  margin: 0;
  padding: 48px;
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.login-brand {
  color: var(--ink);
}

.login-brand span {
  color: var(--muted);
}

.login-brand img {
  width: 60px;
  height: 60px;
}

.login-copy p:last-child {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 20px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 1.05rem;
  backdrop-filter: blur(8px);
}

.google-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.google-button.disabled {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.google-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #4285f4;
  background: #fff;
  border-radius: 50%;
  font-weight: 900;
  font-size: 1.2rem;
}

.login-warning {
  padding: 16px;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
}

.login-aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  min-height: 610px;
  padding: 64px;
  background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.05), transparent 70%);
}

.aside-logo {
  display: grid;
  width: 140px;
  height: 140px;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.1);
  backdrop-filter: blur(12px);
}

.aside-logo img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.4));
}

.login-aside h2 {
  max-width: 650px;
  font-size: 2.6rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.login-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  color: var(--stein);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

.portal-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.portal-topbar {
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.portal-topbar .top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-heading {
  align-items: end;
  margin-bottom: 24px;
  padding: 8px 0 4px;
}

.portal-counter {
  min-width: 180px;
  padding: 20px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.portal-counter span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-counter strong {
  display: block;
  margin-top: 8px;
  color: var(--stein);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
}

.admin-panel {
  padding: 24px;
}

.admin-filters {
  grid-template-columns: minmax(360px, 2fr) repeat(4, minmax(126px, 0.8fr));
  margin-bottom: 20px;
}

.admin-ticket-list {
  display: grid;
  overflow: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-ticket-head,
.admin-ticket-row {
  display: grid;
  grid-template-columns: 150px minmax(280px, 1.4fr) 120px 110px 150px 110px;
  gap: 16px;
  align-items: center;
  min-width: 1040px;
  padding: 14px 18px;
}

.admin-ticket-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-solid);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-ticket-row {
  width: 100%;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  transition: background 200ms ease;
}

.admin-ticket-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 440px;
  }

  .workspace-grid,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .queue-panel {
    position: static;
  }

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

  .admin-filters input[type="search"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .main,
  .portal-shell {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .topbar,
  .top-actions,
  .form-actions,
  .portal-topbar,
  .portal-heading,
  .ticket-head,
  .ticket-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics-grid,
  .field-grid.two,
  .field-grid.three,
  .board-columns,
  .detail-grid,
  .reports-grid,
  .compact-filters,
  .admin-filters,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel,
  .login-aside {
    min-height: auto;
    margin: 0;
    padding: 24px;
  }

  .login-aside {
    display: none;
  }

  .ticket-form,
  .board-layout .tool-panel,
  .reports-grid .tool-panel,
  .admin-panel {
    padding: 20px;
  }

  .ticket-drawer {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .drawer-header,
  .drawer-body {
    padding: 18px;
  }

  .side-nav {
    grid-template-columns: 1fr 1fr;
    flex-basis: 100%;
  }
}
