/* OA Client Dashboard - Shared Styles */
:root {
  --oa-blue: #0c4da2;
  --oa-blue-light: #48A7DB;
  --oa-blue-dark: #362456;
  --oa-teal: #48A7DB;
  --oa-teal-light: #6BB9E4;
  --oa-teal-dark: #2E8BC0;
  --oa-orange: #FDC329;
  --oa-orange-light: #FAC538;
  --oa-orange-dark: #e5ab00;
  --oa-white: #FFFFFF;
  --oa-gray-50: #F9FAFB;
  --oa-gray-100: #F3F4F6;
  --oa-gray-200: #E5E7EB;
  --oa-gray-300: #D1D5DB;
  --oa-gray-400: #9CA3AF;
  --oa-gray-500: #6B7280;
  --oa-gray-600: #4B5563;
  --oa-gray-700: #374151;
  --oa-gray-800: #1F2937;
  --oa-gray-900: #111827;
  --oa-success: #10B981;
  --oa-warning: #F59E0B;
  --oa-danger: #EF4444;
  --gradient-primary: linear-gradient(135deg, #362456 0%, #0c4da2 40%, #48A7DB 100%);
  --gradient-sidebar: linear-gradient(180deg, #1a1035 0%, #362456 50%, #1B3B6F 100%);
  --gradient-card: linear-gradient(135deg, rgba(72,167,219,0.05) 0%, rgba(54,36,86,0.05) 100%);
  --gradient-accent: linear-gradient(135deg, #48A7DB 0%, #0c4da2 100%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 150ms ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--oa-gray-800);
  background: var(--oa-gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--oa-blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--oa-blue-light);
}

/* ============ AUTH PAGES (Login, Register, Reset) ============ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72,167,219,0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 8s ease-in-out infinite;
}
.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253,195,41,0.1) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo img {
  height: 48px;
  margin-bottom: 12px;
}
.auth-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--oa-blue);
  letter-spacing: -0.5px;
}
.auth-logo-sub {
  font-size: 13px;
  color: var(--oa-gray-500);
  margin-top: 4px;
}

.auth-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--oa-gray-900);
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--oa-gray-700);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--oa-gray-300);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--oa-gray-800);
  background: var(--oa-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus {
  border-color: var(--oa-teal);
  box-shadow: 0 0 0 3px rgba(72,167,219,0.15);
}
.form-group input::placeholder {
  color: var(--oa-gray-400);
}
.form-group .hint {
  font-size: 12px;
  color: var(--oa-gray-500);
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--gradient-accent);
  color: var(--oa-white);
  width: 100%;
  border: none;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  box-shadow: 0 4px 15px rgba(72,167,219,0.4);
  transform: translateY(-1px);
  color: var(--oa-white);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary:hover::after {
  opacity: 1;
}
.btn-primary:disabled {
  background: var(--oa-gray-300);
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--oa-gray-100);
  color: var(--oa-gray-700);
}
.btn-secondary:hover {
  background: var(--oa-gray-200);
}
.btn-orange {
  background: var(--oa-orange);
  color: var(--oa-white);
}
.btn-orange:hover {
  background: var(--oa-orange-dark);
  color: var(--oa-white);
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--oa-gray-500);
}
.auth-links a {
  color: var(--oa-orange);
  font-weight: 500;
}
.auth-links a:hover {
  color: var(--oa-orange-dark);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}
.alert.show {
  display: block;
}
.alert-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.alert-success {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--oa-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--gradient-sidebar);
  color: var(--oa-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--oa-white);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img {
  height: 32px;
  border-radius: 4px;
}
.sidebar-company {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 6px;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--oa-white);
}
.sidebar-nav-item.active {
  background: rgba(72, 167, 219, 0.15);
  color: var(--oa-white);
  border-left-color: var(--oa-teal);
}
.sidebar-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-section-title {
  padding: 20px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--oa-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--oa-white);
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--oa-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.sidebar-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.sidebar-logout:hover {
  background: rgba(255,255,255,0.1);
  color: var(--oa-white);
}

/* Mobile hamburger */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--gradient-sidebar);
  z-index: 101;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.hamburger {
  background: none;
  border: none;
  color: var(--oa-white);
  cursor: pointer;
  padding: 4px;
}
.hamburger svg {
  width: 24px;
  height: 24px;
}
.mobile-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--oa-white);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.main-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--oa-gray-900);
}
.main-subtitle {
  font-size: 14px;
  color: var(--oa-gray-500);
  margin-top: 4px;
}

/* Dashboard Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--oa-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--oa-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--oa-gray-900);
  margin: 8px 0 4px;
}
.stat-card-detail {
  font-size: 13px;
  color: var(--oa-gray-500);
}

/* Dashboard Sections */
.dashboard-section {
  background: var(--oa-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}
.section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--oa-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--oa-gray-900);
}
.section-body {
  padding: 24px;
}

/* Timeline */
.timeline {
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--oa-gray-200);
}
.timeline-item {
  position: relative;
  padding-left: 32px;
  padding-bottom: 24px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--oa-blue);
  border: 3px solid var(--oa-white);
  box-shadow: 0 0 0 2px var(--oa-blue);
}
.timeline-date {
  font-size: 12px;
  color: var(--oa-gray-400);
  font-weight: 500;
  margin-bottom: 4px;
}
.timeline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--oa-gray-800);
  margin-bottom: 4px;
}
.timeline-desc {
  font-size: 14px;
  color: var(--oa-gray-500);
  line-height: 1.5;
}

/* Metrics row */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.metric-item {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--oa-gray-50);
}
.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--oa-blue);
}
.metric-label {
  font-size: 13px;
  color: var(--oa-gray-500);
  margin-top: 4px;
}
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
}
.metric-trend.up {
  color: #166534;
  background: #DCFCE7;
}
.metric-trend.down {
  color: #991B1B;
  background: #FEE2E2;
}
.metric-trend.stable {
  color: #92400E;
  background: #FEF3C7;
}

/* Loading state */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--oa-gray-400);
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--oa-gray-200);
  border-top-color: var(--oa-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-content {
    margin-left: 0;
    padding: 72px 16px 24px;
  }
  .auth-card {
    padding: 28px 24px;
  }
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-card-value {
    font-size: 22px;
  }
  .main-title {
    font-size: 20px;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
