/* ============================
   SHARED DESIGN SYSTEM
   MediCore Platform
   ============================ */

:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --primary-bg: #EFF6FF;
    --secondary: #14B8A6;
    --secondary-light: #2DD4BF;
    --secondary-bg: #F0FDFA;
    --accent: #F97316;
    --accent-bg: #FFF7ED;
    --alert: #EF4444;
    --alert-bg: #FEF2F2;
    --success: #22C55E;
    --success-bg: #F0FDF4;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --purple: #8B5CF6;
    --purple-bg: #F5F3FF;
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.10), 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --gradient-primary: linear-gradient(135deg, #2563EB 0%, #14B8A6 100%);
    --gradient-hero: linear-gradient(135deg, #0F172A 0%, #1e3a5f 50%, #0d3343 100%);
    --gradient-card: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
    --sidebar-width: 260px;
    --navbar-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-full);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-teal {
    background: linear-gradient(135deg, #14B8A6, #0D9488);
    color: white;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================
   CARDS
   ============================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ============================
   BADGES / STATUS
   ============================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: #16A34A;
}

.badge-warning {
    background: var(--warning-bg);
    color: #D97706;
}

.badge-danger {
    background: var(--alert-bg);
    color: #DC2626;
}

.badge-info {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-live {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================
   LIVE INDICATORS
   ============================ */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.live-pulse {
    width: 6px;
    height: 6px;
    background: #EF4444;
    border-radius: 50%;
    animation: live-anim 1.2s infinite;
    display: inline-block;
}

@keyframes live-anim {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

/* ============================
   SHARED DASHBOARD LAYOUT
   ============================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--text-primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon-sm {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.sidebar-brand .brand-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.sidebar-brand .brand-text p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 10px 6px;
    margin-top: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-link .badge-count {
    margin-left: auto;
    background: var(--alert);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info h4 {
    font-size: 0.8rem;
    color: white;
    font-weight: 600;
}

.user-info p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOPBAR */
.topbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-left p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.9rem;
}

.icon-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}

.icon-btn.alert-btn {
    position: relative;
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--alert);
    border-radius: 50%;
    border: 2px solid white;
}

/* PAGE CONTENT */
.page-content {
    padding: 28px;
    flex: 1;
}

/* ============================
   METRICS CARDS
   ============================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: default;
}

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

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

.metric-icon.blue {
    background: var(--primary-bg);
    color: var(--primary);
}

.metric-icon.teal {
    background: var(--secondary-bg);
    color: var(--secondary);
}

.metric-icon.orange {
    background: var(--accent-bg);
    color: var(--accent);
}

.metric-icon.red {
    background: var(--alert-bg);
    color: var(--alert);
}

.metric-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.metric-icon.purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.metric-info .metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.metric-info .metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.metric-info .metric-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.metric-change.up {
    color: var(--success);
}

.metric-change.down {
    color: var(--alert);
}

/* ============================
   SECTION HEADERS
   ============================ */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-head p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================
   TABLES
   ============================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg);
}

/* ============================
   PROGRESS BARS
   ============================ */
.progress-bar-wrap {
    background: var(--border-light);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

/* ============================
   FORM ELEMENTS
   ============================ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

/* ============================
   STATUS INDICATORS
   ============================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.available {
    background: var(--success);
}

.status-dot.busy {
    background: var(--alert);
}

.status-dot.moderate {
    background: var(--warning);
}

/* ============================
   SCROLLBAR
   ============================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================
   GRADIENT TEXT
   ============================ */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease both;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
