/* Dalmia Computers — Sovereign Enterprise Portals (Violet Orbit Miracle Final Theme)
 * Shared across /portal/, /service-desk/, and /qa-cockpit/.
 * Palette: #070a26 canvas, #101842 surface, #933cff violet, #16ddff cyan, #e8c280 champagne gold.
 * WCAG 2.1 AA verified (>= 4.5:1 contrast across all text & Senior Large-Print Mode).
 */
:root {
  --bg-primary: #070a26;
  --bg-surface: #101842;
  --bg-elevated: #172358;
  --text-primary: #f6f4ff;
  --text-secondary: #c8d5f5;
  --accent-violet: #933cff;
  --accent-violet-deep: #6d1feb;
  --accent-gold: #e8c280;
  --accent-cyan: #16ddff;
  --accent-green: #34d399;
  --accent-danger: #ff7b8b;
  --border-subtle: rgba(141, 135, 244, 0.38);
  --font-base: 16px;
}

body[data-senior-mode="true"],
html body.dalmia-prime[data-senior-mode="true"] {
  --bg-primary: #030515;
  --bg-surface: #0b1130;
  --bg-elevated: #141f4d;
  --text-primary: #ffffff;
  --text-secondary: #eef4ff;
  --accent-gold: #ffe08a;
  --accent-cyan: #5cecff;
  --border-subtle: rgba(196, 192, 255, 0.72);
  --font-base: 20px;
}

* { box-sizing: border-box; }

html,
body,
html body.dalmia-prime,
html body.sovereign-violet {
  margin: 0 !important;
  padding: 0 !important;
  background:
    radial-gradient(ellipse at 14% 12%, rgba(147, 60, 255, 0.24), transparent 36%),
    radial-gradient(ellipse at 86% 24%, rgba(22, 221, 255, 0.14), transparent 32%),
    var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  font-size: var(--font-base) !important;
  line-height: 1.6 !important;
  color-scheme: dark;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent-gold);
  color: #070a26;
  padding: 12px 18px;
  font-weight: 800;
  border-radius: 10px;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { left: 12px; }

html body .top-bar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(7, 10, 38, 0.94) !important;
  border-bottom: 1px solid rgba(157, 120, 255, 0.42) !important;
  box-shadow: 0 14px 36px rgba(3, 5, 22, 0.52);
  backdrop-filter: blur(16px);
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: contain;
  background: #ffffff;
  padding: 3px;
  border: 1px solid rgba(162, 146, 255, 0.72);
  box-shadow: 0 0 16px rgba(22, 221, 255, 0.24);
  flex-shrink: 0;
}

.brand-badge {
  background: linear-gradient(120deg, #7827ec, #933cff);
  color: #ffffff;
  border: 1px solid #c794ff;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  box-shadow: 0 0 16px rgba(147, 60, 255, 0.35);
}

/* Harmonize shell-injected category ribbon with Violet Orbit */
html body nav.dp-category-ribbon {
  background: rgba(11, 16, 48, 0.92) !important;
  border-bottom: 1px solid rgba(141, 135, 244, 0.28) !important;
  padding: 6px 20px !important;
}

html body nav.dp-category-ribbon .dp-category-ribbon__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  align-items: center;
}

html body nav.dp-category-ribbon a {
  color: #dce6ff !important;
  font-size: 0.82rem !important;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 8px;
}

html body nav.dp-category-ribbon a:hover {
  color: var(--accent-cyan) !important;
  background: rgba(147, 60, 255, 0.18);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

html body .nav-links a,
html body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(23, 35, 88, 0.88);
  color: var(--text-primary) !important;
  font-size: 0.92rem;
  transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

html body .nav-links a:hover,
html body .btn:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
  filter: brightness(1.08);
}

html body .nav-links a.nav-command {
  background: linear-gradient(120deg, rgba(147, 60, 255, 0.36), rgba(22, 221, 255, 0.2));
  border-color: rgba(22, 221, 255, 0.6);
}

.nav-links a:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-cyan) !important;
  outline-offset: 2px !important;
}

html body .btn-primary {
  background: linear-gradient(105deg, #7827ec 0%, #933cff 54%, #6d1feb 100%) !important;
  color: #ffffff !important;
  border-color: #c794ff !important;
  box-shadow: 0 0 20px rgba(147, 60, 255, 0.36);
}

html body .btn-secondary {
  background: linear-gradient(110deg, #092c5e, #0c224d) !important;
  color: #84f2ff !important;
  border-color: var(--accent-cyan) !important;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

html body .hero-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 82% 20%, rgba(147, 60, 255, 0.38), transparent 46%),
    linear-gradient(130deg, #0b1442 0%, #131e56 54%, #091538 100%) !important;
  border: 1px solid rgba(157, 134, 255, 0.45) !important;
  border-radius: 22px;
  padding: 30px;
  margin-bottom: 28px;
  box-shadow: 0 22px 54px rgba(3, 5, 22, 0.48);
}

html body .hero-card h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3.2vw, 2.45rem) !important;
  line-height: 1.16 !important;
  color: #ffffff !important;
}

.subtitle {
  color: var(--text-secondary) !important;
  margin: 0 0 16px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  background: rgba(7, 13, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.pill-qa { border-color: var(--accent-gold); color: var(--accent-gold); }
.pill-green { border-color: var(--accent-green); color: var(--accent-green); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

html body .card {
  background: linear-gradient(140deg, rgba(20, 29, 78, 0.96), rgba(11, 20, 54, 0.97)) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

html body .card h2 {
  margin-top: 0;
  font-size: 1.28rem !important;
  color: #ffffff !important;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

html body .card h3 {
  margin-top: 16px;
  font-size: 1.06rem !important;
  color: var(--accent-gold) !important;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary) !important;
}

html body .field input,
html body .field select,
html body .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(154, 168, 242, 0.55) !important;
  background: #080e2c !important;
  color: #ffffff !important;
  font-size: 1rem;
  font-family: inherit;
}

.field textarea { min-height: 88px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--accent-violet);
}

.result-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #060b24;
  border: 1px solid rgba(124, 152, 240, 0.42);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: #e8efff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: linear-gradient(145deg, rgba(22, 32, 86, 0.95), rgba(11, 19, 52, 0.96));
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px;
}

.kpi-label { color: var(--text-secondary); font-size: 0.88rem; font-weight: 600; }
.kpi-val { font-size: 1.7rem; font-weight: 800; color: var(--accent-gold); margin-top: 4px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table th {
  color: var(--accent-gold);
  font-weight: 800;
}

.footer-bar {
  border-top: 1px solid rgba(147, 60, 255, 0.45);
  background: #050920;
  padding: 26px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.footer-bar a {
  color: var(--accent-cyan) !important;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  html body .top-bar {
    padding: 12px 16px;
  }
}
