/* ================================================================
   portal-chrome.css  --  1DS Strategy Portal shared styles
   Aligned with Ops Brain (ops.1dscollective.com) design system.
   Include on any portal page for consistent dark-theme chrome.
   ================================================================ */

:root {
  --portal-bg: #0a0a0a;
  --portal-surface: #111113;
  --portal-surface-light: #18181b;
  --portal-surface-hover: #1e1e22;
  --portal-card: #111113;
  --portal-card-hover: #1e1e22;
  --portal-accent: #e709f0;
  --portal-accent-bright: #f04dff;
  --portal-accent-dim: rgba(231, 9, 240, 0.08);
  --portal-accent-glow: rgba(231, 9, 240, 0.15);
  --portal-accent-border: rgba(231, 9, 240, 0.2);
  --portal-pink: #e709f0;
  --portal-pink-dim: rgba(231, 9, 240, 0.12);
  --portal-gradient: linear-gradient(135deg, #e709f0 0%, #f04dff 50%, #a855f7 100%);
  --portal-border: rgba(255, 255, 255, 0.06);
  --portal-border-hover: rgba(255, 255, 255, 0.1);
  --portal-green: #C8FF00;
  --portal-green-dim: rgba(200, 255, 0, 0.12);
  --portal-amber: #f59e0b;
  --portal-amber-dim: rgba(245, 158, 11, 0.12);
  --portal-red: #ef4444;
  --portal-red-dim: rgba(239, 68, 68, 0.12);
  --portal-blue: #74b9ff;
  --portal-blue-dim: rgba(116, 185, 255, 0.12);
  --portal-purple: #a855f7;
  --portal-text: #e4e4e7;
  --portal-text-secondary: #a1a1aa;
  --portal-text-muted: #52525b;
  --portal-muted: #52525b;
  --portal-sidebar-w: 240px;
  --portal-sidebar-collapsed-w: 56px;
  --portal-topbar-h: 48px;
  --portal-status-h: 28px;
  --portal-radius-sm: 4px;
  --portal-radius: 8px;
  --portal-radius-lg: 12px;
  --portal-nav-height: 48px;
  --portal-font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --portal-font-mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* JARVIS effects */
.jarvis-grid-bg { position: relative; }
.jarvis-grid-bg::before {
  content: ""; position: fixed; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px; opacity: 0.5; pointer-events: none; z-index: 0;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, black 40%, transparent 100%);
}
.jarvis-scanlines::after {
  content: ""; position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.004) 2px, rgba(255,255,255,0.004) 4px);
  pointer-events: none; z-index: 1;
}
@keyframes jarvis-breathe { 0%, 100% { opacity: 0.7; box-shadow: 0 0 4px currentColor; } 50% { opacity: 1; box-shadow: 0 0 8px currentColor; } }
@keyframes jarvis-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.status-breathe { animation: jarvis-breathe 3s ease-in-out infinite; }
.status-pulse { animation: jarvis-pulse 2s ease-in-out infinite; }
.fade-up { animation: fadeUp 0.4s ease forwards; opacity: 0; }
.text-glow { text-shadow: 0 0 10px rgba(231, 9, 240, 0.4); }

/* Shell */
.portal-shell { display: flex; height: 100vh; overflow: hidden; position: relative; z-index: 1; margin-left: 36px; }
@media (max-width: 768px) { .portal-shell { margin-left: 0; } }
.portal-shell__main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 10; }
.portal-shell__content { flex: 1; overflow-y: auto; padding: 1rem; background: var(--portal-bg); }
@media (min-width: 769px) { .portal-shell__content { padding: 1.5rem; } }

/* Sidebar */
.portal-sidebar { width: var(--portal-sidebar-w); background: var(--portal-surface); border-right: 1px solid var(--portal-border); display: flex; flex-direction: column; overflow: hidden; position: relative; flex-shrink: 0; transition: width 0.2s ease; }
.portal-sidebar.collapsed { width: var(--portal-sidebar-collapsed-w); }
.portal-sidebar__glow { position: absolute; left: 0; top: 0; height: 100%; width: 1px; background: var(--portal-accent); opacity: 0.15; }
.portal-sidebar__header { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--portal-border); flex-shrink: 0; }
.portal-sidebar__logo { height: 22px; width: auto; max-width: 100%; object-fit: contain; flex-shrink: 0; }
.portal-sidebar.collapsed .portal-sidebar__logo { display: none; }
.portal-sidebar__label { margin-left: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--portal-accent-bright); }
.portal-sidebar__toggle { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--portal-text-secondary); padding: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.15s; }
.portal-sidebar__toggle:hover { color: var(--portal-text); }
.portal-sidebar.collapsed .portal-sidebar__label { display: none; }
.portal-sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; }
.portal-sidebar__nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--portal-text-secondary); text-decoration: none; transition: background 0.15s, color 0.15s; }
.portal-sidebar__nav-item:hover { background: var(--portal-surface-hover); color: var(--portal-text); }
.portal-sidebar__nav-item.active { background: var(--portal-accent-dim); color: var(--portal-accent-bright); }
.portal-sidebar__nav-item.active::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; background: var(--portal-accent); border-radius: 1px; }
.portal-sidebar__nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-sidebar__nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-sidebar.collapsed .portal-sidebar__nav-item span { display: none; }
.portal-sidebar__section { padding: 0 8px; margin-bottom: 12px; }
.portal-sidebar__section-label { display: flex; align-items: center; gap: 6px; padding: 0 8px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--portal-text-muted); }
.portal-sidebar.collapsed .portal-sidebar__section { display: none; }
.portal-sidebar__deliv-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 12px; color: var(--portal-text-secondary); text-decoration: none; transition: background 0.15s, color 0.15s; }
.portal-sidebar__deliv-item:hover { background: var(--portal-surface-hover); color: var(--portal-text); }
.portal-sidebar__deliv-item.active { background: var(--portal-accent-dim); color: var(--portal-text); }
.portal-sidebar__deliv-item .status-dot, .portal-sidebar__deliv-item .portal-sidebar__status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.portal-sidebar__deliv-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-sidebar__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.portal-sidebar__client-toggle { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px; border: none; background: none; cursor: pointer; font-family: var(--portal-font); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--portal-text-secondary); border-radius: 6px; text-align: left; transition: background 0.15s, color 0.15s; }
.portal-sidebar__client-toggle:hover { background: var(--portal-surface-hover); color: var(--portal-text); }
.portal-sidebar__client-toggle.open { color: var(--portal-text); }
.portal-sidebar__client-chevron { display: flex; align-items: center; transition: transform 0.2s ease; flex-shrink: 0; }
.portal-sidebar__client-chevron svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-sidebar__client-toggle.open .portal-sidebar__client-chevron { transform: rotate(90deg); }
.portal-sidebar__client-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-sidebar__client-count { font-size: 10px; color: var(--portal-text-muted); background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 999px; flex-shrink: 0; }
.portal-sidebar__client-items { padding-left: 12px; margin-bottom: 4px; }
.portal-sidebar__placeholder { padding: 12px 8px; font-size: 12px; color: var(--portal-text-muted); }

/* Mobile sidebar */
.portal-sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9998; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.portal-sidebar-overlay.visible { opacity: 1; pointer-events: auto; }
@media (max-width: 768px) {
  .portal-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 9999; width: 280px !important; transform: translateX(-100%); transition: transform 0.25s ease; }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-sidebar.collapsed { width: 280px !important; }
  .portal-sidebar.collapsed .portal-sidebar__label, .portal-sidebar.collapsed .portal-sidebar__section, .portal-sidebar.collapsed .portal-sidebar__nav-item span { display: flex; }
}

/* Topbar */
.portal-topbar { display: flex; align-items: center; justify-content: space-between; height: var(--portal-topbar-h); padding: 0 12px; background: var(--portal-bg); border-bottom: 1px solid var(--portal-border); flex-shrink: 0; }
@media (min-width: 769px) { .portal-topbar { padding: 0 16px; } }
.portal-topbar__left { display: flex; align-items: center; gap: 8px; }
.portal-topbar__hamburger { display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--portal-text-secondary); padding: 8px; min-width: 44px; min-height: 44px; }
@media (min-width: 769px) { .portal-topbar__hamburger { display: none; } }
.portal-topbar__brand { display: flex; align-items: center; gap: 8px; }
.portal-topbar__brand img { height: 22px; width: auto; max-width: 100%; object-fit: contain; }
.portal-topbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--portal-accent); color: var(--portal-accent); }
.portal-topbar__brand-label { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; color: var(--portal-accent-bright); }
.portal-topbar__breadcrumb { display: none; align-items: center; gap: 6px; font-size: 13px; margin-left: 8px; }
@media (min-width: 769px) { .portal-topbar__breadcrumb { display: flex; } }
.portal-topbar__breadcrumb-link { color: var(--portal-accent); font-weight: 600; text-decoration: none; transition: color 0.15s; }
.portal-topbar__breadcrumb-link:hover { color: var(--portal-accent-bright); }
.portal-topbar__breadcrumb-sep { color: var(--portal-text-muted); font-size: 11px; }
.portal-topbar__breadcrumb-current { color: var(--portal-text); font-weight: 400; }
.portal-topbar__breadcrumb-muted { color: var(--portal-text-secondary); font-weight: 400; }
.portal-topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.portal-topbar__btn { font-size: 12px; font-family: var(--portal-font); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s, background 0.15s, border-color 0.15s; }
.portal-topbar__btn--ghost { background: none; border: 1px solid var(--portal-border); color: var(--portal-text-muted); }
.portal-topbar__btn--ghost:hover { border-color: var(--portal-border-hover); color: var(--portal-text); }

/* Status strip */
.portal-status-strip { display: flex; align-items: center; justify-content: space-between; height: var(--portal-status-h); padding: 0 16px; background: #060606; border-top: 1px solid var(--portal-border); font-family: var(--portal-font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--portal-text-muted); flex-shrink: 0; }
.portal-status-strip__group { display: flex; align-items: center; gap: 16px; }
.portal-status-strip .highlight { color: var(--portal-accent-bright); }

/* Brand rail (kept for presentations) */
.brand-rail { position: fixed; left: 0; top: 0; bottom: 0; width: 36px; z-index: 9000; background: #ffffff; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.brand-rail-text { writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); font-family: var(--portal-font); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; color: #0a0a0a; white-space: nowrap; }
.brand-rail-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--portal-pink); flex-shrink: 0; margin-top: 0.5rem; }
@media (max-width: 768px) { .brand-rail { display: none; } }

/* Grid bg (legacy class) */
.portal-grid-bg::before { content: ''; position: fixed; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; z-index: 0; }

/* Base typography */
.portal-body { font-family: var(--portal-font); background: var(--portal-bg); color: var(--portal-text); margin: 0; padding: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.portal-heading { font-weight: 700; line-height: 1.2; color: var(--portal-text); }
.portal-heading--pink { background: var(--portal-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.portal-muted { color: var(--portal-muted); }
.portal-label { color: var(--portal-pink); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.portal-gradient-line { width: 60px; height: 3px; background: var(--portal-gradient); border-radius: 2px; }

/* Cards */
.portal-card { position: relative; background: var(--portal-card); border: 1px solid var(--portal-border); border-radius: var(--portal-radius-lg); padding: 1.25rem 1.5rem; text-decoration: none; color: var(--portal-text); display: block; transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease; }
.portal-card:hover { transform: translateY(-3px); border-color: var(--portal-accent-border); box-shadow: 0 8px 24px rgba(231, 9, 240, 0.08); background: var(--portal-card-hover); }
.portal-card__label { color: var(--portal-pink); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.35rem; }
.portal-card__title { font-size: 1rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.3rem; }
.portal-card__desc { font-size: 0.8rem; font-weight: 400; color: var(--portal-text-secondary); line-height: 1.45; }

/* Badges */
.portal-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.2rem 0.55rem; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.portal-badge--type { background: rgba(255,255,255,0.06); color: var(--portal-muted); }
.portal-badge--draft { background: var(--portal-amber-dim); color: var(--portal-amber); }
.portal-badge--review { background: var(--portal-blue-dim); color: var(--portal-blue); }
.portal-badge--final { background: var(--portal-green-dim); color: var(--portal-green); }
.portal-badge__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.portal-badge--draft .portal-badge__dot { background: var(--portal-amber); }
.portal-badge--review .portal-badge__dot { background: var(--portal-blue); }
.portal-badge--final .portal-badge__dot { background: var(--portal-green); }

/* Buttons */
.portal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border-radius: var(--portal-radius); font-family: var(--portal-font); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; cursor: pointer; border: none; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease; }
.portal-btn:hover { transform: translateY(-1px); }
.portal-btn--primary { background: var(--portal-gradient); color: #ffffff; }
.portal-btn--primary:hover { box-shadow: 0 4px 16px rgba(231, 9, 240, 0.3); }
.portal-btn--ghost { background: none; border: 1px solid var(--portal-border); color: var(--portal-muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.portal-btn--ghost:hover { border-color: var(--portal-accent-border); color: var(--portal-text); }
.portal-btn--outline { background: none; border: 1px solid var(--portal-accent-border); color: var(--portal-pink); font-size: 0.8rem; }
.portal-btn--outline:hover { background: var(--portal-pink-dim); box-shadow: 0 4px 16px rgba(231, 9, 240, 0.15); }

/* Toasts */
.portal-toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 10000; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.portal-toast { pointer-events: auto; background: var(--portal-card); border: 1px solid var(--portal-border); border-radius: var(--portal-radius); padding: 0.75rem 1.25rem; font-family: var(--portal-font); font-size: 0.85rem; color: var(--portal-text); box-shadow: 0 8px 32px rgba(0,0,0,0.4); transform: translateX(120%); transition: transform 0.3s ease, opacity 0.3s ease; max-width: 360px; }
.portal-toast--visible { transform: translateX(0); }
.portal-toast--success { border-left: 3px solid var(--portal-green); }
.portal-toast--error { border-left: 3px solid var(--portal-red); }
.portal-toast--info { border-left: 3px solid var(--portal-blue); }

/* Section headers */
.portal-section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; margin-top: 2rem; }
.portal-section-header__line { flex: 1; height: 1px; background: var(--portal-border); }
.portal-section-header__text { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--portal-muted); white-space: nowrap; }

/* Grid */
.portal-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .portal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .portal-grid { grid-template-columns: repeat(3, 1fr); } }

/* Responsive helpers */
@media (max-width: 768px) { .portal-hide-mobile { display: none !important; } }
@media (min-width: 769px) { .portal-hide-desktop { display: none !important; } }
