:root {
  --bg-primary: #0a0d12;
  --bg-secondary: #131822;
  --bg-tertiary: #1c2333;
  --bg-card: #151b27;
  --border-color: #263042;
  --border-focus: #58a6ff;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-sub: #a3b1c2;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --success: #2ea043;
  --success-bg: rgba(46, 160, 67, 0.15);
  --warning: #d29922;
  --warning-bg: rgba(210, 153, 34, 0.15);
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.15);
  --sovereign-green: #006847;
  --sovereign-red: #ce1126;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --touch-target: 48px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  padding-bottom: 5rem; /* Room for mobile bottom bar */
  position: relative;
}

/* Header */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sovereign-green) 0%, #153826 50%, var(--sovereign-red) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.status-badge {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  color: var(--text-main);
}

.superadmin-badge {
  cursor: pointer;
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  transition: all 0.2s;
}

.superadmin-badge:hover {
  background: rgba(88, 166, 255, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-blue { background-color: var(--accent); }
.dot-orange { background-color: var(--warning); }

/* Super Admin Active Banner */
.superadmin-banner {
  background: linear-gradient(90deg, #581c87 0%, #1e1b4b 100%);
  border-bottom: 1px solid #9333ea;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
}

.banner-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Main Container */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 1.25rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

.tab-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.metric-card .title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.metric-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.25rem 0;
  color: var(--text-main);
}

.metric-card .sub {
  font-size: 0.72rem;
  color: var(--accent);
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

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

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
}

.search-input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 1rem; /* >= 16px to prevent iOS zoom */
  width: 100%;
}

.btn {
  background-color: var(--accent);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.65rem 1.25rem;
  min-height: var(--touch-target);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s, transform 0.1s;
  text-decoration: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #273042;
}

.btn-success {
  background-color: var(--success);
}

.btn-success:hover {
  background-color: #268937;
}

.btn-warning {
  background-color: var(--warning);
  color: #000;
}

.btn-warning:hover {
  background-color: #b8851c;
}

.btn-danger {
  background-color: var(--danger);
}

.btn-danger:hover {
  background-color: #da3633;
}

.btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-lg {
  min-height: 52px;
  font-size: 1.05rem;
  padding: 0.8rem 1.5rem;
}

/* Pills */
.pill {
  padding: 0.3rem 0.65rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.pill-active {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(46, 160, 67, 0.4);
}

.pill-init {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(210, 153, 34, 0.4);
}

.pill-tier {
  background-color: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

/* Desktop Table Card */
.table-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}

tr:hover td {
  background-color: rgba(255,255,255,0.02);
}

.tenant-cell-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tenant-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* MOBILE CARDS VIEW (SMARTPHONES) */
.mobile-cards-container {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.mobile-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mobile-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mobile-card-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.mobile-card-title {
  flex: 1;
}

.mobile-card-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.mobile-card-title .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mobile-card-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Quota Meter */
.quota-meter-box {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meter-header strong {
  color: var(--text-main);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  border-radius: 4px;
}

/* Mobile Card Action Grid (Thumb Friendly Touch Targets >= 48px) */
.mobile-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.mobile-card-actions .btn {
  width: 100%;
  padding: 0.65rem 0.5rem;
  font-size: 0.88rem;
}

.btn-access {
  grid-column: span 2;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  font-size: 1rem;
}

/* Forms */
.form-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 1.25rem;
}

.form-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.preset-badge-box {
  background: linear-gradient(135deg, rgba(0, 104, 71, 0.2) 0%, rgba(206, 17, 38, 0.1) 100%);
  border: 1px solid rgba(0, 104, 71, 0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.preset-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
  font-size: 0.8rem;
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-group.full-width {
  grid-column: span 2;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
}

input[type="text"], input[type="email"], input[type="number"], input[type="password"], select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 1rem; /* Prevents auto-zoom on mobile */
  transition: border-color 0.2s;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Logo Selector */
.logo-selector-container {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo-preview-box {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.logo-input-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.logo-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.25rem 0.5rem;
  border-radius: 14px;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-chip:hover {
  background: #2a3447;
  border-color: var(--accent);
}

/* Radio Cards (IDM Selection & Office Suite) */
.radio-cards-grid, .idm-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.radio-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.9rem;
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  transition: all 0.2s;
  min-width: 0;
  box-sizing: border-box;
}

.radio-card input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.radio-card-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.radio-card.active {
  border-color: var(--accent);
  background-color: rgba(88, 166, 255, 0.08);
}

.radio-card-body strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.radio-card-body p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Bidirectional Storage Controller */
.storage-controller-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.controller-title h4 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.controller-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.slider-row {
  margin-bottom: 1.25rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.input-unit-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-unit-group input {
  width: 90px;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
}

.unit-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
}

.storage-summary-badge {
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.4);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #86efac;
}

/* Quote Box */
.quote-box {
  background: linear-gradient(180deg, #182234 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quote-tier-title {
  font-size: 1rem;
  color: var(--accent);
}

.quote-sla-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.quote-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.quote-total {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--success);
}

.quote-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  font-size: 0.82rem;
}

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

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

/* Chips Cloud (Groups and Apps) */
.chips-cloud {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.65rem;
  border-radius: 14px;
  font-size: 0.78rem;
  color: var(--text-main);
}

.chip-group {
  border-color: rgba(88, 166, 255, 0.4);
  color: #93c5fd;
}

.chip-app {
  border-color: rgba(46, 160, 67, 0.4);
  color: #86efac;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}

.detail-section {
  margin-bottom: 1.25rem;
}

.detail-section h4 {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.creds-card {
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(46, 160, 67, 0.4);
  padding: 0.9rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.creds-actions {
  display: flex;
  gap: 0.5rem;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Governance / Super Admin */
.governance-rules-card {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.governance-rules-card h4 {
  color: var(--warning);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.governance-rules-card ul {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.governance-rules-card li {
  margin-bottom: 0.35rem;
}

.superadmin-controls-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.key-input-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.key-input-row input {
  flex: 1;
  min-width: 250px;
}

.unlocked-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.quarantine-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quarantine-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quarantine-info strong {
  display: block;
  font-size: 0.95rem;
}

.quarantine-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Terminal output */
.terminal-output {
  background-color: #000;
  color: #39ff14;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.9rem;
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid #333;
}

/* MOBILE BOTTOM BAR (FIXED FOR SMARTPHONES) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.75rem;
  min-height: var(--touch-target);
  cursor: pointer;
  transition: color 0.15s;
}

.nav-item .nav-icon {
  font-size: 1.25rem;
}

.nav-item .nav-label {
  font-size: 0.7rem;
  font-weight: 600;
}

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

/* Helpers */
.desktop-only { display: block; }
.mobile-only { display: none; }
.text-success { color: var(--success); }

/* ==============================================================================
   QUICK PRESET CHIPS & SCALE CONTROLS
   ============================================================================== */
.chips-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.chip-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chip-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent);
  color: var(--text-main);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Scale Tier Banner */
.scale-tier-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}

.tier-pill {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--sovereign-green) 0%, #153826 60%, var(--accent) 100%);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  letter-spacing: -0.01em;
}

.tier-stats {
  font-size: 0.88rem;
  font-weight: 700;
  color: #7dd3fc;
}

/* ==============================================================================
   HARDWARE SIZING CALCULATOR STYLES
   ============================================================================== */
.hardware-results-container {
  background: linear-gradient(180deg, #151d2c 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.hardware-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(88, 166, 255, 0.2);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.concurrency-badge {
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid var(--accent);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.concurrency-badge strong {
  color: var(--accent-hover);
  font-size: 0.95rem;
}

.hardware-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.hw-spec-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.hw-spec-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Color thematic accents on cards */
.card-compute {
  border-top: 3px solid #f59e0b;
}
.card-compute .hw-spec-main {
  color: #fcd34d;
}

.card-memory {
  border-top: 3px solid #a855f7;
}
.card-memory .hw-spec-main {
  color: #d8b4fe;
}

.card-storage {
  border-top: 3px solid #10b981;
}
.card-storage .hw-spec-main {
  color: #6ee7b7;
}

.card-network {
  border-top: 3px solid #06b6d4;
}
.card-network .hw-spec-main {
  color: #67e8f9;
}

.hw-spec-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.hw-spec-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hw-spec-main {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.hw-spec-sub {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.hw-spec-details {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.65rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.hw-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.hw-detail-row span {
  color: var(--text-muted);
}

.hw-detail-row strong {
  color: var(--text-sub);
  text-align: right;
}

.deployment-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.deployment-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
}

.dep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
}

.dep-header h4 {
  font-size: 0.95rem;
  color: var(--text-main);
}

.dep-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.dep-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

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

.dep-row strong {
  color: var(--text-main);
  text-align: right;
}

.hw-breakdown-card {
  background: rgba(22, 27, 34, 0.75);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
}

/* ==============================================================================
   RESPONSIVE DESIGN (BREAKPOINTS)
   ============================================================================== */
@media (min-width: 769px) and (max-width: 1100px) {
  .hardware-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
  .deployment-comparison-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  .mobile-cards-container {
    display: flex;
  }

  header {
    padding: 0.5rem 0.75rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
  }

  .brand-container {
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .brand-text {
    min-width: 0;
    overflow: hidden;
  }

  .brand-text h1 {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-text p {
    display: none !important;
  }

  .header-status {
    flex-shrink: 0;
    margin-left: auto;
  }

  .status-k8s, .status-engine {
    display: none !important;
  }

  .superadmin-badge {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .container {
    margin: 0.5rem auto;
    padding: 0 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Compact top telemetry on mobile so it doesn't push down the screen */
  .metrics-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
  }

  .metric-card {
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
  }

  .metric-card .title {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
  }

  .metric-card .value {
    font-size: 1.1rem;
    font-weight: 800;
  }

  .metric-card .sub {
    display: none; /* Hide verbose subtitle to preserve mobile vertical viewport */
  }

  /* Action Bar on Mobile */
  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
  }

  .search-box {
    width: 100%;
    min-width: 0;
  }

  .search-input {
    width: 100%;
    box-sizing: border-box;
  }

  .action-buttons {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .action-buttons .btn {
    flex: 1;
    padding: 0.55rem 0.5rem;
    font-size: 0.84rem;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  /* Forms & Provisioning */
  .form-card {
    padding: 0.85rem;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .form-group {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .preset-grid {
    grid-template-columns: 1fr !important;
    gap: 0.4rem;
    width: 100%;
  }

  .logo-selector-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
  }

  .logo-preview-box {
    margin: 0 auto;
  }

  .logo-input-box {
    width: 100%;
    min-width: 0;
  }

  .logo-presets {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .radio-cards-grid, .idm-type-selector {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
    width: 100%;
  }

  .radio-card {
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  .radio-card-body strong {
    font-size: 0.85rem;
  }

  .radio-card-body p {
    font-size: 0.72rem;
  }

  .storage-controller-box {
    padding: 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }

  .slider-header {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .input-unit-group input {
    width: 105px !important;
  }

  /* Cotizador Quote Box */
  .quote-box {
    padding: 0.85rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .quote-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .quote-amount-right {
    margin-top: 0.25rem;
  }

  .quote-breakdown {
    grid-template-columns: 1fr !important;
    gap: 0.6rem;
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .form-actions .btn {
    width: 100%;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    padding: 0.75rem 0.5rem;
  }

  /* Hardware Calculator */
  .scale-tier-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    gap: 0.35rem;
    width: 100%;
    box-sizing: border-box;
  }

  .tier-pill {
    font-size: 0.82rem;
    padding: 0.25rem 0.7rem;
  }

  .tier-stats {
    font-size: 0.78rem;
  }

  .hardware-summary-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .concurrency-badge {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 0.45rem 0.65rem;
    flex-wrap: wrap;
  }

  .concurrency-badge strong {
    font-size: 0.85rem;
  }

  .quick-preset-chips {
    gap: 0.3rem;
  }

  .chip-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.55rem;
  }

  .hardware-results-container {
    padding: 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hardware-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
    width: 100%;
  }

  .deployment-comparison-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
    width: 100%;
  }

  .hw-spec-card {
    padding: 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hw-spec-main {
    font-size: 1.25rem;
  }

  .hw-detail-row {
    font-size: 0.75rem;
  }

  .modal-content {
    padding: 0.85rem;
    max-height: 95vh;
    width: 95%;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  /* Fixed mobile bottom bar with safe area */
  .mobile-bottom-nav {
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-bottom-nav .nav-item {
    padding: 0.3rem 0.15rem;
  }

  .mobile-bottom-nav .nav-icon {
    font-size: 1.15rem;
  }

  .mobile-bottom-nav .nav-label {
    font-size: 0.62rem;
    font-weight: 600;
  }
}
