:root {
  --bg: #050506;
  --bg-2: #080a0d;
  --bg-3: #0d1015;
  --surface: #10141b;
  --surface-soft: #141a24;
  --surface-card: #181f2a;
  --surface-card-alt: #1d2532;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(180, 198, 223, 0.35);
  --text: #f3f5f8;
  --text-soft: #d4dae2;
  --text-muted: #9aa4b2;
  --accent: #b8c9df;
  --accent-strong: #dce7f5;
  --accent-green: #b8c9df;
  --accent-red: #b5bdca;
  --accent-amber: #b6c4d8;
  --shadow-soft: 0 12px 35px rgba(0, 0, 0, 0.34);
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --font-body: "Red Hat Text", "Segoe UI", Arial, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1000px 600px at 110% -10%, rgba(132, 164, 212, 0.12), transparent 62%),
    radial-gradient(900px 560px at -10% 110%, rgba(78, 113, 162, 0.1), transparent 66%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  color: #dbe8ff;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  color: #f0f4fa;
  background: rgba(137, 162, 196, 0.14);
  border: 1px solid rgba(176, 195, 223, 0.28);
  border-radius: 6px;
  padding: 0.08rem 0.3rem;
}

.auth-body {
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(120, 149, 193, 0.14), transparent 60%),
    radial-gradient(760px 440px at 0% 100%, rgba(70, 103, 149, 0.14), transparent 60%),
    linear-gradient(180deg, #050607 0%, #090c11 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(340px, 560px);
  gap: 2rem;
  align-items: start;
  align-content: center;
  justify-content: center;
  padding: clamp(1.1rem, 4vw, 3rem);
}

.auth-brand {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.4vw, 2rem);
  background: linear-gradient(165deg, rgba(22, 27, 34, 0.9) 0%, rgba(12, 15, 20, 0.93) 100%);
  box-shadow: var(--shadow-soft);
}

.auth-brand-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.auth-brand-logo {
  width: min(220px, 100%);
  height: auto;
  margin-bottom: 0.9rem;
  opacity: 0.96;
}

.auth-brand h1 {
  font-size: clamp(1.8rem, 3.8vw, 2.55rem);
}

.auth-brand-subtitle {
  margin-top: 0.3rem;
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.auth-brand-copy {
  margin-top: 1rem;
  color: var(--text-soft);
  line-height: 1.68;
  font-size: 0.95rem;
  max-width: 42ch;
}

.auth-panel-wrap {
  display: grid;
  gap: 0.85rem;
}

.auth-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(19, 24, 32, 0.95) 0%, rgba(11, 14, 20, 0.97) 100%);
  padding: clamp(1.2rem, 2.8vw, 2rem);
  box-shadow: var(--shadow-soft);
}

.auth-footnote {
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.classification-tag {
  margin-top: 0.85rem;
  border: 1px solid rgba(177, 197, 225, 0.4);
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  display: inline-flex;
  width: fit-content;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #d5e1f1;
  background: rgba(59, 78, 106, 0.25);
}

.form-grid {
  display: grid;
  gap: 0.95rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.form-field {
  display: grid;
  gap: 0.42rem;
}

.form-field label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  color: var(--text);
  background: linear-gradient(180deg, rgba(14, 18, 25, 0.98), rgba(10, 13, 18, 0.98));
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  font-size: 0.91rem;
  font-family: inherit;
}

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

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(186, 207, 235, 0.72);
  box-shadow: 0 0 0 3px rgba(122, 150, 188, 0.22);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.btn {
  border: 1px solid rgba(176, 195, 223, 0.4);
  background: linear-gradient(180deg, rgba(31, 40, 54, 0.94), rgba(20, 27, 37, 0.95));
  color: #edf2f8;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  border-radius: 10px;
  padding: 0.66rem 0.95rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(44, 56, 74, 0.97), rgba(28, 38, 51, 0.97));
}

.btn-secondary,
.btn-ghost {
  background: transparent;
}

.btn-danger {
  border-color: rgba(233, 138, 149, 0.6);
  background: linear-gradient(180deg, rgba(127, 43, 57, 0.92), rgba(97, 31, 43, 0.94));
  color: #ffe5e8;
}

.btn-danger:hover {
  background: linear-gradient(180deg, rgba(145, 56, 71, 0.95), rgba(111, 38, 51, 0.97));
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: rgba(124, 148, 182, 0.16);
}

.link-inline {
  font-size: 0.83rem;
  color: #c6d8ef;
}

.link-inline:hover {
  color: var(--accent-strong);
}

.alert {
  border-radius: 10px;
  border: 1px solid;
  padding: 0.74rem 0.84rem;
  font-size: 0.83rem;
  line-height: 1.5;
}

.alert-danger {
  border-color: rgba(188, 196, 209, 0.5);
  background: rgba(63, 72, 84, 0.34);
  color: #eef3fa;
}

.alert-success {
  border-color: rgba(173, 197, 228, 0.45);
  background: rgba(51, 68, 93, 0.34);
  color: #e9f1fc;
}

.notice {
  border: 1px solid rgba(171, 190, 216, 0.35);
  border-radius: 12px;
  background: rgba(29, 38, 52, 0.56);
  color: var(--text-soft);
  padding: 0.85rem 0.95rem;
  font-size: 0.87rem;
  line-height: 1.6;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(175deg, rgba(14, 17, 22, 0.98) 0%, rgba(8, 10, 14, 0.99) 100%);
  padding: 1rem;
}

.sidebar-brand {
  border: 1px solid rgba(171, 187, 208, 0.24);
  border-radius: 14px;
  padding: 0.84rem 0.78rem;
  background: rgba(20, 25, 33, 0.68);
}

.sidebar-eyebrow {
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.brand-logo {
  width: min(190px, 100%);
  display: block;
  height: auto;
}

.sidebar-subtext {
  margin-top: 0.6rem;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.81rem;
}

.sidebar-nav {
  margin-top: 0.9rem;
}

.sidebar-nav-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0.1rem 0 0.5rem;
  padding-left: 0.26rem;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}

.sidebar-nav a {
  display: block;
  color: var(--text-soft);
  padding: 0.58rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  transition: 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  color: #f4f8ff;
  border-color: rgba(169, 189, 218, 0.4);
  background: rgba(64, 84, 112, 0.26);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.9);
  backdrop-filter: blur(6px);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  padding: 0.42rem 0.58rem;
}

.topbar-title-wrap h2 {
  font-size: 1.26rem;
}

.topbar-title-wrap p {
  margin-top: 0.18rem;
  font-size: 0.79rem;
  color: var(--text-muted);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.user-meta {
  display: grid;
  gap: 0.08rem;
  text-align: right;
}

.user-meta strong {
  font-size: 0.82rem;
}

.user-meta span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.user-role-badge {
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  padding: 0.22rem 0.48rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e6eef9;
  background: rgba(63, 81, 108, 0.32);
}

.app-content {
  padding: 1rem 1.15rem 1.25rem;
  display: grid;
  gap: 0.9rem;
}

.page-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  background: linear-gradient(170deg, rgba(21, 28, 38, 0.84), rgba(13, 17, 24, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.page-section-title {
  font-size: 1.07rem;
  margin-bottom: 0.7rem;
}

.page-lead {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}

.kpi-card {
  border: 1px solid rgba(171, 188, 210, 0.32);
  border-radius: 12px;
  padding: 0.82rem 0.85rem;
  background: linear-gradient(180deg, rgba(30, 38, 50, 0.88), rgba(20, 26, 35, 0.92));
}

.kpi-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.63rem;
}

.kpi-value {
  margin-top: 0.43rem;
  font-family: var(--font-display);
  font-size: 1.52rem;
}

.kpi-sub {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.table-wrap {
  border: 1px solid rgba(164, 183, 209, 0.28);
  border-radius: 11px;
  overflow: auto;
  background: rgba(10, 13, 18, 0.82);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid rgba(108, 136, 175, 0.24);
  font-size: 0.82rem;
  line-height: 1.45;
}

th {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
  background: rgba(24, 31, 42, 0.85);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover td {
  background: rgba(73, 88, 112, 0.16);
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.badge-status-active,
.badge-status-resolved,
.badge-role-platform_admin,
.badge-role-company_admin {
  color: #e2ecf9;
  border-color: rgba(173, 196, 227, 0.5);
  background: rgba(61, 80, 109, 0.34);
}

.badge-status-investigating,
.badge-status-open,
.badge-status-deferred {
  color: #e3e7ee;
  border-color: rgba(178, 186, 198, 0.5);
  background: rgba(67, 74, 84, 0.32);
}

.badge-status-inactive,
.badge-status-suspended,
.badge-status-expired,
.badge-status-rejected {
  color: #e6e9ef;
  border-color: rgba(173, 181, 193, 0.48);
  background: rgba(58, 65, 73, 0.34);
}

.badge-severity-low {
  color: #d8f7e8;
  border-color: rgba(124, 197, 161, 0.55);
  background: rgba(39, 95, 71, 0.34);
}

.badge-severity-medium {
  color: #fff1cd;
  border-color: rgba(231, 195, 112, 0.58);
  background: rgba(112, 83, 28, 0.35);
}

.badge-severity-high,
.badge-severity-critical {
  color: #ffe0e4;
  border-color: rgba(226, 132, 145, 0.58);
  background: rgba(110, 38, 49, 0.36);
}

.badge-role-standard_user {
  color: #dbe7f7;
  border-color: rgba(168, 187, 214, 0.45);
  background: rgba(56, 72, 95, 0.3);
}

.filters-grid {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.muted {
  color: var(--text-muted);
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
}

.chart-wrap {
  border: 1px solid rgba(166, 184, 209, 0.3);
  border-radius: var(--radius-md);
  background: linear-gradient(175deg, rgba(26, 34, 46, 0.84), rgba(15, 20, 28, 0.88));
  padding: 0.82rem;
  min-height: 278px;
}

ul {
  margin: 0;
}

.page-card ul {
  margin-top: 0.5rem;
  padding-left: 1.15rem;
}

.page-card ul li {
  margin-bottom: 0.25rem;
  color: var(--text-soft);
  font-size: 0.86rem;
}

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 300px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 50;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .topbar-user .user-meta,
  .topbar-user .user-role-badge {
    display: none;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

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

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-sidebar,
  .app-topbar,
  .form-actions,
  .filters-grid,
  .pagination,
  .btn,
  .sidebar-toggle,
  .classification-tag {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .app-content,
  .page-card,
  .table-wrap {
    display: block;
    background: #fff !important;
    color: #000 !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  th,
  td,
  p,
  h1,
  h2,
  h3,
  h4 {
    color: #000 !important;
    border-color: #bbb !important;
  }
}

/* Hard-edge UI: no rounded corners */
code,
.auth-brand,
.auth-panel,
.classification-tag,
.form-field input,
.form-field select,
.form-field textarea,
.btn,
.alert,
.notice,
.sidebar-brand,
.sidebar-nav a,
.user-role-badge,
.sidebar-toggle,
.page-card,
.kpi-card,
.table-wrap,
.badge,
.empty-state,
.chart-wrap {
  border-radius: 0 !important;
}
