/**
 * Clinetworks Premium Design System
 * Inspired by Stripe, Linear, and modern clinical SaaS.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- Colors: Refined SaaS Palette --- */
    --primary: #2563eb;         /* Modern Blue */
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-dark: #1e3a8a;
    
    --secondary: #0f172a;       /* Deep Slate */
    --secondary-hover: #1e293b;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #ecfdf5;
    --success-dark: #064e3b;
    
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --warning-dark: #78350f;
    
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-dark: #7f1d1d;

    /* Neutrals: Elegant Grays */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* --- Spacing: Golden Ratio Proportions --- */
    --space-0: 0px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* --- Radius: Premium Softness --- */
    --radius-sm: 6px;
    --radius-base: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* --- Shadows: Layered & Soft --- */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-base: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
    --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 0 5px rgba(0, 0, 0, 0.02);

    /* --- Typography: Inter Hierarchy --- */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 15px;      /* Slightly smaller for that professional app density */
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;
    --text-4xl: 36px;
    
    /* --- Layout & Layers --- */
    --sidebar-width: 280px;
    --topbar-height: 72px;
    --container-max: 100%;
    
    --z-sidebar: 1040;          /* Aligned with Bootstrap offcanvas */
    --z-topbar: 1030;           /* Aligned with Bootstrap sticky-top */
    --z-modal: 1055;
    --z-dropdown: 1000;
    --z-overlay: 1035;
    
    /* --- Transitions --- */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Accessibility & Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--slate-50);
    color: var(--slate-900);
    font-size: var(--text-base);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* --- Focus & Accessibility --- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* --- Premium Utilities --- */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.premium-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}
.premium-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.text-gradient {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Common Components Bases --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* --- Sidebar & Overlay --- */
#sidebarOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebarOverlay.active {
    display: block;
    opacity: 1;
}

body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
}

/* Row-to-Card Table Pattern (Global) */
@media (max-width: 768px) {
    .fc-table-mobile-card thead { display: none; }
    .fc-table-mobile-card tr {
        display: block;
        background: white;
        border: 1px solid var(--slate-200);
        border-radius: var(--radius-lg);
        padding: var(--space-4);
        margin-bottom: var(--space-4);
        box-shadow: var(--shadow-sm);
    }
    .fc-table-mobile-card td {
        display: flex;
        justify-content: space-between;
        padding: var(--space-2) 0;
        border-bottom: 1px solid var(--slate-100);
        font-size: var(--text-sm);
    }
    .fc-table-mobile-card td:last-child { border-bottom: none; }
    .fc-table-mobile-card td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--slate-500);
        margin-right: var(--space-4);
        text-transform: uppercase;
        font-size: 10px;
    }
}
