/* ==========================================================================
   BioCore Platform - Core Design System & Layout Styles
   ========================================================================== */

:root {
    /* Color Palette */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    
    --secondary: #4f46e5;
    --secondary-hover: #4338ca;
    --secondary-light: #eef2ff;

    --teal: #0d9488;
    --teal-light: #ccfbf1;

    --emerald: #10b981;
    --emerald-light: #d1fae5;

    --amber: #f59e0b;
    --amber-light: #fef3c7;

    --rose: #f43f5e;
    --rose-light: #ffe4e6;

    --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;
    --slate-950: #080d1a;

    /* Semantic Aliases */
    --bg-main: var(--slate-50);
    --bg-card: #ffffff;
    --border-color: var(--slate-200);
    --text-heading: var(--slate-900);
    --text-body: var(--slate-600);
    --text-muted: var(--slate-400);

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Elevation & Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Geometry */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: var(--transition);
}

input, select, textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
}

/* Utility Classes */
.hidden { display: none !important; }
.text-emerald { color: var(--emerald); }
.text-teal { color: var(--teal); }
.text-sky { color: var(--primary); }
.text-amber { color: var(--amber); }
.text-rose { color: var(--rose); }
.bg-emerald-light { background-color: var(--emerald-light); }
.bg-amber-light { background-color: var(--amber-light); }
.bg-rose-light { background-color: var(--rose-light); }
.bg-sky-light { background-color: var(--primary-light); }

/* ==========================================================================
   ROLE SWITCHER BAR (TOP PERSISTENT HEADER)
   ========================================================================== */

.role-switcher-bar {
    background: var(--slate-900);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--slate-800);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Role Nav Pills */
.role-selector-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--slate-950);
    padding: 0.35rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-800);
    overflow-x: auto;
    scrollbar-width: none;
}

.role-selector-nav::-webkit-scrollbar {
    display: none;
}

.role-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    color: var(--slate-400);
    font-size: 0.825rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

.role-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.role-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.role-pill i {
    font-size: 0.9rem;
}

/* Right System Controls */
.system-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--slate-800);
    color: var(--slate-300);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--slate-700);
    color: #ffffff;
}

.badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--rose);
    border-radius: var(--radius-full);
    box-shadow: 0 0 6px var(--rose);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--slate-800);
}

.avatar-img {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.1;
}

.user-role-tag {
    font-size: 0.7rem;
    color: var(--teal);
    font-weight: 500;
}

/* ==========================================================================
   MAIN CONTENT LAYOUT & PANELS
   ========================================================================== */

.app-main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.role-panel {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Panel Section Headers */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-title-group h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.panel-title-group p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Metrics Dashboard Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--slate-300);
}

.metric-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.metric-data {
    display: flex;
    flex-direction: column;
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
}

.metric-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}

.metric-trend {
    font-size: 0.725rem;
    font-weight: 600;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.metric-trend.up { color: var(--emerald); }
.metric-trend.down { color: var(--rose); }

/* Dashboard Two-Column Grid */
.dashboard-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Common Card Container */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-title-bar h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
