/*
 * SPP OrderTrack - Main Styles
 *
 * Design Philosophy: Clean, minimal, professional business application
 *
 * Color Palette:
 * - Primary: #2d3748 (slate gray - professional, neutral)
 * - Primary Light: #4a5568 (lighter slate for hover states)
 * - Accent: #3182ce (professional blue - trust, reliability)
 * - Accent Light: #4299e1 (hover state)
 * - Background: #f7fafc (off-white, easy on eyes)
 * - Surface: #ffffff (cards, modals)
 * - Text Primary: #1a202c (near black for readability)
 * - Text Secondary: #718096 (muted gray)
 * - Border: #e2e8f0 (subtle border)
 * - Divider: #edf2f7 (very light divider)
 *
 * Status Colors (muted, professional):
 * - Success: #38a169 (green)
 * - Warning: #d69e2e (amber)
 * - Error: #e53e3e (red)
 * - Info: #3182ce (blue)
 *
 * Typography: System font stack for native feel
 * Spacing: 4px base unit (0.25rem)
 * Border Radius: 6px for cards, 4px for inputs/buttons
 * Shadows: Subtle, layered elevation
 */

:root {
  /* Primary Colors */
  --primary: #2d3748;
  --primary-light: #4a5568;
  --primary-dark: #1a202c;

  /* Accent - Professional Blue */
  --accent: #3182ce;
  --accent-light: #4299e1;
  --accent-dark: #2c5282;

  /* Backgrounds */
  --bg: #f7fafc;
  --bg-alt: #edf2f7;
  --surface: #ffffff;

  /* Text */
  --text: #1a202c;
  --text-secondary: #718096;
  --text-muted: #a0aec0;

  /* Borders */
  --border: #e2e8f0;
  --border-light: #edf2f7;

  /* Status Colors */
  --success: #38a169;
  --success-bg: #f0fff4;
  --warning: #d69e2e;
  --warning-bg: #fffff0;
  --error: #e53e3e;
  --error-bg: #fff5f5;
  --info: #3182ce;
  --info-bg: #ebf8ff;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 56px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.menu-btn, .logout-btn, .install-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.menu-btn:hover, .logout-btn:hover, .install-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.install-btn {
  color: var(--accent);
}

.install-btn:hover {
  background: rgba(49, 130, 206, 0.1);
  color: var(--accent-light);
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  height: calc(100% - var(--header-height));
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: left 0.25s ease;
  z-index: 90;
  overflow-y: auto;
}

.sidebar.open { left: 0; }

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  display: none; /* Hidden on mobile - branding is in top header */
  align-items: center;
  gap: 0.5rem;
}

.logo {
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.logo-text {
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.nav-list {
  list-style: none;
  padding: 0.5rem 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0.125rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
}

/* Nav Icons */
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link.active .nav-icon {
  opacity: 1;
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 80;
  backdrop-filter: blur(2px);
}

.overlay.show { display: block; }

/* Main Content */
.main-content {
  margin-top: var(--header-height);
  padding: 1.5rem;
  flex: 1;
  max-width: 1400px;
}

.page { display: none; }
.page.active { display: block; }

/* Page Title */
.page h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Desktop Layout */
@media (min-width: 768px) {
  .menu-btn { display: none; }
  .header-title { display: none; } /* Hide redundant title - branding is in sidebar */
  .sidebar-header { display: flex; } /* Show branding on desktop */
  .sidebar {
    left: 0;
    top: 0;
    height: 100%;
    z-index: 110; /* Above header */
  }
  .overlay { display: none !important; }
  .main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
  }
  .header {
    left: var(--sidebar-width);
    justify-content: flex-end; /* Push logout to right */
  }
}

