:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --medical-blue: #0284c7;
    --dark: #0f172a;
    --slate: #334155;
    --slate-light: #64748b;
    --bg-body: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--dark);
    font-size: 0.875rem;
    overflow-x: hidden;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background-color: #0f172a;
    color: #94a3b8;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-right: 1px solid #1e293b;
}

.admin-sidebar .brand-logo {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #1e293b;
}

.admin-sidebar .nav-link {
    color: #94a3b8;
    padding: 0.7rem 1.25rem;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    margin: 0.15rem 0.75rem;
    transition: all 0.2s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #ffffff;
    background-color: #059669;
}

.admin-sidebar .nav-link i {
    width: 1.5rem;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.admin-sidebar .sidebar-heading {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 1rem 1.5rem 0.35rem;
    font-weight: 700;
}

/* Main Content Wrapper */
.admin-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 990;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-content {
    padding: 1.5rem;
    flex: 1;
}

/* Card Styling */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
}

/* KPI Metric Cards */
.kpi-card {
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status Badges */
.badge-status {
    padding: 0.35em 0.7em;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 0.375rem;
    display: inline-block;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-rx-under-review { background: #e0f2fe; color: #0369a1; }
.status-rx-rejected { background: #fee2e2; color: #b91c1c; }
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-invoiced { background: #ede9fe; color: #5b21b6; }
.status-packed { background: #ffedd5; color: #9a3412; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-out-for-delivery { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-cancelled { background: #f1f5f9; color: #475569; }
.status-refunded { background: #fce7f3; color: #9d174d; }

/* Prescription Split Screen Viewer */
.rx-viewer-container {
    background: #0f172a;
    border-radius: 0.75rem;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.rx-viewer-image {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

/* Migration Terminal Box */
.terminal-box {
    background: #090d16;
    color: #38bdf8;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #1e293b;
    line-height: 1.6;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        margin-left: -260px;
    }
    .admin-sidebar.show {
        margin-left: 0;
    }
    .admin-main {
        margin-left: 0;
    }
}
