/* ===== PharmaFlow Design System ===== */
:root {
    /* Colors */
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #4834d4;
    --accent: #00cec9;
    --accent-light: #81ecec;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --info: #74b9ff;

    /* Surfaces */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255,255,255,0.75);
    --bg-glass: rgba(255,255,255,0.55);
    --bg-sidebar: rgba(255,255,255,0.9);

    /* Text */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;
    --text-inverse: #ffffff;

    /* Borders */
    --border-light: rgba(0,0,0,0.06);
    --border-glass: rgba(255,255,255,0.3);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px rgba(108,92,231,0.15);

    /* Spacing */
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

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

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30,30,50,0.75);
    --bg-glass: rgba(30,30,50,0.6);
    --bg-sidebar: rgba(20,20,40,0.95);
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #5a5a7a;
    --border-light: rgba(255,255,255,0.06);
    --border-glass: rgba(255,255,255,0.08);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(108,92,231,0.25);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s var(--ease), color 0.3s var(--ease);
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(108,92,231,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0,206,201,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(162,155,254,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

/* ===== Utilities ===== */
.hidden { display: none !important; }

.screen { display: none; min-height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; }

/* ===== Glass Card ===== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.glass-card:hover { box-shadow: var(--shadow-lg); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}
.btn i { font-size: 0.85em; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(108,92,231,0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    opacity: 0.5; cursor: not-allowed;
    transform: none !important; box-shadow: none !important;
}
.btn-outline {
    border: 1.5px solid var(--border-light);
    color: var(--text-secondary);
    background: var(--bg-glass);
}
.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: rgba(108,92,231,0.05);
}
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 1.1rem;
    transition: all 0.25s var(--ease);
}
.btn-icon:hover {
    background: rgba(108,92,231,0.1);
    color: var(--primary);
}
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.form-group label i { color: var(--primary-light); font-size: 0.8em; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

input[type="text"], input[type="number"], input[type="password"],
input[type="date"], select, .text-input, .date-input, .select-input {
    padding: 12px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.25s var(--ease);
    outline: none;
    width: 100%;
}
input:focus, select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}
input::placeholder { color: var(--text-muted); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Print ===== */
@media print {
    .sidebar, .mobile-header, .sidebar-overlay, .toast-container,
    .btn, .filter-bar, .report-controls { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .glass-card { background: #fff !important; box-shadow: none !important; border: 1px solid #ddd !important; }
    body::before { display: none; }
}
