/* Ostazy 2025 Design System - Compiled Base */

/* Fonts loaded from /css/fonts.css */

:root {
  --primary: #4F46E5;
  --secondary: #10B981;
  --accent: #F59E0B;
  --surface: #F9FAFB;
  --white: #FFFFFF;
  --black: #111827;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 12px;

  /* Stage-Adaptive Tokens */
  --stage-primary: #FF6B6B;
  /* Vibrant for Primary */
  --stage-secondary: #4361EE;
  /* Professional for Secondary */
  --status-success: #06D6A0;
  --status-warning: #FFD166;
  --status-error: #EF4444;
}

/* Stage Helper Classes */
.stage-primary-theme {
  --primary: var(--stage-primary);
  --radius: 20px;
}

.stage-secondary-theme {
  --primary: var(--stage-secondary);
  --radius: 8px;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--surface);
  color: var(--black);
}

.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

/* Custom Components */
.card {
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: #4338CA;
  transform: translateY(-1px);
}

/* Layout System */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 256px;
  background: var(--white);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-link-text,
.sidebar.collapsed .nav-group-title {
  display: none;
}

.sidebar-header {
  padding: 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.nav-group {
  margin-bottom: 2rem;
}

.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem;
  color: #4B5563;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: #EEF2FF;
  color: var(--primary);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #F3F4F6;
}

.app-header {
  height: 72px;
  background: var(--white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.page-container {
  padding: 2rem;
  flex: 1;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    left: -256px;
    top: 0px;
    height: calc(100vh - 0px);
    z-index: 1040;
  }

  .sidebar.show {
    left: 0;
  }
}

.extra-small {
  font-size: 10px;
}

/* ─────────────────────────────────────────────────────────────
   GLOBAL DROPDOWN FIX
   Bootstrap 5 dropdown menus are position:absolute (z-index:1000).
   They get clipped or painted behind other content when any ancestor
   is a scroll/overflow container or creates a stacking context:
     - .table-responsive (overflow-x:auto -> overflow-y computes auto)
     - cards with overflow:hidden (inline or class)
     - .app-wrapper { overflow: hidden }
     - .card:hover { transform } creates a stacking context, trapping
       the open menu so a later sibling card paints over it
     - sticky .app-header { z-index: 1030 } above menu z-index 1000
   While a menu is open (.show) we lift the clipping from those
   ancestors and raise the menu above the sticky header/sidebar.
   This fixes every action dropdown app-wide, LTR and RTL alike.
   No page-specific CSS required.
   ───────────────────────────────────────────────────────────── */
.table-responsive:has(.dropdown-menu.show),
.card:has(.dropdown-menu.show),
.app-wrapper:has(.dropdown-menu.show) {
  overflow: visible !important;
}

/* The card hosting the open menu must paint above sibling cards */
.card:has(.dropdown-menu.show) {
  z-index: 1050;
}

/* Open menus always render above sticky header (1030) and sidebar (1000) */
.dropdown-menu.show {
  z-index: 1050;
}