/**
 * FDA Products Management System - Professional Design System
 * A modern, unique, and consistent UI framework
 * Version 2.0
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */
:root {
    /* Brand Colors - Deep Teal & Gold Accent */
    --brand-primary: #0d9488;
    --brand-primary-light: #14b8a6;
    --brand-primary-dark: #0f766e;
    --brand-primary-50: #f0fdfa;
    --brand-primary-100: #ccfbf1;
    --brand-primary-200: #99f6e4;
    --brand-primary-500: #14b8a6;
    --brand-primary-600: #0d9488;
    --brand-primary-700: #0f766e;
    --brand-primary-800: #115e59;
    --brand-primary-900: #134e4a;
    
    /* Accent Color - Warm Gold */
    --accent-gold: #f59e0b;
    --accent-gold-light: #fbbf24;
    --accent-gold-dark: #d97706;
    
    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f4f4f5;
    --neutral-200: #e4e4e7;
    --neutral-300: #d4d4d8;
    --neutral-400: #a1a1aa;
    --neutral-500: #71717a;
    --neutral-600: #52525b;
    --neutral-700: #3f3f46;
    --neutral-800: #27272a;
    --neutral-900: #18181b;
    
    /* Semantic Colors */
    --success: #22c55e;
    --success-light: #dcfce7;
    --success-dark: #16a34a;
    --warning: #eab308;
    --warning-light: #fef9c3;
    --warning-dark: #ca8a04;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #2563eb;
    
    /* Background Colors */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #134e4a 0%, #0f766e 50%, #115e59 100%);
    --bg-topbar: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --text-link: var(--brand-primary);
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    --border-focus: var(--brand-primary);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.15);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;
    --content-max-width: 1400px;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-sidebar: 400;
    --z-modal-backdrop: 500;
    --z-modal: 600;
    --z-tooltip: 700;
    --z-toast: 800;
}

/* ========================================
   BASE RESET & TYPOGRAPHY
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-bottom: var(--space-4); }

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--brand-primary-dark); }

/* ========================================
   LAYOUT SYSTEM
   ======================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), width var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.sidebar-brand-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-brand-icon i {
    font-size: 1.5rem;
    color: var(--text-inverse);
}

.sidebar-brand-text h2 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-inverse);
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand-text p {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4) 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    padding: var(--space-2) var(--space-6);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-inverse);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-inverse);
    border-left-color: var(--accent-gold);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-link i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-gold);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.sidebar-user-info h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-inverse);
    margin: 0;
}

.sidebar-user-info p {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-xs);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.topbar-title h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0;
}

.topbar-title p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    width: 280px;
    padding: var(--space-2) var(--space-4);
    padding-left: var(--space-10);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    background: var(--neutral-50);
    transition: all var(--transition-fast);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.topbar-search i {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.topbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.topbar-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-topbar);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.topbar-user:hover {
    background: var(--bg-hover);
}

.topbar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 600;
    font-size: var(--text-sm);
}

.topbar-user-info {
    text-align: left;
}

.topbar-user-info h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.topbar-user-info p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    padding: var(--space-8);
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-8);
}

.page-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.page-header h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: var(--space-3);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--brand-primary);
}

.breadcrumb span {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}
