/*
 * LINEONE Hair — Brand Design System
 * Source of truth for colors, typography, spacing, and components.
 * Based on LOH_BRAND_GUIDELINES_2025_v2
 */

/* ── CSS Variables ── */
:root {
  /* Core palette */
  --loh-hunter-green: #335749;
  --loh-hunter-green-dark: #2a4639;
  --loh-hunter-green-light: #3d6b58;
  --loh-champagne-gold: #89764B;
  --loh-gold-light: #a08e64;
  --loh-cold-grey: #2B3D42;
  --loh-strong-green: #007346;

  /* Extended palette */
  --loh-cool-gray: #63676B;
  --loh-sage-green: #AAAA88;
  --loh-slate-gray: #B0B0B1;
  --loh-cream: #F1F1DE;
  --loh-white: #FFFFFF;
  --loh-black: #000000;

  /* Functional colors */
  --loh-bg-primary: #FAFAFA;
  --loh-bg-card: #FFFFFF;
  --loh-bg-sidebar: #335749;
  --loh-bg-sidebar-hover: #2a4639;
  --loh-bg-sidebar-active: #1e3329;
  --loh-border: #E5E7EB;
  --loh-border-light: #F0F0F0;
  --loh-text-primary: #2B3D42;
  --loh-text-secondary: #63676B;
  --loh-text-muted: #9CA3AF;
  --loh-text-inverse: #FFFFFF;

  /* Status colors */
  --loh-success: #2D6A4F;
  --loh-warning: #D4860B;
  --loh-danger: #C41E3A;
  --loh-info: #335749;

  /* Typography */
  --loh-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --loh-font-size-xs: 10px;
  --loh-font-size-sm: 12px;
  --loh-font-size-md: 14px;
  --loh-font-size-lg: 16px;
  --loh-font-size-xl: 20px;
  --loh-font-size-2xl: 28px;
  --loh-font-size-3xl: 36px;

  /* Spacing */
  --loh-space-xs: 4px;
  --loh-space-sm: 8px;
  --loh-space-md: 16px;
  --loh-space-lg: 24px;
  --loh-space-xl: 32px;
  --loh-space-2xl: 48px;

  /* Layout */
  --loh-sidebar-width: 240px;
  --loh-sidebar-collapsed: 64px;
  --loh-topbar-height: 0px;
  --loh-content-max-width: 1400px;

  /* Shadows */
  --loh-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --loh-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --loh-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --loh-transition: 0.2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--loh-font);
  font-size: var(--loh-font-size-md);
  color: var(--loh-text-primary);
  background: var(--loh-bg-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--loh-hunter-green);
  text-decoration: none;
}
a:hover {
  color: var(--loh-hunter-green-dark);
}

/* ── Typography ── */
.loh-heading-1 {
  font-size: var(--loh-font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--loh-text-primary);
}
.loh-heading-2 {
  font-size: var(--loh-font-size-xl);
  font-weight: 600;
  color: var(--loh-text-primary);
}
.loh-heading-3 {
  font-size: var(--loh-font-size-lg);
  font-weight: 600;
  color: var(--loh-text-primary);
}
.loh-label {
  font-size: var(--loh-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--loh-text-muted);
}
.loh-text-gold {
  color: var(--loh-champagne-gold);
}
.loh-text-green {
  color: var(--loh-hunter-green);
}
.loh-text-muted {
  color: var(--loh-text-muted);
}

/* ── Layout: Sidebar + Content ── */
.loh-app {
  display: flex;
  min-height: 100vh;
}

.loh-sidebar {
  width: var(--loh-sidebar-width);
  background: var(--loh-bg-sidebar);
  color: var(--loh-text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--loh-transition);
  overflow-x: hidden;
}

.loh-sidebar__logo {
  padding: var(--loh-space-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.loh-sidebar__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--loh-champagne-gold);
  color: var(--loh-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.loh-sidebar__logo-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--loh-text-inverse);
}
.loh-sidebar__logo-text {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: 1px;
}

.loh-sidebar__nav {
  flex: 1;
  padding: var(--loh-space-md) 0;
  overflow-y: auto;
}

.loh-sidebar__section-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  padding: var(--loh-space-lg) var(--loh-space-lg) var(--loh-space-sm);
}

.loh-nav-item {
  display: flex;
  align-items: center;
  gap: var(--loh-space-sm);
  padding: 10px var(--loh-space-lg);
  color: rgba(255,255,255,0.7);
  font-size: var(--loh-font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--loh-transition);
  border-left: 3px solid transparent;
}
.loh-nav-item:hover {
  background: var(--loh-bg-sidebar-hover);
  color: var(--loh-text-inverse);
}
.loh-nav-item.active {
  background: var(--loh-bg-sidebar-active);
  color: var(--loh-text-inverse);
  border-left-color: var(--loh-champagne-gold);
}
.loh-nav-item svg,
.loh-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}
.loh-nav-item.active svg,
.loh-nav-item.active .nav-icon {
  opacity: 1;
}

.loh-sidebar__footer {
  padding: var(--loh-space-md) var(--loh-space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.loh-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--loh-space-sm);
  font-size: var(--loh-font-size-sm);
  color: rgba(255,255,255,0.7);
}
.loh-sidebar__user-avatar {
  width: 32px;
  height: 32px;
  background: var(--loh-champagne-gold);
  color: var(--loh-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--loh-font-size-sm);
}
.loh-sidebar__logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: var(--loh-font-size-xs);
  font-family: var(--loh-font);
  margin-left: auto;
  padding: 4px 8px;
  transition: color var(--loh-transition);
}
.loh-sidebar__logout:hover {
  color: var(--loh-text-inverse);
}

.loh-main {
  flex: 1;
  margin-left: var(--loh-sidebar-width);
  min-height: 100vh;
}

.loh-content {
  padding: var(--loh-space-xl);
  max-width: var(--loh-content-max-width);
}

/* ── Page Header ── */
.loh-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--loh-space-xl);
  flex-wrap: wrap;
  gap: var(--loh-space-md);
}
.loh-page-header h1 {
  font-size: var(--loh-font-size-xl);
  font-weight: 700;
  color: var(--loh-text-primary);
}
.loh-page-header .loh-subtitle {
  font-size: var(--loh-font-size-sm);
  color: var(--loh-text-muted);
  margin-top: 2px;
}

/* ── Cards ── */
.loh-card {
  background: var(--loh-bg-card);
  border: 1px solid var(--loh-border);
  padding: var(--loh-space-lg);
  transition: box-shadow var(--loh-transition);
}
.loh-card:hover {
  box-shadow: var(--loh-shadow-sm);
}
.loh-card__title {
  font-size: var(--loh-font-size-sm);
  font-weight: 600;
  color: var(--loh-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--loh-space-sm);
}

/* Metric cards */
.loh-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--loh-space-md);
  margin-bottom: var(--loh-space-xl);
}
.loh-metric {
  background: var(--loh-bg-card);
  border: 1px solid var(--loh-border);
  padding: var(--loh-space-lg);
  text-align: center;
}
.loh-metric__value {
  font-size: var(--loh-font-size-2xl);
  font-weight: 700;
  color: var(--loh-hunter-green);
  line-height: 1;
}
.loh-metric__label {
  font-size: var(--loh-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--loh-text-muted);
  margin-top: var(--loh-space-xs);
}
.loh-metric--gold .loh-metric__value { color: var(--loh-champagne-gold); }
.loh-metric--danger .loh-metric__value { color: var(--loh-danger); }
.loh-metric--success .loh-metric__value { color: var(--loh-success); }

/* ── Tables ── */
.loh-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--loh-border);
}
.loh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--loh-font-size-sm);
}
.loh-table th {
  background: var(--loh-bg-primary);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: var(--loh-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--loh-text-secondary);
  border-bottom: 2px solid var(--loh-border);
  white-space: nowrap;
}
.loh-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--loh-border-light);
  color: var(--loh-text-primary);
}
.loh-table tr:hover {
  background: #F9FAFB;
}

/* ── Buttons ── */
.loh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--loh-font);
  font-size: var(--loh-font-size-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--loh-transition);
  border: none;
  text-transform: uppercase;
}
.loh-btn--primary {
  background: var(--loh-hunter-green);
  color: var(--loh-text-inverse);
}
.loh-btn--primary:hover {
  background: var(--loh-hunter-green-dark);
}
.loh-btn--outline {
  background: transparent;
  color: var(--loh-hunter-green);
  border: 1px solid var(--loh-hunter-green);
}
.loh-btn--outline:hover {
  background: var(--loh-hunter-green);
  color: var(--loh-text-inverse);
}
.loh-btn--gold {
  background: var(--loh-champagne-gold);
  color: var(--loh-text-inverse);
}
.loh-btn--gold:hover {
  background: var(--loh-gold-light);
}
.loh-btn--sm {
  padding: 6px 12px;
  font-size: var(--loh-font-size-xs);
}
.loh-btn--danger {
  background: var(--loh-danger);
  color: var(--loh-text-inverse);
}

/* ── Forms ── */
.loh-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--loh-border);
  font-family: var(--loh-font);
  font-size: var(--loh-font-size-md);
  color: var(--loh-text-primary);
  transition: border-color var(--loh-transition);
}
.loh-input:focus {
  outline: none;
  border-color: var(--loh-hunter-green);
  box-shadow: 0 0 0 3px rgba(51,87,73,0.1);
}
.loh-input--sm {
  padding: 8px 10px;
  font-size: var(--loh-font-size-sm);
}
.loh-select {
  appearance: none;
  background: var(--loh-bg-card) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2363676B' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px;
}

/* ── Badges ── */
.loh-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--loh-font-size-xs);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.loh-badge--green {
  background: #E8F4F0;
  color: var(--loh-hunter-green);
}
.loh-badge--gold {
  background: var(--loh-cream);
  color: var(--loh-champagne-gold);
}
.loh-badge--red {
  background: #FDF2F3;
  color: var(--loh-danger);
}
.loh-badge--gray {
  background: #F3F4F6;
  color: var(--loh-cool-gray);
}

/* ── Grid System ── */
.loh-grid {
  display: grid;
  gap: var(--loh-space-md);
}
.loh-grid--2 { grid-template-columns: repeat(2, 1fr); }
.loh-grid--3 { grid-template-columns: repeat(3, 1fr); }
.loh-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ── Utility ── */
.loh-divider {
  height: 1px;
  background: var(--loh-border);
  margin: var(--loh-space-lg) 0;
}
.loh-gold-accent {
  height: 2px;
  background: linear-gradient(90deg, var(--loh-champagne-gold), var(--loh-gold-light), var(--loh-champagne-gold));
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .loh-sidebar {
    width: 0;
    transform: translateX(-100%);
  }
  .loh-sidebar.open {
    width: var(--loh-sidebar-width);
    transform: translateX(0);
  }
  .loh-main {
    margin-left: 0;
  }
  .loh-content {
    padding: var(--loh-space-md);
  }
  .loh-metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .loh-grid--2,
  .loh-grid--3,
  .loh-grid--4 {
    grid-template-columns: 1fr;
  }
  .loh-mobile-menu-btn {
    display: flex !important;
  }
}

/* Mobile menu button (hidden on desktop) */
.loh-mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 101;
  background: var(--loh-hunter-green);
  color: var(--loh-text-inverse);
  border: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
}

/* Sidebar overlay on mobile */
.loh-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.loh-sidebar-overlay.active {
  display: block;
}
