:root {
  --background: #07111f;
  --panel: #0d1a2d;
  --panel-soft: #112239;
  --border: rgba(143, 177, 221, 0.18);
  --text: #f3f7fc;
  --muted: #91a4bd;
  --primary: #4d8ff7;
  --primary-hover: #6ba3fa;
  --success: #38c793;
  --danger: #f46e7a;
  --warning: #f5b84b;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top right, #16345f 0, transparent 35%),
    var(--background);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(460px, 100%);
  padding: 42px;
  background: rgba(13, 26, 45, 0.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #4d8ff7, #7a65f5);
  font-size: 27px;
  font-weight: 800;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 20px;
}

.eyebrow {
  margin: 25px 0 6px;
  color: #72a8fb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.login-card h1,
.topbar h1 {
  margin: 0;
}

.login-description {
  margin: 14px 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin: 16px 0 7px;
  color: #c8d5e7;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #091524;
  color: var(--text);
}

input:focus {
  border-color: var(--primary);
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 10px;
  font-weight: 750;
}

.primary-button {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: var(--primary);
  color: white;
}

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

.secondary-button {
  padding: 10px 15px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
}

.error-message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.back-link,
.site-link {
  color: var(--muted);
  text-decoration: none;
}

.back-link {
  display: block;
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  background: rgba(8, 19, 33, 0.98);
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 26px;
}

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

.sidebar-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.navigation {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-soft);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
  padding: 18px 8px 4px;
}

.logout-button {
  padding: 10px 12px;
  border: 1px solid rgba(244, 110, 122, 0.35);
  border-radius: 9px;
  background: transparent;
  color: #ff9ba4;
}

.main-content {
  min-width: 0;
  padding: 32px;
}

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

.topbar .eyebrow {
  margin: 0 0 5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-email {
  color: var(--muted);
  font-size: 13px;
}

.summary-grid,
.platform-grid,
.health-grid {
  display: grid;
  gap: 18px;
}

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

.summary-card,
.platform-card,
.data-panel,
.health-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(13, 26, 45, 0.94);
  box-shadow: 0 13px 35px rgba(0, 0, 0, 0.16);
}

.summary-card {
  padding: 20px;
}

.summary-card span,
.metric-row span {
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  display: block;
  margin: 10px 0 5px;
  font-size: 30px;
}

.summary-card small {
  color: #7186a1;
}

.platform-grid {
  margin-top: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.platform-card {
  padding: 22px;
}

.platform-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.platform-label {
  margin: 0 0 7px;
  color: #72a8fb;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.platform-card h2 {
  margin: 0;
  font-size: 19px;
}

.status-badge {
  padding: 6px 9px;
  border-radius: 100px;
  background: rgba(245, 184, 75, 0.13);
  color: var(--warning);
  font-size: 11px;
  font-weight: 800;
}

.status-badge.healthy {
  background: rgba(56, 199, 147, 0.13);
  color: var(--success);
}

.status-badge.unhealthy {
  background: rgba(244, 110, 122, 0.13);
  color: var(--danger);
}

.metric-row {
  margin: 24px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.metric-row strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #7eb2ff;
  font-weight: 750;
}

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

.section-heading h2 {
  margin: 0 0 5px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.search-area {
  display: flex;
  gap: 9px;
}

.search-area input {
  min-width: 260px;
}

.data-panel {
  margin-bottom: 18px;
  padding: 20px;
}

.data-panel h3 {
  margin: 0 0 15px;
}

.table-container {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  color: #8499b3;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #d4dfed;
}

.empty-state {
  padding: 25px 4px;
  color: var(--muted);
}

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

.health-card {
  padding: 22px;
}

.health-card h3 {
  margin: 0;
}

.health-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.global-message {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(244, 110, 122, 0.3);
  border-radius: 10px;
  background: rgba(244, 110, 122, 0.09);
  color: #ffadb4;
}

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

  .platform-grid,
  .health-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .main-content {
    padding: 22px 16px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .search-area {
    align-items: stretch;
    flex-direction: column;
  }

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

  .search-area input {
    min-width: 0;
  }
}

/* Unified administration actions and activity */

.actions-cell {
  min-width: 240px;
  white-space: normal;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-action {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
}

.admin-action:hover {
  border-color: rgba(77, 143, 247, 0.75);
}

.admin-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-action.approve,
.admin-action.enable {
  border-color: rgba(56, 199, 147, 0.35);
  color: #72ddb5;
}

.admin-action.reject,
.admin-action.disable {
  border-color: rgba(245, 184, 75, 0.35);
  color: #f8c96f;
}

.admin-action.delete {
  border-color: rgba(244, 110, 122, 0.42);
  color: #ff9ba4;
}

.admin-action.reset {
  color: #9dbef8;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.activity-note {
  margin: 5px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.activity-chart {
  width: 100%;
  min-height: 330px;
  overflow-x: auto;
}

.activity-chart svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.chart-grid {
  stroke: rgba(143, 177, 221, 0.13);
  stroke-width: 1;
}

.chart-axis-label {
  fill: #7186a1;
  font-size: 11px;
}

.chart-page-bar {
  fill: rgba(77, 143, 247, 0.6);
}

.chart-session-line {
  fill: none;
  stroke: #38c793;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-session-point {
  fill: #38c793;
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.chart-key.views {
  background: rgba(77, 143, 247, 0.7);
}

.chart-key.sessions {
  background: #38c793;
  border-radius: 100px;
}

.chart-empty {
  padding: 55px 10px;
  color: var(--muted);
  text-align: center;
}

/* Orbit unified administration controls */

.actions-cell {
  min-width: 260px;
  white-space: normal;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-action {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
}

.admin-action:hover {
  border-color: rgba(77, 143, 247, 0.75);
}

.admin-action:disabled {
  cursor: wait;
  opacity: 0.5;
}

.admin-action.approve,
.admin-action.enable {
  border-color: rgba(56, 199, 147, 0.45);
  color: #77dfb9;
}

.admin-action.reject,
.admin-action.disable {
  border-color: rgba(245, 184, 75, 0.45);
  color: #f7c76b;
}

.admin-action.delete {
  border-color: rgba(244, 110, 122, 0.48);
  color: #ff9ba4;
}

.admin-action.reset {
  color: #a9c8ff;
}

.activity-note {
  margin: 5px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.activity-chart {
  width: 100%;
  min-height: 330px;
  overflow-x: auto;
}

.activity-chart svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.chart-grid {
  stroke: rgba(143, 177, 221, 0.15);
  stroke-width: 1;
}

.chart-label {
  fill: #8297b2;
  font-size: 11px;
}

.chart-bar {
  fill: rgba(77, 143, 247, 0.68);
}

.chart-line {
  fill: none;
  stroke: #38c793;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #38c793;
}

.chart-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.chart-key.views {
  background: rgba(77, 143, 247, 0.68);
}

.chart-key.sessions {
  border-radius: 100px;
  background: #38c793;
}

/* Audit filters and Excel export */

.activity-filter-controls {
  display: grid;
  grid-template-columns:
    minmax(230px, 2fr)
    minmax(145px, 1fr)
    minmax(140px, 1fr)
    minmax(140px, 1fr);
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid rgba(124, 159, 205, 0.18);
  border-radius: 12px;
  background: rgba(14, 31, 52, 0.58);
}

.activity-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-filter-field label {
  color: #8ea3be;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.activity-filter-field input,
.activity-filter-field select {
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid rgba(124, 159, 205, 0.25);
  border-radius: 8px;
  background: rgba(5, 17, 31, 0.82);
  color: #e9f2ff;
}

.activity-filter-buttons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-filter-result {
  grid-column: 1 / -1;
  color: #8ea3be;
  font-size: 12px;
}

.admin-action.export {
  border-color: rgba(56, 199, 147, 0.45);
  background: rgba(56, 199, 147, 0.1);
  color: #78e0ba;
}

@media (max-width: 900px) {
  .activity-filter-controls {
    grid-template-columns: 1fr;
  }

  .activity-filter-buttons,
  .activity-filter-result {
    grid-column: 1;
  }
}
