@import "global.css";

/* =========================================================================
   VYRA — APPLE HIG DESIGN SYSTEM (macOS Sequoia & iOS 18 native aesthetics)
   =========================================================================
   - Typography: Camera Plain Variable / SF Pro / Inter
   - Materials: Liquid Glass (backdrop-filter: blur(20px) saturate(180%))
   - Canvas: Apple Neutral #f5f5f7 (Light) / #000000 True Black (Dark)
   - Surfaces: Pristine #ffffff (Light) / #1c1c1e (Dark)
   - Selection: Vyra Coral #ff6f6f with contrast white text
   - Squircles: Apple rounded corners (8px - 14px)
   - Shadows: Multi-stop subtle ambient layered depth
   - Unified Top Navbar: Identical across ALL pages
   ========================================================================= */

/* --- Vyra Global Text Selection (#ff6f6f) --- */
::selection {
  background-color: #ff6f6f !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
::-moz-selection {
  background-color: #ff6f6f !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* --- Official Typography --- */
@font-face {
  font-family: 'Camera Plain Variable';
  src: url('../CameraPlainVariable-c48bd243-BhPypTEq.woff2') format("woff2"),
       url('/assets/CameraPlainVariable-c48bd243-BhPypTEq.woff2') format("woff2"),
       url('assets/CameraPlainVariable-c48bd243-BhPypTEq.woff2') format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'NewTitle';
  src: url('../fonts/newtitle/NewTitle-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'NewTitle';
  src: url('../fonts/newtitle/NewTitle-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Font Stacks */
  --font-heading: 'Camera Plain Variable', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Inter", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Inter", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Vyra Brand Colors */
  --vyra-coral: #ff6f6f;
  --vyra-coral-hover: #fa5a5a;
  --vyra-coral-subtle: rgba(255, 111, 111, 0.09);
  --vyra-coral-glow: rgba(255, 111, 111, 0.22);
  --accent: #ff6f6f;
  --accent-strong: #fa5a5a;
  --accent-tint: rgba(255, 111, 111, 0.09);
  --accent-glow: rgba(255, 111, 111, 0.22);

  /* Apple Light Canvas & Surface Tokens */
  --bg-page: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f0f0f2;
  --bg-surface-hover: #e8e8ed;
  --bg-glass-1: rgba(0, 0, 0, 0.035);
  --bg-glass-2: rgba(0, 0, 0, 0.015);

  /* Liquid Glass (Functional Layer) */
  --liquid-glass-bg: rgba(255, 255, 255, 0.82);
  --liquid-glass-border: rgba(0, 0, 0, 0.08);

  /* Apple Neutral Borders */
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --border-soft: rgba(0, 0, 0, 0.08);

  /* Apple Semantic Typography */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-muted: #86868b;
  --ink: #1d1d1f;
  --white: #ffffff;

  /* Status Colors */
  --color-success: #34c759;
  --color-success-bg: rgba(52, 199, 89, 0.1);
  --color-warning: #ff9500;
  --color-warning-bg: rgba(255, 149, 0, 0.1);
  --color-danger: #ff3b30;
  --color-danger-bg: rgba(255, 59, 48, 0.1);

  /* Sizing & Squircle Radii */
  --navbar-height: 50px;
  --navbar-h: 50px;
  --sidebar-width: 224px;
  --sidebar-w: 224px;
  --sidebar-collapsed-width: 64px;
  --sidebar-w-collapsed: 64px;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Apple Multi-stop Ambient Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
  --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-ambient: 0 16px 40px rgba(0, 0, 0, 0.05);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Apple Dark Mode Tokens (OLED Pure Black & Apple Elevated Dark) --- */
html.dark-mode, html.dark, body.dark-mode, body.dark {
  --bg-page: #000000;
  --bg-surface: #1c1c1e;
  --bg-surface-subtle: #2c2c2e;
  --bg-surface-hover: #3a3a3c;
  --bg-glass-1: rgba(255, 255, 255, 0.06);
  --bg-glass-2: rgba(255, 255, 255, 0.03);

  --liquid-glass-bg: rgba(28, 28, 30, 0.82);
  --liquid-glass-border: rgba(255, 255, 255, 0.09);

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-soft: rgba(255, 255, 255, 0.09);

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #86868b;
  --text-muted: #86868b;
  --ink: #f5f5f7;

  --vyra-coral-subtle: rgba(255, 111, 111, 0.12);
  --accent-tint: rgba(255, 111, 111, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-dropdown: 0 16px 40px rgba(0, 0, 0, 0.65);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.7);
  --shadow-ambient: 0 20px 60px rgba(0, 0, 0, 0.55);
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

svg {
  display: block;
}

/* =========================================================================
   APPLE HIG UNIFIED TOP NAVBAR (LIQUID GLASS)
   macOS Sequoia / iOS 18 native aesthetics
   ========================================================================= */
.app-navbar,
.navbar,
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height, 50px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--liquid-glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--liquid-glass-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

/* Left Brand & Workspace Group */
.nav-left,
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}


.nav-mobile-btn,
.mobile-menu-btn,
.navbar-hamburger {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.nav-mobile-btn:hover,
.mobile-menu-btn:hover {
  background: var(--bg-surface-hover);
}

.nav-brand,
.brand-link,
.navbar-logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  user-select: none;
}

.nav-brand-logo,
.brand-logo-svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.nav-brand-title,
.brand-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.nav-separator {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 2px;
}

.nav-workspace-pill,
.workspace-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  line-height: 1;
}

.nav-ws-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
}

.nav-ws-name,
.workspace-name {
  font-weight: 500;
  color: var(--text-primary);
}

.nav-ws-tag,
.badge-tier {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}
html.dark-mode .nav-ws-tag,
html.dark-mode .badge-tier {
  background: rgba(255, 255, 255, 0.08);
}

/* Center Search Bar */
.nav-center,
.header-center {
  flex: 1;
  max-width: 440px;
  margin: 0 16px;
}

.nav-search-bar,
.search-input-box,
.navbar-search {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 11px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: text;
  transition: all 0.15s var(--ease);
}
.nav-search-bar:focus-within,
.search-input-box:focus-within,
.navbar-search:focus-within {
  background: var(--bg-surface);
  border-color: rgba(255, 111, 111, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 111, 111, 0.12);
  color: var(--text-primary);
}
.nav-search-bar svg,
.search-input-box svg,
.navbar-search svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.nav-search-bar input,
.search-input-box input,
.navbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  min-width: 0;
}
.nav-search-bar input::placeholder,
.navbar-search input::placeholder {
  color: var(--text-tertiary);
}
.nav-search-bar kbd,
.search-input-box kbd,
.navbar-search kbd {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.2;
}

/* Right Actions Group */
.nav-right,
.header-right,
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-btn-action,
.btn-create-project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--vyra-coral);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border: none;
}
.nav-btn-action:hover,
.btn-create-project:hover {
  background: var(--vyra-coral-hover);
  transform: translateY(-0.5px);
  box-shadow: 0 2px 8px rgba(255, 111, 111, 0.28);
}

.nav-icon-btn,
.icon-action-btn,
.navbar-icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.nav-icon-btn:hover,
.icon-action-btn:hover,
.navbar-icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.nav-notif-indicator,
.notif-indicator,
.navbar-icon-btn .notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vyra-coral);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.nav-avatar-btn,
.user-avatar-btn,
.navbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-surface) !important;
  -webkit-text-fill-color: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.nav-avatar-btn:hover,
.user-avatar-btn:hover,
.navbar-avatar:hover {
  transform: scale(1.04);
  border-color: var(--text-secondary);
}

/* =========================================================================
   APPLE HIG UNIFIED SIDEBAR (MACOS SEQUOIA DOCK/SIDEBAR SPEC)
   ========================================================================= */
.app-shell,
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-height, 50px);
}

.sidebar {
  position: fixed;
  top: var(--navbar-height, 50px);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width, 224px);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 8px;
  z-index: 900;
  transition: width 0.2s var(--ease), transform 0.2s var(--ease);
}
.sidebar.collapsed,
.sidebar.is-collapsed {
  width: var(--sidebar-collapsed-width, 64px);
}

.sidebar-scroll,
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding-right: 2px;
}
.sidebar-scroll::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label,
.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 6px 10px 3px;
  user-select: none;
  white-space: nowrap;
  transition: opacity 0.15s var(--ease);
}
.sidebar.collapsed .nav-section-label,
.sidebar.is-collapsed .sidebar-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.nav-link,
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.nav-link:hover,
.nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.nav-link.active,
.nav-item.is-active {
  background: var(--vyra-coral-subtle);
  color: var(--vyra-coral);
  font-weight: 600;
}
.nav-link svg,
.nav-item-icon svg,
.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: color 0.12s var(--ease);
}
.nav-link.active svg,
.nav-item.is-active svg {
  color: var(--vyra-coral);
}
.sidebar.collapsed .nav-link span,
.sidebar.is-collapsed .nav-item-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
.sidebar.collapsed .nav-link,
.sidebar.is-collapsed .nav-item {
  justify-content: center;
  padding: 7px 0;
}

.sidebar-bottom,
.sidebar-footer {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.btn-toggle-sidebar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.12s var(--ease);
}
.btn-toggle-sidebar:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
}
.sidebar.collapsed .btn-toggle-sidebar span,
.sidebar.is-collapsed .btn-toggle-sidebar span {
  display: none;
}
.sidebar.collapsed .btn-toggle-sidebar,
.sidebar.is-collapsed .btn-toggle-sidebar {
  justify-content: center;
  padding: 6px 0;
}
.sidebar.collapsed .btn-toggle-sidebar svg,
.sidebar.is-collapsed .btn-toggle-sidebar svg {
  transform: rotate(180deg);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 850;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.sidebar-overlay.mobile-open,
.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================================
   APPLE HIG MAIN CONTENT LAYER & TYPOGRAPHY
   ========================================================================= */
.main-wrapper,
.main-column {
  flex: 1;
  margin-left: var(--sidebar-width, 224px);
  min-width: 0;
  padding: 24px 32px 64px;
  transition: margin-left 0.2s var(--ease);
}
.sidebar.collapsed ~ .main-wrapper,
.sidebar.is-collapsed ~ .main-column {
  margin-left: var(--sidebar-collapsed-width, 64px);
}

.page-container,
.content {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 4px;
}
.page-title-group h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.page-title-group p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Period Selector (Apple segmented control) */
.period-selector {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.period-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: all 0.12s var(--ease);
  cursor: pointer;
}
.period-btn:hover {
  color: var(--text-primary);
}
.period-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Apple Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-surface) !important;
  -webkit-text-fill-color: var(--bg-surface) !important;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border: 1px solid transparent;
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-0.5px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-secondary:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-strong);
}

/* =========================================================================
   APPLE HIG CARDS & METRICS
   ========================================================================= */
.metrics-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card,
.stat-card,
.content-card,
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.metric-card:hover,
.stat-card:hover {
  border-color: var(--border-strong);
}

.metric-card-header,
.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.metric-label,
.stat-card-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.metric-badge,
.stat-card-trend {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-success);
  background: var(--color-success-bg);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.metric-value,
.stat-card-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.15;
}
.metric-subtext {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Grille 2 Colonnes Dashboard */
.dashboard-two-cols {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

/* =========================================================================
   APPLE HIG DOUBLE-BEZEL (DOPPELRAND ARCHITECTURE) & NATIVE COMPONENTS
   ========================================================================= */
.apple-bezel-card {
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}
html.dark-mode .apple-bezel-card,
html.dark .apple-bezel-card {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.apple-bezel-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
html.dark-mode .apple-bezel-card:hover,
html.dark .apple-bezel-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.apple-bezel-inner {
  background: var(--bg-surface);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 18px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: background 0.2s ease;
}
html.dark-mode .apple-bezel-inner,
html.dark .apple-bezel-inner {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Apple Squircle Badges */
.apple-squircle-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.apple-squircle-badge:hover {
  transform: scale(1.05);
}
.badge-emerald {
  background: linear-gradient(135deg, #34c759 0%, #28cd41 100%);
  box-shadow: 0 3px 10px rgba(52, 199, 89, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.badge-blue {
  background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
  box-shadow: 0 3px 10px rgba(0, 122, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.badge-coral {
  background: linear-gradient(135deg, #ff6f6f 0%, #fa5a5a 100%);
  box-shadow: 0 3px 10px rgba(255, 111, 111, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.badge-graphite {
  background: linear-gradient(135deg, #8e8e93 0%, #636366 100%);
  box-shadow: 0 3px 10px rgba(142, 142, 147, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.badge-purple {
  background: linear-gradient(135deg, #af52de 0%, #bf5af2 100%);
  box-shadow: 0 3px 10px rgba(175, 82, 222, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Apple Metric Numbers & Header */
.apple-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.apple-metric-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.apple-metric-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.apple-metric-num {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}
.apple-metric-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.apple-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  line-height: 1.2;
}
.trend-positive {
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
}
.trend-neutral {
  background: rgba(142, 142, 147, 0.12);
  color: var(--text-tertiary);
}

/* Apple Segmented Pill Switcher */
.apple-segmented-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.apple-segmented-pill button {
  padding: 5px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.3;
}
.apple-segmented-pill button:hover {
  color: var(--text-primary);
}
.apple-segmented-pill button.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0.5px 1px rgba(0, 0, 0, 0.04);
}
html.dark-mode .apple-segmented-pill button.active,
html.dark .apple-segmented-pill button.active {
  background: var(--bg-surface-hover);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Apple Stocks-grade Chart */
.apple-chart-card {
  padding: 22px 24px;
}
.apple-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.apple-chart-stat-group h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.15;
}
.apple-chart-stat-group p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Apple Inset Grouped Table */
.apple-inset-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}
.apple-inset-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.apple-inset-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  transition: background 0.12s ease;
}
.apple-inset-table tbody tr:last-child td {
  border-bottom: none;
}
.apple-inset-table tbody tr:hover td {
  background: var(--bg-surface-subtle);
}
.apple-app-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.apple-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.25);
  display: inline-block;
  animation: applePulse 2s infinite ease-in-out;
}
@keyframes applePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.25); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.1); }
  100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.25); }
}

/* Apple Multi-Color Storage / Battery Bar */
.apple-storage-bar {
  width: 100%;
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.05);
  margin: 14px 0 16px;
  padding: 1px;
}
html.dark-mode .apple-storage-bar,
html.dark .apple-storage-bar {
  background: rgba(255, 255, 255, 0.08);
}
.apple-storage-seg {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.apple-legend-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.apple-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.apple-legend-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 500;
}
.apple-legend-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.apple-legend-val {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Apple Ecosystem Grid Cards */
.apple-eco-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 1040px) {
  .apple-eco-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .apple-eco-grid {
    grid-template-columns: 1fr;
  }
}
.apple-eco-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, border-color 0.15s ease;
}
.apple-eco-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}
html.dark-mode .apple-eco-card:hover,
html.dark .apple-eco-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.apple-eco-card:active {
  transform: scale(0.98);
}
.apple-eco-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.apple-eco-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.apple-eco-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}
.apple-eco-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--vyra-coral);
  margin-top: 6px;
}

/* =========================================================================
   APPLE HIG DATA TABLES
   ========================================================================= */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.data-table th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: var(--bg-surface-subtle);
}

/* =========================================================================
   APPLE HIG MODALS & DROPDOWNS
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-modal);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* =========================================================================
   RESPONSIVE (Apple HIG Guidelines)
   ========================================================================= */
@media (max-width: 1040px) {
  .metrics-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-two-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .nav-mobile-btn,
  .mobile-menu-btn,
  .navbar-hamburger {
    display: flex;
  }
  .nav-center,
  .header-center {
    display: none;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open,
  .sidebar.is-mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-ambient);
  }
  .main-wrapper,
  .main-column {
    margin-left: 0 !important;
    padding: 20px 16px 60px;
  }
}

@media (max-width: 540px) {
  .metrics-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .nav-workspace-pill,
  .nav-separator {
    display: none;
  }
}

/* =========================================================================
   VYRA STUDIO & DASHBOARD — INSPI3 ARCHITECTURE (Framed Stage + Clean Left Panel)
   Inspiré fidèlement de dashboard inspi3.png
   ========================================================================= */
.inspi-app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-surface);
  font-family: var(--font-body);
  color: var(--text-primary);
}

.inspi-sidebar {
  width: 250px;
  flex-shrink: 0;
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.inspi-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-svg {
  width: 26px;
  height: 26px;
  display: block;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.ws-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ws-select-btn:hover {
  background: #f4f4f6;
  border-color: rgba(0, 0, 0, 0.12);
}
.ws-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ws-avatar-badge {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #e2722b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ws-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.ws-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 4px;
}
.sidebar-nav-scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.inspi-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.inspi-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: #48484a;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  cursor: pointer;
}
.inspi-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}
.inspi-nav-item.active {
  background: #ebebee;
  color: var(--text-primary);
  font-weight: 600;
}
.inspi-nav-item svg {
  width: 16px;
  height: 16px;
  color: #636366;
  flex-shrink: 0;
}
.inspi-nav-item.active svg {
  color: var(--text-primary);
}

.inspi-section-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 10px 10px 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pro-upgrade-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.pro-upgrade-card:hover {
  border-color: rgba(255, 111, 111, 0.4);
  box-shadow: 0 4px 12px rgba(255, 111, 111, 0.12);
  transform: translateY(-1px);
}
.pro-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.pro-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
  line-height: 1.25;
}
.pro-bolt-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ff6f6f;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #a37264;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-label-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.inspi-stage-container {
  flex: 1;
  height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--bg-surface);
}

.inspi-stage {
  flex: 1;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-surface);
  box-shadow: none;
  position: relative;
  display: flex;
  flex-direction: column;
}

.stage-inner-content {
  padding: 28px 36px 48px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.mobile-menu-trigger {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 80;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (max-width: 900px) {
  .inspi-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }
  .inspi-sidebar.is-open {
    transform: translateX(0);
  }
  .inspi-stage-container {
    padding: 0;
  }
  .inspi-stage {
    border-radius: 0;
    border: none;
  }
  .mobile-menu-trigger {
    display: flex;
  }
  .stage-inner-content {
    padding: 20px 16px 40px;
  }
}

