/**
 * aios-shell.css  v2.0
 * ─────────────────────────────────────────────────────────────────────────────
 * AI OS Mandatory Shell Framework — macOS / iOS Inspired
 *
 * Like macOS/iOS, this defines the immutable OS chrome that every app runs
 * inside. No app may override these zones.
 *
 * Reserved zones:
 *   TOP-RIGHT     Quick-actions bar (shared-quick-links) — theme, account, logout
 *   BOTTOM-LEFT   OS logo + version badge
 *   BOTTOM-RIGHT  Help system button (help-system.js)
 *   CENTER        App viewport — all app content renders inside .aios-viewport
 *
 * v2.0 additions:
 *   - Glass morphism (backdrop-filter: blur) on cards, toasts, modals
 *   - Spring animations (bouncy enter, scale hover)
 *   - Modal / sheet system (.aios-modal-overlay, .aios-modal)
 *   - Dropdown menus (.aios-dropdown)
 *   - Form validation states (.aios-input.invalid, .aios-field-error)
 *   - Toolbar component (.aios-toolbar)
 *   - Smooth theme transition (*, body transition on theme swap)
 *   - Button states (loading, disabled, sm/lg sizes, ghost, icon-only)
 *   - Chip / tag component (.aios-chip)
 *   - Spacing & typography utility classes
 *   - Background system (.aios-bg — standard gradient)
 *
 * Loaded AFTER base.css and shared-menu.css.
 */

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Smooth Theme Transitions                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* When theme changes, everything transitions smoothly (macOS-style) */
:root {
  --aios-transition-theme: background 0.35s ease, color 0.35s ease,
    border-color 0.35s ease, box-shadow 0.35s ease;
}

:root.theme-transitioning,
:root.theme-transitioning *,
:root.theme-transitioning *::before,
:root.theme-transitioning *::after {
  transition: var(--aios-transition-theme) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Standard Background — Use on <body> or .aios-bg                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    #0b1224;
  min-height: 100vh;
}

:root.theme-day .aios-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    #f8fafc !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* OS Shell — Fixed Chrome                                                   */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Bottom-left: OS Logo + Version ──────────────────────────────────────── */
#aios-shell-logo {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9997;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#aios-shell-logo:hover {
  opacity: 1;
  transform: scale(1.05);
}

#aios-shell-logo img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

#aios-shell-logo .aios-version {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
}

:root.theme-day #aios-shell-logo .aios-version {
  color: #94a3b8 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* App Viewport — The Only Area Where App Content May Render                 */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-viewport {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 80px;    /* bottom padding for logo/help clearance */
  min-height: calc(100vh - 72px); /* subtract top quick-links bar */
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Card System — Glass Morphism                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

/*
 * Every app module, settings panel, data table, form, or content block
 * must render inside an .aios-card. Glass morphism gives the macOS feel.
 */

.aios-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(9, 14, 28, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.aios-card:hover {
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Clickable card variant — lifts on hover like iOS cards */
.aios-card.clickable {
  cursor: pointer;
}

.aios-card.clickable:hover {
  transform: translateY(-2px);
}

.aios-card.clickable:active {
  transform: translateY(0) scale(0.995);
  transition-duration: 0.08s;
}

/* ── Card Header ─────────────────────────────────────────────────────────── */
.aios-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.aios-card-header h1,
.aios-card-header h2,
.aios-card-header h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #e5e7eb, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aios-card-header h1 { font-size: 1.5rem; }
.aios-card-header h2 { font-size: 1.25rem; }
.aios-card-header h3 { font-size: 1.1rem; }

.aios-card-header .aios-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ── Card Body ───────────────────────────────────────────────────────────── */
.aios-card-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* ── Card Footer ─────────────────────────────────────────────────────────── */
.aios-card-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Card Variants                                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Compact card — tighter padding for dense content */
.aios-card.compact .aios-card-header { padding: 14px 18px; }
.aios-card.compact .aios-card-body   { padding: 18px; }
.aios-card.compact .aios-card-footer { padding: 12px 18px; }

/* Full-height card — stretches to fill viewport */
.aios-card.full-height {
  min-height: calc(100vh - 160px);
}

/* Transparent card — for content that needs to blend with background */
.aios-card.transparent {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Raised card — stronger shadow, more lift on hover */
.aios-card.raised {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.aios-card.raised:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Grid Layouts — For Multi-Card Pages                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-grid {
  display: grid;
  gap: 20px;
}

.aios-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.aios-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.aios-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Auto-fit responsive grid */
.aios-grid.auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Page Title — Standardized Page Header                                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-page-title {
  margin-bottom: 24px;
}

.aios-page-title h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #e5e7eb 30%, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aios-page-title .aios-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Buttons — macOS / iOS Style                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); /* spring */
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.aios-btn:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.aios-btn:disabled,
.aios-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.aios-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #f8fafc;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.aios-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.4);
}

/* Secondary */
.aios-btn-secondary {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

.aios-btn-secondary:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.45);
}

/* Danger */
.aios-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.aios-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Ghost — transparent, text-only, hover reveals */
.aios-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border-color: transparent;
}

.aios-btn-ghost:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

/* Success */
.aios-btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.aios-btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
}

/* ── Button Sizes ─────────────────────────────────────────────────────────── */
.aios-btn.sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  gap: 6px;
}

.aios-btn.lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 12px;
  gap: 10px;
}

/* Icon-only button (square) */
.aios-btn.icon-only {
  padding: 10px;
  min-width: 40px;
}

.aios-btn.icon-only.sm { padding: 6px; min-width: 32px; }
.aios-btn.icon-only.lg { padding: 14px; min-width: 48px; }

/* Loading state for buttons */
.aios-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.aios-btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: aios-spin 0.6s linear infinite;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Form Controls — OS-Standard Input Styles                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-input,
.aios-select,
.aios-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
  color: #e5e7eb;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aios-input:focus,
.aios-select:focus,
.aios-textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.aios-textarea {
  resize: vertical;
  min-height: 100px;
}

.aios-label {
  display: block;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ── Form Validation States ──────────────────────────────────────────────── */
.aios-input.invalid,
.aios-select.invalid,
.aios-textarea.invalid {
  border-color: rgba(239, 68, 68, 0.6);
}

.aios-input.invalid:focus,
.aios-select.invalid:focus,
.aios-textarea.invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.aios-input.valid,
.aios-select.valid,
.aios-textarea.valid {
  border-color: rgba(16, 185, 129, 0.5);
}

.aios-input.valid:focus,
.aios-select.valid:focus,
.aios-textarea.valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.aios-field-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.aios-field-hint {
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ── Checkbox & Radio (macOS-style) ──────────────────────────────────────── */
.aios-checkbox,
.aios-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #cbd5e1;
  -webkit-user-select: none;
  user-select: none;
}

.aios-checkbox input,
.aios-radio input {
  accent-color: #6366f1;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ── Toggle Switch (iOS-style) ───────────────────────────────────────────── */
.aios-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.aios-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.aios-toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.25);
  transition: background 0.25s ease;
  position: relative;
  flex-shrink: 0;
}

.aios-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); /* spring */
}

.aios-toggle input:checked + .aios-toggle-track {
  background: #6366f1;
}

.aios-toggle input:checked + .aios-toggle-track::after {
  transform: translateX(20px);
}

.aios-toggle-label {
  color: #cbd5e1;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Status Indicators                                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.aios-badge.success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.aios-badge.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.aios-badge.danger  { background: rgba(239, 68, 68, 0.15);  color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.aios-badge.info    { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }

/* ── Chip / Tag ──────────────────────────────────────────────────────────── */
.aios-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  cursor: default;
  transition: all 0.15s ease;
}

.aios-chip.removable {
  cursor: pointer;
  padding-right: 8px;
}

.aios-chip .aios-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.aios-chip .aios-chip-remove:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Toolbar — Action Bar (search + filters + buttons)                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.aios-toolbar-spacer {
  flex: 1;
}

.aios-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Modal / Sheet — macOS-style                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px) saturate(0.8);
  backdrop-filter: blur(8px) saturate(0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: aios-overlayIn 0.25s ease;
  padding: 24px;
}

@keyframes aios-overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.aios-modal {
  max-width: 520px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: aios-modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* spring */
}

@keyframes aios-modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.aios-modal.wide { max-width: 720px; }
.aios-modal.narrow { max-width: 400px; }

.aios-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.aios-modal-header h2,
.aios-modal-header h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: #e5e7eb;
}

.aios-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.aios-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.aios-modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  max-height: calc(80vh - 140px);
  color: #cbd5e1;
  line-height: 1.6;
}

.aios-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Dropdown Menu                                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-dropdown {
  position: relative;
  display: inline-flex;
}

.aios-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  min-width: 180px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: none;
  animation: aios-dropdownIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aios-dropdown-menu.open {
  display: block;
}

.aios-dropdown-menu.left {
  right: auto;
  left: 0;
}

@keyframes aios-dropdownIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aios-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s ease;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.aios-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #e5e7eb;
}

.aios-dropdown-item.danger {
  color: #f87171;
}

.aios-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.aios-dropdown-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.12);
  margin: 4px 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Light Mode Overrides                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

:root.theme-day .aios-card {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

:root.theme-day .aios-card:hover {
  border-color: rgba(15, 23, 42, 0.18) !important;
}

:root.theme-day .aios-card-header {
  border-bottom-color: rgba(15, 23, 42, 0.06) !important;
}

:root.theme-day .aios-card-footer {
  border-top-color: rgba(15, 23, 42, 0.06) !important;
}

:root.theme-day .aios-card-header h1,
:root.theme-day .aios-card-header h2,
:root.theme-day .aios-card-header h3 {
  background: linear-gradient(120deg, #1e293b, #475569) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

:root.theme-day .aios-page-title h1 {
  background: linear-gradient(120deg, #0f172a 30%, #334155) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

:root.theme-day .aios-page-title .aios-subtitle {
  color: #64748b !important;
}

:root.theme-day .aios-input,
:root.theme-day .aios-select,
:root.theme-day .aios-textarea {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

:root.theme-day .aios-btn-secondary {
  background: rgba(241, 245, 249, 0.8) !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

:root.theme-day .aios-btn-ghost {
  color: #475569 !important;
}

:root.theme-day .aios-btn-ghost:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
}

:root.theme-day .aios-label {
  color: #475569 !important;
}

:root.theme-day .aios-modal {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

:root.theme-day .aios-modal-header h2,
:root.theme-day .aios-modal-header h3 {
  color: #0f172a !important;
}

:root.theme-day .aios-modal-header { border-bottom-color: rgba(15, 23, 42, 0.06) !important; }
:root.theme-day .aios-modal-footer { border-top-color: rgba(15, 23, 42, 0.06) !important; }

:root.theme-day .aios-modal-body {
  color: #334155 !important;
}

:root.theme-day .aios-modal-close {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #64748b !important;
}

:root.theme-day .aios-dropdown-menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12) !important;
}

:root.theme-day .aios-dropdown-item {
  color: #334155 !important;
}

:root.theme-day .aios-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.08) !important;
  color: #0f172a !important;
}

:root.theme-day .aios-chip {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

:root.theme-day .aios-toggle-track {
  background: #cbd5e1 !important;
}

:root.theme-day .aios-toggle-track::after {
  background: #ffffff !important;
}

:root.theme-day .aios-toggle input:checked + .aios-toggle-track {
  background: #6366f1 !important;
}

:root.theme-day .aios-field-error { color: #dc2626 !important; }
:root.theme-day .aios-field-hint  { color: #94a3b8 !important; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Animations & Transitions                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page entrance — cards fade/slide in with spring ─────────────────────── */
@keyframes aios-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes aios-springIn {
  0%   { opacity: 0; transform: translateY(16px) scale(0.97); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.005); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aios-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes aios-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.7; }
}

@keyframes aios-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Cards spring in on page load */
.aios-viewport .aios-card {
  animation: aios-springIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.aios-viewport .aios-card:nth-child(2) { animation-delay: 0.06s; }
.aios-viewport .aios-card:nth-child(3) { animation-delay: 0.12s; }
.aios-viewport .aios-card:nth-child(4) { animation-delay: 0.18s; }
.aios-viewport .aios-card:nth-child(5) { animation-delay: 0.24s; }
.aios-viewport .aios-card:nth-child(6) { animation-delay: 0.30s; }
.aios-viewport .aios-card:nth-child(7) { animation-delay: 0.36s; }
.aios-viewport .aios-card:nth-child(8) { animation-delay: 0.42s; }

/* Page title also springs in */
.aios-viewport .aios-page-title {
  animation: aios-springIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Page transition: fade out on navigate */
.aios-viewport.leaving {
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
  transform: scale(0.98);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .aios-viewport .aios-card,
  .aios-viewport .aios-page-title,
  .aios-modal,
  .aios-dropdown-menu {
    animation: none !important;
  }

  .aios-viewport.leaving {
    transition: none !important;
  }

  .aios-toggle-track::after {
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Loading States                                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Skeleton loader — shimmer placeholder for data that's loading ────── */
.aios-skeleton {
  background: linear-gradient(90deg,
    rgba(148, 163, 184, 0.08) 25%,
    rgba(148, 163, 184, 0.18) 50%,
    rgba(148, 163, 184, 0.08) 75%
  );
  background-size: 200% 100%;
  animation: aios-shimmer 1.5s ease infinite;
  border-radius: 8px;
}

.aios-skeleton.text   { height: 14px; width: 60%; margin-bottom: 8px; }
.aios-skeleton.title  { height: 22px; width: 40%; margin-bottom: 12px; }
.aios-skeleton.avatar { width: 40px; height: 40px; border-radius: 50%; }
.aios-skeleton.block  { height: 80px; width: 100%; margin-bottom: 12px; }
.aios-skeleton.image  { height: 180px; width: 100%; border-radius: 12px; }

/* ── Spinner — for action-in-progress states ─────────────────────────────── */
.aios-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: aios-spin 0.6s linear infinite;
}

.aios-spinner.lg { width: 32px; height: 32px; border-width: 3px; }

/* ── Loading overlay for cards ───────────────────────────────────────────── */
.aios-card.loading .aios-card-body {
  position: relative;
  pointer-events: none;
}

.aios-card.loading .aios-card-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 28, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 2;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.aios-empty {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
}

.aios-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.aios-empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
}

.aios-empty-hint {
  font-size: 0.85rem;
  color: #64748b;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Pagination                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}

.aios-pagination button {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.aios-pagination button:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.aios-pagination button.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: rgba(99, 102, 241, 0.5);
  color: #f8fafc;
}

.aios-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.aios-pagination .aios-page-info {
  color: #64748b;
  font-size: 0.85rem;
  padding: 0 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Pre-Configured Layouts — Ready-Made App Templates                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

/*
 * Layout presets for common app patterns. Apps pick a layout class on their
 * .aios-viewport and get a pre-configured card arrangement.
 */

/* ── List Layout: master/detail or scrollable list with sidebar ──────────── */
.aios-layout-list {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

.aios-layout-list .aios-card.sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* ── Dashboard Layout: stats ribbon + grid of cards ─────────────────────── */
.aios-layout-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.aios-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.aios-stat-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(9, 14, 28, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: aios-springIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aios-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.aios-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.aios-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #e5e7eb, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aios-stat-change {
  font-size: 0.8rem;
  font-weight: 600;
}

.aios-stat-change.up   { color: #34d399; }
.aios-stat-change.down { color: #f87171; }

/* ── Gallery Layout: image/media grid ────────────────────────────────────── */
.aios-layout-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.aios-gallery-item {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(9, 14, 28, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: aios-springIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.aios-gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  border-color: rgba(99, 102, 241, 0.4);
}

.aios-gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.aios-gallery-item .aios-gallery-caption {
  padding: 12px 14px;
}

.aios-gallery-item .aios-gallery-caption h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
}

.aios-gallery-item .aios-gallery-caption p {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
}

/* ── Form Layout: centered single-column form ────────────────────────────── */
.aios-layout-form {
  max-width: 680px;
  margin: 0 auto;
}

.aios-form-group {
  margin-bottom: 20px;
}

.aios-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Split Layout: two equal columns ─────────────────────────────────────── */
.aios-layout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Wide Layout: full-width single card (editors, terminals) ────────────── */
.aios-layout-wide {
  max-width: 100%;
}

.aios-layout-wide .aios-card {
  min-height: calc(100vh - 160px);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Data Table                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.aios-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
}

.aios-table th:hover {
  color: #a5b4fc;
}

.aios-table th .sort-icon {
  margin-left: 4px;
  opacity: 0.4;
}

.aios-table th.sorted .sort-icon {
  opacity: 1;
  color: #6366f1;
}

.aios-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
}

.aios-table tbody tr {
  transition: background 0.1s ease;
}

.aios-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* Row selected state */
.aios-table tbody tr.selected {
  background: rgba(99, 102, 241, 0.1);
}

/* ── Table toolbar (search + filters above table) ────────────────────────── */
.aios-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.aios-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.aios-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  color: #e5e7eb;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aios-search input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.aios-search::before {
  content: '\1F50D'; /* magnifying glass */
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Tabs — For Multi-Section Cards                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding: 0 24px;
  overflow-x: auto;
}

.aios-tab {
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.aios-tab:hover {
  color: #a5b4fc;
}

.aios-tab.active {
  color: #a5b4fc;
  border-bottom-color: #6366f1;
}

.aios-tab-panel {
  display: none;
}

.aios-tab-panel.active {
  display: block;
  animation: aios-fadeIn 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Notifications / Toasts — Glass                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.aios-toast {
  pointer-events: auto;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(9, 14, 28, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  animation: aios-toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes aios-toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.aios-toast.success { border-left: 3px solid #10b981; }
.aios-toast.error   { border-left: 3px solid #ef4444; }
.aios-toast.warning { border-left: 3px solid #f59e0b; }
.aios-toast.info    { border-left: 3px solid #6366f1; }

/* Toast dismiss button */
.aios-toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.aios-toast-close:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Spacing Utilities                                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-mt-0  { margin-top: 0 !important; }
.aios-mt-1  { margin-top: 4px !important; }
.aios-mt-2  { margin-top: 8px !important; }
.aios-mt-3  { margin-top: 12px !important; }
.aios-mt-4  { margin-top: 16px !important; }
.aios-mt-6  { margin-top: 24px !important; }
.aios-mt-8  { margin-top: 32px !important; }

.aios-mb-0  { margin-bottom: 0 !important; }
.aios-mb-1  { margin-bottom: 4px !important; }
.aios-mb-2  { margin-bottom: 8px !important; }
.aios-mb-3  { margin-bottom: 12px !important; }
.aios-mb-4  { margin-bottom: 16px !important; }
.aios-mb-6  { margin-bottom: 24px !important; }
.aios-mb-8  { margin-bottom: 32px !important; }

.aios-gap-1 { gap: 4px !important; }
.aios-gap-2 { gap: 8px !important; }
.aios-gap-3 { gap: 12px !important; }
.aios-gap-4 { gap: 16px !important; }
.aios-gap-6 { gap: 24px !important; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Typography Utilities                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-text-xs    { font-size: 0.75rem !important; }
.aios-text-sm    { font-size: 0.85rem !important; }
.aios-text-md    { font-size: 0.95rem !important; }
.aios-text-lg    { font-size: 1.15rem !important; }
.aios-text-xl    { font-size: 1.35rem !important; }
.aios-text-2xl   { font-size: 1.6rem !important; }

.aios-text-muted { color: #64748b !important; }
.aios-text-dim   { color: #94a3b8 !important; }
.aios-text-light { color: #e5e7eb !important; }

.aios-font-mono  { font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important; }
.aios-font-bold  { font-weight: 700 !important; }
.aios-font-semibold { font-weight: 600 !important; }

.aios-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Display & Flex Utilities                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

.aios-flex       { display: flex !important; }
.aios-flex-col   { flex-direction: column !important; }
.aios-flex-wrap  { flex-wrap: wrap !important; }
.aios-items-center { align-items: center !important; }
.aios-justify-between { justify-content: space-between !important; }
.aios-justify-end { justify-content: flex-end !important; }
.aios-flex-1     { flex: 1 !important; }
.aios-shrink-0   { flex-shrink: 0 !important; }

.aios-hidden     { display: none !important; }
.aios-block      { display: block !important; }
.aios-inline     { display: inline !important; }

.aios-w-full     { width: 100% !important; }
.aios-text-center { text-align: center !important; }
.aios-text-right  { text-align: right !important; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Light Mode — Layout-specific overrides                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

:root.theme-day .aios-stat-card {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

:root.theme-day .aios-stat-label {
  color: #64748b !important;
}

:root.theme-day .aios-stat-value {
  background: linear-gradient(120deg, #0f172a, #4f46e5) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

:root.theme-day .aios-gallery-item {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

:root.theme-day .aios-gallery-item h4 {
  color: #0f172a !important;
}

:root.theme-day .aios-table th {
  color: #475569 !important;
  border-bottom-color: rgba(15, 23, 42, 0.1) !important;
}

:root.theme-day .aios-table td {
  color: #334155 !important;
  border-bottom-color: rgba(15, 23, 42, 0.05) !important;
}

:root.theme-day .aios-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.04) !important;
}

:root.theme-day .aios-table tbody tr.selected {
  background: rgba(79, 70, 229, 0.08) !important;
}

:root.theme-day .aios-tab {
  color: #64748b !important;
}

:root.theme-day .aios-tab.active {
  color: #4f46e5 !important;
  border-bottom-color: #4f46e5 !important;
}

:root.theme-day .aios-toast {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

:root.theme-day .aios-pagination button {
  background: rgba(241, 245, 249, 0.8) !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

:root.theme-day .aios-pagination button.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #f8fafc !important;
}

:root.theme-day .aios-search input {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

:root.theme-day .aios-skeleton {
  background: linear-gradient(90deg,
    rgba(15, 23, 42, 0.04) 25%,
    rgba(15, 23, 42, 0.1) 50%,
    rgba(15, 23, 42, 0.04) 75%
  ) !important;
  background-size: 200% 100%;
}

:root.theme-day .aios-text-muted { color: #94a3b8 !important; }
:root.theme-day .aios-text-dim   { color: #64748b !important; }
:root.theme-day .aios-text-light { color: #1e293b !important; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Responsive                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .aios-viewport {
    padding: 0 14px 80px;
  }

  .aios-grid.cols-2,
  .aios-grid.cols-3,
  .aios-grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .aios-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .aios-card-body {
    padding: 16px;
  }

  #aios-shell-logo {
    bottom: 12px;
    left: 12px;
  }

  #aios-shell-logo img {
    width: 24px;
    height: 24px;
  }

  #aios-shell-logo .aios-version {
    display: none;
  }

  /* Layout presets collapse to single column on mobile */
  .aios-layout-list,
  .aios-layout-split {
    grid-template-columns: 1fr;
  }

  .aios-layout-list .aios-card.sidebar {
    position: static;
    max-height: none;
  }

  .aios-form-row {
    grid-template-columns: 1fr;
  }

  .aios-layout-gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .aios-stats-ribbon {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .aios-tabs {
    padding: 0 14px;
  }

  .aios-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .aios-toast-container {
    right: 12px;
    left: 12px;
  }

  .aios-toast {
    max-width: 100%;
  }

  .aios-toolbar {
    gap: 8px;
  }

  .aios-modal {
    max-width: 100%;
    border-radius: 16px;
  }

  .aios-modal.wide { max-width: 100%; }
}

/* Legacy aliases removed — all 136 apps now use native .aios-* classes (2026-03-08) */
