/* ==========================================================================
   AA Way Unified Executive Design System (aaway-ui.css)
   Theme: Clean Executive SaaS (Light Glassmorphism — Stripe / Vercel / Notion)
   Shared across https://aaway.online Dashboard and all 6 Web Applications:
   1. AACareer (/aacareer)
   2. AAutoDocument (/aautodocument)
   3. AATrading (/aatrading)
   4. AAInvesting (/aainvesting)
   5. AAInspection (/aainspection)
   6. Cariin (/cariin)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --aaway-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --aaway-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --aaway-bg: #f8fafc;
  --aaway-surface: #ffffff;
  --aaway-surface-glass: rgba(255, 255, 255, 0.88);
  --aaway-surface-subtle: #f1f5f9;
  --aaway-border: #e2e8f0;
  --aaway-border-strong: #cbd5e1;

  --aaway-text-main: #0f172a;
  --aaway-text-body: #334155;
  --aaway-text-muted: #64748b;
  --aaway-text-dim: #94a3b8;

  /* Default Accent (Dashboard Royal Blue) */
  --aaway-accent: #2563eb;
  --aaway-accent-hover: #1d4ed8;
  --aaway-accent-soft: #eff6ff;
  --aaway-accent-border: #bfdbfe;
  --aaway-accent-rgb: 37, 99, 235;

  /* Elevation Shadows */
  --aaway-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.03);
  --aaway-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
  --aaway-shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
  --aaway-shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.09), 0 8px 16px -4px rgba(15, 23, 42, 0.04);

  --aaway-radius-sm: 10px;
  --aaway-radius-md: 14px;
  --aaway-radius-lg: 18px;
  --aaway-radius-xl: 22px;
}

/* Per-Application Signature Accent Tokens */
body[data-aaway-app="aacareer"] {
  --aaway-accent: #0f766e;
  --aaway-accent-hover: #115e59;
  --aaway-accent-soft: #f0fdfa;
  --aaway-accent-border: #99f6e4;
  --aaway-accent-rgb: 15, 118, 110;
}

body[data-aaway-app="aautodocument"] {
  --aaway-accent: #0284c7;
  --aaway-accent-hover: #0369a1;
  --aaway-accent-soft: #f0f9ff;
  --aaway-accent-border: #bae6fd;
  --aaway-accent-rgb: 2, 132, 199;
}

body[data-aaway-app="aatrading"] {
  --aaway-accent: #4f46e5;
  --aaway-accent-hover: #4338ca;
  --aaway-accent-soft: #eef2ff;
  --aaway-accent-border: #c7d2fe;
  --aaway-accent-rgb: 79, 70, 229;
}

body[data-aaway-app="aainvesting"] {
  --aaway-accent: #059669;
  --aaway-accent-hover: #047857;
  --aaway-accent-soft: #ecfdf5;
  --aaway-accent-border: #a7f3d0;
  --aaway-accent-rgb: 5, 150, 105;
}

body[data-aaway-app="aainspection"] {
  --aaway-accent: #d97706;
  --aaway-accent-hover: #b45309;
  --aaway-accent-soft: #fffbeb;
  --aaway-accent-border: #fde68a;
  --aaway-accent-rgb: 217, 119, 6;
}

body[data-aaway-app="cariin"] {
  --aaway-accent: #7c3aed;
  --aaway-accent-hover: #6d28d9;
  --aaway-accent-soft: #f5f3ff;
  --aaway-accent-border: #ddd6fe;
  --aaway-accent-rgb: 124, 58, 237;
}

body[data-aaway-app="aashowcase"] {
  --aaway-accent: #db2777;
  --aaway-accent-hover: #be185d;
  --aaway-accent-soft: #fdf2f8;
  --aaway-accent-border: #fbcfe8;
  --aaway-accent-rgb: 219, 39, 119;
}

/* Global Typography & Subtle Mesh Background */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--aaway-font-sans) !important;
  background-color: var(--aaway-bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(var(--aaway-accent-rgb), 0.065) 0px, transparent 48%),
    radial-gradient(at 100% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 45%),
    radial-gradient(at 50% 100%, rgba(var(--aaway-accent-rgb), 0.035) 0px, transparent 55%);
  background-attachment: fixed;
  color: var(--aaway-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Preserve cursive signature fonts in AAutoDocument */
.font-caveat { font-family: 'Caveat', cursive !important; }
.font-dancing { font-family: 'Dancing Script', cursive !important; }
.font-greatvibes { font-family: 'Great Vibes', cursive !important; }
.font-sacramento { font-family: 'Sacramento', cursive !important; }

/* ==========================================================================
   1. UNIFIED STICKY EXECUTIVE TOPBAR (#aaway-unified-topbar)
   ========================================================================== */
header:not(#aaway-unified-topbar) {
  display: none !important;
}

#aaway-unified-topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 12px rgba(15, 23, 42, 0.02);
  transition: all 0.2s ease;
}

html[data-theme="dark"] #aaway-unified-topbar {
  background: rgba(14, 20, 34, 0.9);
  border-bottom-color: #1f293d;
}

.aaway-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* Left Zone: Master Brand + Active App Context */
.aaway-brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.aaway-master-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: #0f172a !important;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  transition: all 0.18s ease;
}

html[data-theme="dark"] .aaway-master-brand {
  color: #f8fafc !important;
}

.aaway-master-brand:hover {
  background: rgba(241, 245, 249, 0.9);
}

html[data-theme="dark"] .aaway-master-brand:hover {
  background: rgba(30, 41, 59, 0.8);
}

.aaway-master-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: -0.03em;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
  flex-shrink: 0;
}

.aaway-master-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.aaway-master-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: inherit;
}

.aaway-master-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
}

.aaway-brand-divider {
  color: #cbd5e1;
  font-size: 1.15rem;
  font-weight: 300;
  user-select: none;
  margin: 0 2px;
}

.aaway-active-app-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 11px;
  background: var(--aaway-accent-soft);
  border: 1px solid var(--aaway-accent-border);
  color: var(--aaway-accent) !important;
  text-decoration: none !important;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: all 0.18s ease;
  cursor: pointer;
}

.aaway-active-app-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(var(--aaway-accent-rgb), 0.14);
}

.aaway-active-app-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Center Zone: Unified App Switcher Dock */
.aaway-app-dock {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 4px;
  border-radius: 14px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.aaway-app-dock::-webkit-scrollbar {
  display: none;
}

html[data-theme="dark"] .aaway-app-dock {
  background: #0b111e;
  border-color: #1f293d;
}

.aaway-dock-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: all 0.16s ease;
  border: 1px solid transparent;
  line-height: 1.2;
}

html[data-theme="dark"] .aaway-dock-link {
  color: #94a3b8 !important;
}

.aaway-dock-link:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.65);
}

html[data-theme="dark"] .aaway-dock-link:hover {
  color: #f8fafc !important;
  background: rgba(30, 41, 59, 0.7);
}

.aaway-dock-link.active {
  background: #ffffff;
  color: var(--aaway-accent) !important;
  font-weight: 700;
  border-color: rgba(226, 232, 240, 0.95);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .aaway-dock-link.active {
  background: #1e293b;
  color: #38bdf8 !important;
  border-color: #334155;
}

.aaway-dock-icon {
  font-size: 0.88rem;
  line-height: 1;
}

.aaway-dock-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--aaway-accent);
  display: none;
}

.aaway-dock-link.active .aaway-dock-dot {
  display: inline-block;
}

/* Right Zone: Actions, Status & Language Switcher */
.aaway-actions-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.aaway-top-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569 !important;
  text-decoration: none !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.aaway-top-link:hover {
  color: var(--aaway-accent) !important;
  border-color: var(--aaway-accent-border);
  background: var(--aaway-accent-soft);
}

.aaway-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.aaway-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Responsive Topbar Layout for Tablet & Mobile */
@media (max-width: 1120px) {
  .aaway-topbar-inner {
    padding: 10px 16px;
    gap: 10px;
  }
  .aaway-brand-cluster {
    order: 1;
  }
  .aaway-actions-cluster {
    order: 2;
    margin-left: auto;
  }
  .aaway-app-dock {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .aaway-master-sub {
    display: none;
  }
  .aaway-status-pill.hide-mobile {
    display: none;
  }
  .aaway-dock-link {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   2. EXECUTIVE SAAS CARDS, HEROES, TABS & SURFACES
   ========================================================================== */
.aaway-page-shell {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.aaway-exec-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  padding: 32px 32px;
  margin-bottom: 24px;
  box-shadow: var(--aaway-shadow-sm);
  position: relative;
  overflow: hidden;
}

.aaway-exec-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--aaway-accent), #3b82f6, #10b981);
}

.aaway-exec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--aaway-accent-soft);
  color: var(--aaway-accent);
  border: 1px solid var(--aaway-accent-border);
  margin-bottom: 12px;
}

/* Unified Segmented Tabs */
.aaway-segmented-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e2e8f0;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  max-width: 100%;
  overflow-x: auto;
}

/* ==========================================================================
   3. UNIFIED EXECUTIVE FOOTER (.aaway-unified-footer)
   ========================================================================== */
.aaway-unified-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 36px 20px 28px;
  margin-top: auto;
  color: #64748b;
  font-size: 0.84rem;
}

html[data-theme="dark"] .aaway-unified-footer {
  background: #0e1422;
  border-top-color: #1f293d;
}

.aaway-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.aaway-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

html[data-theme="dark"] .aaway-footer-top {
  border-bottom-color: #1f293d;
}

.aaway-footer-apps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.aaway-footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155 !important;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.aaway-footer-pill:hover {
  border-color: var(--aaway-accent);
  color: var(--aaway-accent) !important;
  background: var(--aaway-accent-soft);
}

.aaway-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: #64748b;
}

.aaway-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.aaway-footer-links a {
  color: #64748b !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: color 0.15s ease;
}

.aaway-footer-links a:hover {
  color: var(--aaway-accent) !important;
}
