@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-gradient: radial-gradient(circle at 10% 15%, rgba(183, 156, 255, 0.06) 0%, transparent 45%),
                 radial-gradient(circle at 90% 85%, rgba(105, 216, 255, 0.06) 0%, transparent 45%),
                 #eef2f6;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-hover: rgba(255, 255, 255, 0.95);
  --panel-border: rgba(9, 10, 20, 0.08);
  --panel-border-focus: rgba(124, 58, 237, 0.25);
  --line: rgba(9, 10, 20, 0.05);
  --line-strong: rgba(9, 10, 20, 0.1);
  --text: #334155;
  --muted: #64748b;
  --accent: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --accent-strong: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.08);
  --ink-soft: rgba(255, 255, 255, 0.6);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.06);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.06);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.06);
  --shadow: 0 10px 30px rgba(9, 10, 20, 0.04);
  --focus: 0 0 0 3px rgba(124, 58, 237, 0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(9, 10, 20, 0.01);
}
::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(9, 10, 20, 0.08);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(9, 10, 20, 0.16);
}

/* Typography elements */
h1, h2, h3, h4, .brand-mark, .nav-item span, .primary-button {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

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

button {
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

button:disabled, input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

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

/* Sidebar navigation */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 500;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  color: #1e293b;
}

.brand p {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
}

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

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 8px 10px;
  color: var(--muted);
  text-align: left;
}

.nav-item span {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  transition: color 0.2s ease;
}

.nav-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.nav-item:hover {
  background: rgba(9, 10, 20, 0.02);
}

.nav-item.active {
  border-color: rgba(124, 58, 237, 0.12);
  background: var(--accent-soft);
}

.nav-item.active span {
  color: var(--accent-strong);
}

.nav-item.active small {
  color: rgba(9, 10, 20, 0.45);
}

.session-box {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.session-label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.session-email {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--text);
}

/* Main Area Layout */
.main {
  min-width: 0;
  padding: 28px;
}

/* Login Panel */
.login-panel {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(9, 10, 20, 0.05);
  padding: 32px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
  color: #1e293b;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px 14px;
  color: var(--text);
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: var(--focus);
  background: #ffffff;
}

input::placeholder, textarea::placeholder {
  color: rgba(9, 10, 20, 0.35);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

/* Buttons style */
.primary-button, .secondary-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.primary-button {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ghost-button {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(9, 10, 20, 0.02);
  color: var(--text);
}

/* Topbar content header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  color: #1e293b;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.status-line {
  min-height: 24px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.view-description {
  max-width: 760px;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* Panels, cards & layout grids */
.grid {
  display: grid;
  gap: 12px;
}

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

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

.metric, .panel, .detail-panel {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.metric:hover, .panel:hover, .detail-panel:hover {
  border-color: var(--panel-border-focus);
  box-shadow: 0 8px 24px rgba(9, 10, 20, 0.05);
}

.metric {
  padding: 12px 14px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.metric .value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.panel, .detail-panel {
  padding: 16px 18px;
}

.panel h3, .detail-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 200px auto;
  gap: 12px;
  margin-bottom: 20px;
}

/* Responsive tables */
.table-wrap {
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: rgba(9, 10, 20, 0.015);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: rgba(9, 10, 20, 0.015);
}

.link-button {
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 500;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.link-button:hover {
  color: #7c3aed;
}

/* Pagination Controls */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pagination span {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.pagination button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* Status Pill classes */
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 10px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pill.ok {
  border-color: rgba(5, 150, 105, 0.2);
  background: var(--ok-soft);
  color: var(--ok);
}

.pill.warn {
  border-color: rgba(217, 119, 6, 0.2);
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.danger {
  border-color: rgba(220, 38, 38, 0.2);
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.info {
  border-color: rgba(79, 70, 229, 0.2);
  background: rgba(79, 70, 229, 0.06);
  color: #4f46e5;
}

.attention-panel {
  overflow: hidden;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.attention-card {
  display: grid;
  gap: 10px;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 16px;
}

.attention-card.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: var(--danger-soft);
}

.attention-card.warn {
  border-color: rgba(217, 119, 6, 0.22);
  background: var(--warning-soft);
}

.attention-card.info {
  border-color: rgba(79, 70, 229, 0.18);
  background: rgba(79, 70, 229, 0.05);
}

.attention-card.ok {
  border-color: rgba(5, 150, 105, 0.2);
  background: var(--ok-soft);
}

.attention-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attention-card-top strong {
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.attention-card h4 {
  margin: 0;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.attention-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.error-text {
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

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

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

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(9, 10, 20, 0.15);
  border-radius: 50%;
  background: rgba(9, 10, 20, 0.03);
  color: #4f46e5;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  cursor: help;
  transition: var(--transition);
  margin-left: 6px;
  vertical-align: middle;
}

.tooltip:hover, .tooltip:focus-visible {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.15);
}

.tooltip::after {
  position: absolute;
  z-index: 99;
  bottom: calc(100% + 10px);
  left: 50%;
  width: 240px;
  border: 1px solid var(--panel-border-focus);
  border-radius: 8px;
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 10px 25px rgba(9, 10, 20, 0.05);
  content: attr(data-tip);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  padding: 10px 12px;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tooltip:hover::after, .tooltip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chart display style */
.chart-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px minmax(80px, 1fr) 60px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--accent);
}

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(9, 10, 20, 0.04);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7c3aed 0%, #4f46e5 100%);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.12);
}

.hidden {
  display: none !important;
}

/* Responsive query adjustments */
@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

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

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .metrics-grid, .two-col, .form-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .main, .sidebar {
    padding: 16px;
  }

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

  .metric .value {
    font-size: 26px;
  }
}

/* Articles View Styling */
.article-actions {
  display: flex;
  gap: 8px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: var(--danger);
  transition: var(--transition);
}

.danger-button:hover:not(:disabled) {
  background: var(--danger);
  color: #ffffff;
}

.edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 58, 237, 0.15);
  color: var(--accent-strong);
  transition: var(--transition);
}

.edit-button:hover:not(:disabled) {
  background: var(--accent-strong);
  color: #ffffff;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.article-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.article-card:hover {
  border-color: var(--panel-border-focus);
  box-shadow: 0 10px 25px rgba(9, 10, 20, 0.05);
}

.article-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-card-title {
  margin: 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.article-card-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}

@media (max-width: 1024px) {
  .editor-container {
    grid-template-columns: 1fr;
  }
}

.markdown-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--line-strong);
  border-radius: 8px 8px 0 0;
  padding: 6px 10px;
  border-bottom: 0;
}

.toolbar-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

.toolbar-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.markdown-textarea {
  border-radius: 0 0 10px 10px;
  min-height: 420px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
}

/* App Dark-Mystical Live Preview style */
.app-preview-pane {
  background: #05060d; /* Dark mystical theme bg */
  border: 1px solid #1c1d2e;
  border-radius: 12px;
  padding: 24px;
  color: #f8f7ff;
  max-height: 520px;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  font-family: 'Be Vietnam Pro', sans-serif;
}

.app-preview-eyebrow {
  color: #c9a7ff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.app-preview-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 12px;
  line-height: 1.25;
}

.app-preview-lead {
  font-size: 15px;
  line-height: 1.5;
  color: #a5a6c4;
  margin-bottom: 20px;
  font-weight: 400;
}

.app-preview-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.app-preview-meta-tag {
  background: rgba(201, 167, 255, 0.08);
  border: 1px solid rgba(201, 167, 255, 0.16);
  color: #c9a7ff;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
}

.app-preview-divider {
  height: 1px;
  background: rgba(248, 247, 255, 0.08);
  margin: 20px 0;
}

.app-preview-section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  margin: 24px 0 10px;
}

.app-preview-paragraph {
  font-size: 15px;
  line-height: 1.7;
  color: #a5a6c4;
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.app-preview-paragraph strong, 
.app-preview-bullet-item strong {
  font-weight: 700;
  color: #f8f7ff;
}

.app-preview-paragraph em, 
.app-preview-bullet-item em {
  font-style: italic;
  color: #d1d2e8;
}

.app-preview-bullet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 20px;
  padding-left: 4px;
}

.app-preview-bullet-item {
  display: flex;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: #a5a6c4;
}

.app-preview-bullet-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe5a8;
  margin-top: 10px;
  flex-shrink: 0;
}

.app-preview-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  max-width: 320px;
  aspect-ratio: 1.5;
  border-radius: 12px;
  border: 1px solid rgba(248, 247, 255, 0.12);
  background: rgba(248, 247, 255, 0.04);
  overflow: hidden;
}

.app-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* System Status Styles */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  transition: var(--transition);
}

.status-card:hover {
  border-color: var(--panel-border-focus);
  transform: translateY(-2px);
}

.status-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-icon-glow {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.status-icon-glow.ok {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.status-icon-glow.warn {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}

.status-icon-glow.danger {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.status-icon-glow.checking {
  background: #64748b;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.status-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.status-url {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  max-width: 320px;
}

.terminal-box {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  color: #a6e3a1;
  font-size: 13px;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
  margin-top: 14px;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #cdd6f4;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #f38ba8; }
.terminal-dot.yellow { background: #f9e2af; }
.terminal-dot.green { background: #a6e3a1; }

.terminal-line {
  margin-bottom: 4px;
  word-break: break-all;
}

.terminal-line.info { color: #89b4fa; }
.terminal-line.success { color: #a6e3a1; }
.terminal-line.warn { color: #f9e2af; }
.terminal-line.error { color: #f38ba8; }

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #a6e3a1;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes blink {
  from, to { background-color: transparent }
  50% { background-color: #a6e3a1 }
}

/* Modal Popup Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 10, 20, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: min(1000px, 95vw);
  max-height: 85vh;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(9, 10, 20, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 58, 237, 0.12);
  color: var(--accent-strong);
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
}

.row-action-btn:hover {
  background: var(--accent-strong);
  color: #ffffff;
}

/* User Detail Modal Layout */
.user-detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 14px;
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-field .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.detail-field .value {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

.detail-field .value.select-all {
  user-select: all;
}

.detail-field .valueHighlight {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.detail-field .valueHighlight.ok {
  color: var(--ok);
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--line-strong);
  gap: 8px;
  overflow-x: auto;
}

.detail-tab-btn {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: var(--transition);
}

.detail-tab-btn:hover {
  color: var(--accent);
}

.detail-tab-btn.active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
  font-weight: 600;
}

.detail-tab-content {
  display: none;
}

.detail-tab-content.active {
  display: block;
}

@media (max-width: 800px) {
  .user-detail-layout {
    grid-template-columns: 1fr;
  }
}
