:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #162128;
  --muted: #66737b;
  --line: #dce3e7;
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
  --accent: #d99a2b;
  --good: #158057;
  --warn: #a65f00;
  --danger: #b44242;
  --side: #102126;
  --shadow: 0 18px 44px rgba(20, 34, 42, 0.1);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
}

.hero {
  min-height: 100vh;
  padding: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 36px;
  align-items: center;
  background:
    linear-gradient(120deg, rgba(16, 33, 38, 0.92), rgba(15, 118, 110, 0.76)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='900' viewBox='0 0 1200 900'%3E%3Crect width='1200' height='900' fill='%23102126'/%3E%3Cg fill='none' stroke='%23d99a2b' stroke-opacity='.22' stroke-width='2'%3E%3Cpath d='M120 160h260v170H120zM440 90h360v260H440zM860 190h220v180H860zM170 470h330v230H170zM590 520h420v250H590z'/%3E%3Cpath d='M250 160v-60h720v90M500 585h90M800 350v170M380 245h60M1010 430v90'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.08'%3E%3Ccircle cx='220' cy='245' r='36'/%3E%3Ccircle cx='705' cy='220' r='52'/%3E%3Ccircle cx='900' cy='645' r='62'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: #fff;
}

.hero-copy {
  max-width: 760px;
}

.landing-logo {
  display: block;
  max-width: 190px;
  max-height: 92px;
  object-fit: contain;
  margin-bottom: 22px;
  border-radius: 8px;
}

.hero-copy h1 {
  margin: 0 0 18px;
  max-width: 780px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.98;
}

.hero-copy p {
  max-width: 630px;
  margin: 0;
  color: #d6e2e4;
  font-size: 1.06rem;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-device {
  width: min(260px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: 34px;
  padding: 18px;
  background: #0f1b20;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.13), 0 28px 70px rgba(0, 0, 0, 0.35);
}

.device-top {
  width: 58px;
  height: 6px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: #60737b;
}

.device-screen {
  height: calc(100% - 24px);
  border-radius: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: linear-gradient(160deg, #eef8f6, #cddfe2);
  color: var(--ink);
}

.device-screen span,
.apk-badge {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.device-screen strong {
  font-size: 1.7rem;
}

.login-panel {
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 26px;
  background: var(--panel);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #172026;
  font-weight: 900;
  overflow: hidden;
}

.brand-mark.has-image {
  background: #fff;
  padding: 4px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.brand-row span,
.helper,
.form-message,
.metadata dt,
.stat-card small,
.stat-card span {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: #31424a;
  font-weight: 700;
}

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

.field textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.row-action,
.link-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  border: 0;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button,
.row-action {
  background: #e8eef0;
  color: var(--ink);
}

.link-button {
  background: transparent;
  color: var(--brand);
  text-align: center;
}

.link-button:hover {
  background: #edf5f4;
}

.recovery-form {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.mfa-summary,
.mfa-admin-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mfa-summary span,
.mfa-admin-box code {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mfa-enrollment {
  display: grid;
  gap: 10px;
}

.qr-box {
  min-height: 104px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1) 25%, transparent 25% 50%, rgba(15, 118, 110, 0.1) 50% 75%, transparent 75%),
    #fff;
  background-size: 24px 24px;
  color: var(--ink);
  font-family: Consolas, monospace;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  padding: 12px;
  overflow-wrap: anywhere;
}

.ghost-button.compact {
  min-height: 34px;
  padding: 0 12px;
}

.demo-access,
.form-actions,
.top-actions,
.ticket-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 0.92rem;
}

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

.sidebar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--side);
  color: #f7fbfc;
  min-width: 0;
}

.sidebar .brand-row span,
.session-card small,
.session-card span {
  color: #b6c6cc;
}

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

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #d9e5e8;
  text-align: left;
  font-weight: 800;
}

.nav-item span {
  color: #87a3aa;
  font-size: 0.78rem;
}

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

.session-card {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 8px;
}

.session-card strong,
.session-card span {
  overflow-wrap: anywhere;
}

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

.topbar,
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.topbar {
  margin-bottom: 18px;
}

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

h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1.14rem;
}

h4 {
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

.panel-header {
  margin-bottom: 16px;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.two-column,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  align-items: start;
}

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

.stat-card {
  min-height: 124px;
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 2rem;
}

.download-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.metadata {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.metadata div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

.metadata dt {
  font-weight: 800;
}

.metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.rich-text {
  color: #31424a;
  line-height: 1.65;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f4;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.on {
  background: #dcf4ea;
  color: var(--good);
}

.status-pill.pending {
  background: #fff0d7;
  color: var(--warn);
}

.status-pill.off {
  background: #f8e2e2;
  color: var(--danger);
}

.ticket-list {
  display: grid;
  gap: 12px;
}

.ticket-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.ticket-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ticket-item strong,
.ticket-item p {
  overflow-wrap: anywhere;
}

.ticket-item p {
  margin-bottom: 0;
  color: #354850;
  line-height: 1.5;
}

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

.ticket-note {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}

.segmented button {
  min-height: 34px;
  border: 0;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.segmented button.active {
  background: var(--brand);
  color: #fff;
}

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

.full {
  grid-column: 1 / -1;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #31424a;
  font-weight: 800;
}

.toggle input {
  width: 18px;
  height: 18px;
}

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

.table-wrap {
  overflow: auto;
}

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

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

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

td small {
  display: block;
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  max-width: 300px;
}

.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filters-row .search-input {
  min-width: 210px;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-preview-box {
  width: 180px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
  font-weight: 800;
}

.logo-preview-box.has-image {
  border-style: solid;
  background: #fff;
  padding: 8px;
}

.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

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

  .hero {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) 190px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 16px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-item {
    justify-content: center;
    flex: 0 0 auto;
    min-width: 112px;
  }

  .nav-item span {
    display: none;
  }

  .session-card {
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .session-card small {
    display: none;
  }

  .session-card strong,
  .session-card span {
    font-size: 0.86rem;
  }

  .session-card .ghost-button {
    grid-row: 1 / span 2;
    grid-column: 2;
    min-height: 36px;
  }

  .stats-grid,
  .two-column,
  .split-layout {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 760px) {
  .login-page {
    min-height: 100dvh;
  }

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

  .login-panel {
    order: 1;
    align-content: start;
    gap: 18px;
  }

  .hero {
    order: 2;
    min-height: auto;
    gap: 22px;
  }

  .hero,
  .stats-grid,
  .two-column,
  .split-layout,
  .form-grid,
  .download-card {
    grid-template-columns: 1fr;
  }

  .hero-device {
    max-width: 150px;
    justify-self: center;
  }

  .landing-logo {
    max-width: 150px;
    max-height: 70px;
    margin-bottom: 14px;
  }

  .hero-copy h1 {
    font-size: 2rem;
    line-height: 1.06;
  }

  .hero-copy p {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .topbar,
  .panel-header,
  .ticket-item header {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    display: flex;
    margin: 0 -4px;
  }

  .nav-item {
    min-width: 104px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .workspace {
    padding-bottom: 30px;
  }

  .session-card {
    display: grid;
  }

  .panel {
    padding: 14px;
  }

  .stat-card {
    min-height: 104px;
    padding: 14px;
  }

  .stat-card strong {
    font-size: 1.55rem;
  }

  .metadata div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .segmented,
  .demo-access,
  .top-actions,
  .form-actions,
  .filters-row {
    width: 100%;
  }

  .segmented button,
  .demo-access button,
  .top-actions button,
  .form-actions button,
  .filters-row button {
    flex: 1;
  }

  .filters-row .search-input {
    max-width: none;
  }

  .filters-row {
    justify-content: stretch;
  }

  .download-card {
    gap: 12px;
  }

  .apk-badge {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .table-wrap {
    overflow: visible;
  }

  table.responsive-table,
  .table-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(20, 34, 42, 0.07);
    overflow: hidden;
  }

  .table-wrap td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

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

  .row-action {
    width: 100%;
  }

  .logo-preview {
    align-items: stretch;
  }

  .logo-preview-box {
    width: 100%;
  }

  h2 {
    font-size: 1.55rem;
  }
}

@media (max-width: 420px) {
  .hero,
  .login-panel,
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .primary-button,
  .ghost-button,
  .row-action,
  .link-button {
    width: 100%;
    min-height: 44px;
  }

  .segmented {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 1.72rem;
  }
}
