/* =========================================================
   SIMFAR DESIGN SYSTEM
   Clean Healthcare / Pharmacy UI
   ========================================================= */

:root {
    --simfar-teal: #124f57;
    --simfar-teal-dark: #0d4249;
    --simfar-teal-soft: #e8f4f3;

    --primary: #0066cc;
    --primary-soft: #eaf3ff;

    --pharmacy: #00a86b;
    --pharmacy-soft: #e9f8f2;

    --warning: #f59e0b;
    --warning-soft: #fff6df;

    --danger: #ef4444;
    --danger-soft: #fff0f0;

    --purple: #7c5ce0;
    --purple-soft: #f2edff;

    --bg: #f5f7f8;
    --surface: #ffffff;
    --border: #e3e8ec;

    --text: #18313a;
    --text-secondary: #5f7078;
    --text-muted: #87959c;

    --radius: 14px;
    --shadow: 0 3px 14px rgba(20, 45, 55, .06);
}

/* Base */
html, body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    font-size: 14px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

button, input, select, textarea {
    font: inherit;
}

a {
    color: inherit;
}

/* Sidebar overrides */
.simfar-sidebar,
.simfar-sidebar * {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.simfar-sidebar {
    background: var(--simfar-teal) !important;
    color: #fff !important;
}

.simfar-sidebar a,
.simfar-sidebar .nav-link,
.simfar-sidebar .menu-item {
    color: rgba(255,255,255,.92) !important;
    text-decoration: none !important;
}

.simfar-sidebar a:hover,
.simfar-sidebar .nav-link:hover,
.simfar-sidebar .menu-item:hover {
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
}

.simfar-sidebar .active,
.simfar-sidebar .nav-link.active,
.simfar-sidebar .menu-item.active {
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
    border-left-color: #f4df35 !important;
}

.simfar-sidebar svg {
    color: currentColor !important;
}

/* Main */
.simfar-dashboard {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 28px 32px 42px;
}

.page-header.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 15px;
}

.breadcrumb svg {
    width: 15px;
    height: 15px;
}

.breadcrumb strong {
    color: var(--text);
}

.page-title {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.4px;
}

.page-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 17px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,102,204,.14);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.kpi-card {
    min-height: 154px;
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.kpi-icon,
.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 11px;
}

.kpi-icon svg,
.quick-icon svg {
    width: 21px;
    height: 21px;
}

.blue { color: var(--primary); background: var(--primary-soft); }
.green { color: var(--pharmacy); background: var(--pharmacy-soft); }
.warning { color: var(--warning); background: var(--warning-soft); }
.danger { color: var(--danger); background: var(--danger-soft); }
.purple { color: var(--purple); background: var(--purple-soft); }
.amber { color: #d99000; background: var(--warning-soft); }

.kpi-label {
    margin-top: 13px;
    color: var(--text-secondary);
    font-size: 13px;
}

.kpi-value {
    margin-top: 3px;
    color: var(--text);
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.5px;
}

.kpi-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 600;
}

.kpi-meta svg {
    width: 14px;
    height: 14px;
}

.positive { color: var(--pharmacy); }
.warning-text { color: var(--warning); }
.danger-text { color: var(--danger); }

/* Panels */
.dashboard-main-grid,
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, .95fr);
    gap: 16px;
    margin-bottom: 18px;
}

.panel {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 70px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.3;
    font-weight: 650;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.panel-body {
    padding: 20px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--bg);
    color: var(--text);
}

.icon-button svg {
    width: 19px;
    height: 19px;
}

/* Chart placeholder */
.chart-placeholder {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    text-align: center;
}

.chart-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 5px;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft);
}

.chart-empty-icon svg {
    width: 25px;
    height: 25px;
}

.chart-empty strong {
    color: var(--text-secondary);
    font-size: 13px;
}

.chart-empty span {
    font-size: 12px;
}

/* Quick actions */
.quick-list {
    padding: 4px 20px 8px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.quick-action:last-child {
    border-bottom: 0;
}

.quick-action:hover .quick-text strong {
    color: var(--primary);
}

.quick-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.quick-icon svg {
    width: 19px;
    height: 19px;
}

.quick-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.quick-text strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.quick-text small {
    color: var(--text-muted);
    font-size: 11px;
}

.quick-arrow {
    width: 17px;
    height: 17px;
    color: #9aa8ae;
}

/* Bottom */
.dashboard-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.empty-state {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    width: 20px;
    height: 20px;
    color: #9aabb2;
}

/* Topbar / header text */
.simfar-topbar,
.simfar-topbar * {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.simfar-topbar {
    background: #fff !important;
    border-bottom: 1px solid var(--border) !important;
}

.simfar-topbar input {
    color: var(--text) !important;
}

/* =========================================================
   SIMFAR SIDEBAR — FINAL VISUAL SYSTEM
   ========================================================= */

:root {
    --simfar-sidebar-bg: #0F4F56;
    --simfar-sidebar-bg-dark: #0B4249;
    --simfar-sidebar-active: #176B72;
    --simfar-sidebar-hover: #155F66;

    --simfar-sidebar-text: #F4FAFA;
    --simfar-sidebar-muted: #B8D2D4;
    --simfar-sidebar-section: #8FB7BA;

    --simfar-sidebar-border: rgba(255,255,255,.10);

    --simfar-accent-blue: #0066CC;
    --simfar-accent-green: #00A86B;

    --simfar-radius: 9px;
}


/* =========================================================
   SIDEBAR CONTAINER
   ========================================================= */

.simfar-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    width: 240px;
    min-width: 240px;

    display: flex;
    flex-direction: column;

    background: var(--simfar-sidebar-bg);
    color: var(--simfar-sidebar-text);

    border-right: 1px solid var(--simfar-sidebar-border);

    z-index: 1000;

    overflow: hidden;
}


/* =========================================================
   BRAND
   ========================================================= */

.sidebar-brand {
    min-height: 118px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 20px 18px;

    border-bottom: 1px solid var(--simfar-sidebar-border);
}


.brand-logo {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}


.brand-logo img {
    width: 42px;
    height: 42px;

    object-fit: contain;
}


.brand-text {
    min-width: 0;
}


.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .4px;

    color: #FFFFFF;
}


.brand-subtitle {
    margin-top: 3px;

    font-size: 11px;
    line-height: 1.45;

    color: var(--simfar-sidebar-muted);
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.sidebar-nav {
    flex: 1;

    padding: 14px 10px;

    overflow-y: auto;
    overflow-x: hidden;
}


/* scrollbar */

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 10px;
}


/* =========================================================
   SECTION TITLE
   ========================================================= */

.nav-section-title {
    margin: 17px 10px 7px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .9px;

    color: var(--simfar-sidebar-section);
}


/* =========================================================
   NAV ITEM
   ========================================================= */

.sidebar-nav .nav-item {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-height: 43px;

    padding: 9px 11px;

    margin: 2px 0;

    gap: 11px;

    border-radius: var(--simfar-radius);

    color: var(--simfar-sidebar-text);

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition:
        background .18s ease,
        color .18s ease,
        transform .18s ease;
}


/* icon */

.sidebar-nav .nav-icon {
    width: 21px;
    height: 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: #E7F5F5;
}


.sidebar-nav .nav-icon svg {
    width: 20px;
    height: 20px;

    stroke-width: 2.2;
}


/* label */

.sidebar-nav .nav-label {
    flex: 1;

    white-space: nowrap;

    color: inherit;
}


/* hover */

.sidebar-nav .nav-item:hover {
    background: var(--simfar-sidebar-hover);

    color: #FFFFFF;
}


/* active */

.sidebar-nav .nav-item.active {
    background: var(--simfar-sidebar-active);

    color: #FFFFFF;

    font-weight: 650;
}


/* active indicator */

.sidebar-nav .nav-item.active::before {
    content: "";

    position: absolute;

    left: 0;
    top: 8px;
    bottom: 8px;

    width: 3px;

    background: #7BE0C2;

    border-radius: 0 4px 4px 0;
}


/* active icon */

.sidebar-nav .nav-item.active .nav-icon {
    color: #FFFFFF;
}


/* =========================================================
   BADGE
   ========================================================= */

.nav-badge {
    min-width: 20px;
    height: 20px;

    padding: 0 6px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #E85D5D;
    color: #FFFFFF;

    font-size: 10px;
    font-weight: 700;
}


/* =========================================================
   FOOTER
   ========================================================= */

.sidebar-footer {
    padding: 12px 10px 14px;

    border-top: 1px solid var(--simfar-sidebar-border);

    background: var(--simfar-sidebar-bg-dark);
}


/* =========================================================
   USER CARD
   ========================================================= */

.sidebar-user-card {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px;

    margin-bottom: 7px;

    border-radius: var(--simfar-radius);

    background: rgba(255,255,255,.07);
}


.sidebar-user-avatar {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #D8F2EA;
    color: #0F5960;

    font-size: 12px;
    font-weight: 700;
}


.sidebar-user-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.sidebar-user-info strong {
    font-size: 12px;
    line-height: 1.3;

    color: #FFFFFF;
}


.sidebar-user-info span {
    margin-top: 2px;

    font-size: 10px;
    line-height: 1.3;

    color: var(--simfar-sidebar-muted);
}


/* =========================================================
   LOGOUT
   ========================================================= */

.logout-link {
    display: flex;
    align-items: center;

    gap: 10px;

    min-height: 39px;

    padding: 8px 11px;

    border-radius: var(--simfar-radius);

    color: #F6B4B4;

    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    transition:
        background .18s ease,
        color .18s ease;
}


.logout-icon {
    width: 21px;
    height: 21px;

    display: flex;
    align-items: center;
    justify-content: center;
}


.logout-icon svg {
    width: 19px;
    height: 19px;

    stroke-width: 2.2;
}


.logout-link:hover {
    background: rgba(232,93,93,.14);

    color: #FF8E8E;
}


/* =========================================================
   MAIN AREA ALIGNMENT
   ========================================================= */

.simfar-main {
    margin-left: 240px;

    min-height: 100vh;

    width: calc(100% - 240px);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .simfar-sidebar {
        width: 240px;
        min-width: 240px;

        transform: translateX(-100%);

        transition: transform .25s ease;
    }

    .simfar-sidebar.open {
        transform: translateX(0);
    }

    .simfar-main {
        margin-left: 0;

        width: 100%;
    }
}

/* =========================================================
   SIMFAR FOOTER FIX
   ========================================================= */

.simfar-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

.simfar-content {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.simfar-footer {
    width: 100%;
    box-sizing: border-box;
    margin: 0;

    padding: 18px 32px 22px 120px;

    color: #7a8995;
    font-size: 11px;
    line-height: 1.5;

    text-align: left;

    border-top: 1px solid #e7edf1;
    background: transparent;
}

@media (max-width: 768px) {

    .simfar-footer {
        padding: 16px 18px 20px;
    }

}