/* ============================================================
   PHARMACY MANAGEMENT SYSTEM
   Main Enterprise UI Styles
   Copyright © 2026 Makini Tech Solution
   ============================================================ */

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #ccfbf1;

    --secondary: #334155;
    --success: #15803d;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0369a1;

    --dark: #172033;
    --dark-2: #202a3d;
    --sidebar: #111827;

    --body-bg: #f4f6f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;

    --text: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;

    --sidebar-width: 260px;
    --navbar-height: 68px;

    --radius: 8px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.10);

    --transition: 0.2s ease;
}


/* ============================================================
   GLOBAL
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    min-height: 100vh;

    background: var(--body-bg);

    color: var(--text);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;

    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}


/* ============================================================
   MAIN APPLICATION LAYOUT
   ============================================================ */

.main-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);

    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;

    padding: 24px;

    min-width: 0;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: var(--sidebar-width);
    height: 100vh;

    background: var(--sidebar);

    color: #cbd5e1;

    z-index: 1050;

    display: flex;
    flex-direction: column;

    border-right: 1px solid rgba(255, 255, 255, 0.05);

    overflow: hidden;
}


/* Sidebar Header */

.sidebar-header {
    height: 68px;

    display: flex;
    align-items: center;

    padding: 0 18px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.07);

    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 11px;

    min-width: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border-radius: 9px;

    background: var(--primary);

    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
}

.brand-text {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.brand-name {
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text small {
    margin-top: 1px;

    color: #94a3b8;

    font-size: 9px;

    white-space: nowrap;
}

.sidebar-close {
    display: none;

    margin-left: auto;

    border: 0;

    background: transparent;

    color: #94a3b8;

    font-size: 20px;
}


/* Sidebar User */

.sidebar-user {
    margin: 14px 12px;

    padding: 11px;

    background: rgba(255, 255, 255, 0.045);

    border:
        1px solid rgba(255, 255, 255, 0.06);

    border-radius: 8px;

    display: flex;
    align-items: center;

    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #334155;

    color: #e2e8f0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
}

.sidebar-user-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.sidebar-user-info strong {
    color: #f8fafc;

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    margin-top: 2px;

    color: #94a3b8;

    font-size: 10px;

    text-transform: capitalize;
}


/* Sidebar Navigation */

.sidebar-nav {
    flex: 1;

    overflow-y: auto;

    padding: 4px 10px 16px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #334155;

    border-radius: 10px;
}

.nav-section-title {
    padding: 16px 10px 7px;

    color: #64748b;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


/* Sidebar Links */

.sidebar-link {
    position: relative;

    min-height: 42px;

    margin: 2px 0;

    padding: 9px 10px;

    border-radius: 7px;

    display: flex;
    align-items: center;

    gap: 11px;

    color: #aeb9c9;

    transition:
        background var(--transition),
        color var(--transition);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.065);

    color: #ffffff;
}

.sidebar-link.active {
    background: var(--primary);

    color: #ffffff;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.15);
}

.sidebar-link.active::before {
    content: "";

    position: absolute;

    left: 0;
    top: 9px;
    bottom: 9px;

    width: 3px;

    border-radius: 0 3px 3px 0;

    background: #ffffff;
}

.sidebar-link-icon {
    width: 20px;

    flex-shrink: 0;

    text-align: center;

    font-size: 14px;
}

.sidebar-link-text {
    flex: 1;

    font-size: 12px;

    font-weight: 500;
}

.sidebar-badge {
    min-width: 19px;
    height: 19px;

    padding: 0 5px;

    border-radius: 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 9px;
    font-weight: 700;
}

.sidebar-badge.warning {
    background: #92400e;

    color: #fef3c7;
}

.pos-link {
    background: rgba(15, 118, 110, 0.18);

    color: #99f6e4;
}

.pos-link:hover {
    background: rgba(15, 118, 110, 0.30);

    color: #ffffff;
}


/* Sidebar Footer */

.sidebar-footer {
    padding: 12px 16px;

    border-top:
        1px solid rgba(255, 255, 255, 0.07);

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #64748b;

    font-size: 9px;
}

.sidebar-status {
    display: flex;
    align-items: center;

    gap: 6px;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.10);
}


/* ============================================================
   TOP NAVBAR
   ============================================================ */

.top-navbar {
    position: sticky;

    top: 0;

    height: var(--navbar-height);

    background: #ffffff;

    border-bottom: 1px solid var(--border);

    z-index: 1000;

    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
}

.navbar-left {
    min-width: 0;

    gap: 15px;
}

.navbar-right {
    gap: 12px;
}

.sidebar-toggle {
    display: none;

    width: 38px;
    height: 38px;

    border: 1px solid var(--border);

    background: #ffffff;

    color: var(--secondary);

    border-radius: 7px;
}

.navbar-page-title {
    min-width: 0;
}

.navbar-page-title h5 {
    margin: 0;

    color: var(--dark);

    font-size: 16px;
    font-weight: 700;
}

.navbar-page-title small {
    color: var(--text-muted);

    font-size: 10px;
}


/* Branch */

.navbar-branch {
    min-height: 34px;

    padding: 6px 10px;

    border:
        1px solid var(--border);

    border-radius: 6px;

    display: flex;
    align-items: center;

    gap: 7px;

    color: var(--secondary);

    font-size: 11px;

    background: #f8fafc;
}

.navbar-branch i {
    color: var(--primary);
}


/* Notification */

.navbar-notification {
    position: relative;
}

.navbar-icon-btn {
    position: relative;

    width: 38px;
    height: 38px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background: #ffffff;

    color: var(--secondary);

    transition: var(--transition);
}

.navbar-icon-btn:hover {
    background: #f8fafc;

    color: var(--primary);
}

.notification-badge {
    position: absolute;

    top: -4px;
    right: -4px;

    min-width: 17px;
    height: 17px;

    padding: 0 4px;

    border-radius: 9px;

    background: var(--danger);

    color: #ffffff;

    font-size: 8px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #ffffff;
}


/* Notification Dropdown */

.notification-dropdown {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 350px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 9px;

    box-shadow: var(--shadow-md);

    display: none;

    overflow: hidden;

    z-index: 1100;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 13px 15px;

    border-bottom: 1px solid var(--border);

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header strong {
    font-size: 13px;
}

.notification-header button {
    border: 0;

    background: transparent;

    color: var(--primary);

    font-size: 10px;
}

.notification-list {
    max-height: 350px;

    overflow-y: auto;
}

.notification-empty {
    padding: 35px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 8px;

    color: var(--text-muted);

    font-size: 11px;
}

.notification-empty i {
    font-size: 25px;

    color: #cbd5e1;
}


/* ============================================================
   USER MENU
   ============================================================ */

.navbar-user {
    position: relative;
}

.navbar-user-button {
    border: 0;

    background: transparent;

    padding: 4px;

    display: flex;
    align-items: center;

    gap: 9px;

    border-radius: 8px;
}

.navbar-user-button:hover {
    background: #f8fafc;
}

.navbar-avatar {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    background: var(--primary-light);

    color: var(--primary-dark);

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

.navbar-avatar.large {
    width: 40px;
    height: 40px;
}

.navbar-user-details {
    display: flex;
    flex-direction: column;

    align-items: flex-start;
}

.navbar-user-details strong {
    color: var(--dark);

    font-size: 11px;
}

.navbar-user-details small {
    color: var(--text-muted);

    font-size: 9px;

    text-transform: capitalize;
}

.user-chevron {
    margin-left: 2px;

    color: #94a3b8;

    font-size: 9px;
}


/* User Dropdown */

.user-dropdown {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: 240px;

    padding: 7px;

    background: #ffffff;

    border:
        1px solid var(--border);

    border-radius: 9px;

    box-shadow: var(--shadow-md);

    display: none;

    z-index: 1100;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-header {
    padding: 9px;

    display: flex;
    align-items: center;

    gap: 9px;
}

.user-dropdown-header strong,
.user-dropdown-header small {
    display: block;
}

.user-dropdown-header strong {
    font-size: 12px;
}

.user-dropdown-header small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}

.user-dropdown a {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px;

    border-radius: 6px;

    color: var(--secondary);

    font-size: 11px;
}

.user-dropdown a:hover {
    background: #f1f5f9;
}

.user-dropdown a i {
    width: 17px;

    text-align: center;

    color: var(--text-muted);
}

.user-dropdown .dropdown-logout {
    color: var(--danger);
}

.user-dropdown .dropdown-logout i {
    color: var(--danger);
}

.user-dropdown-divider {
    height: 1px;

    margin: 5px 0;

    background: var(--border);
}


/* ============================================================
   FOOTER
   ============================================================ */

.main-footer {
    min-height: 48px;

    padding: 12px 24px;

    background: #ffffff;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: var(--text-muted);

    font-size: 10px;
}

.main-footer strong {
    color: var(--secondary);

    font-weight: 700;
}

.footer-right {
    display: flex;
    align-items: center;

    gap: 8px;
}

.footer-separator {
    color: #cbd5e1;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    background: var(--card-bg);
}

.card-header {
    padding: 14px 16px;

    background: #ffffff;

    border-bottom:
        1px solid var(--border);
}

.card-body {
    padding: 16px;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    border-radius: 6px;

    font-size: 12px;

    font-weight: 600;

    padding: 8px 13px;
}

.btn-primary {
    background: var(--primary);

    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);

    border-color: var(--primary-dark);
}

.btn-success {
    background: var(--success);

    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);

    border-color: var(--danger);
}


/* ============================================================
   FORMS
   ============================================================ */

.form-label {
    margin-bottom: 5px;

    color: var(--secondary);

    font-size: 11px;

    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 38px;

    border-color: #cbd5e1;

    border-radius: 6px;

    font-size: 12px;

    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(15, 118, 110, 0.10);
}


/* ============================================================
   TABLES
   ============================================================ */

.table {
    margin-bottom: 0;

    font-size: 11px;

    vertical-align: middle;
}

.table thead th {
    padding: 10px 12px;

    background: #f8fafc;

    color: #475569;

    border-bottom:
        1px solid var(--border);

    font-size: 10px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.02em;

    white-space: nowrap;
}

.table tbody td {
    padding: 10px 12px;

    border-color: #eef2f7;
}

.table tbody tr:hover {
    background: #f8fafc;
}


/* ============================================================
   BADGES
   ============================================================ */

.badge {
    padding: 5px 8px;

    border-radius: 5px;

    font-size: 9px;

    font-weight: 700;
}


/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    border-radius: 7px;

    border-width: 1px;

    font-size: 12px;
}


/* ============================================================
   SIDEBAR MOBILE OVERLAY
   ============================================================ */

.sidebar-overlay {
    position: fixed;

    inset: 0;

    background: rgba(15, 23, 42, 0.55);

    z-index: 1040;

    display: none;
}

.sidebar-overlay.show {
    display: block;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 235px;
    }

    .navbar-user-details {
        display: none;
    }

}


@media (max-width: 900px) {

    .sidebar {
        transform: translateX(-100%);

        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;

        align-items: center;
        justify-content: center;
    }

    .top-navbar {
        padding: 0 15px;
    }

    .main-content {
        padding: 18px;
    }

}


@media (max-width: 650px) {

    .navbar-page-title small {
        display: none;
    }

    .navbar-branch {
        display: none;
    }

    .notification-dropdown {
        position: fixed;

        top: var(--navbar-height);

        left: 10px;
        right: 10px;

        width: auto;
    }

    .main-footer {
        flex-direction: column;

        align-items: flex-start;

        gap: 5px;

        padding: 12px 16px;
    }

}


@media (max-width: 450px) {

    .main-content {
        padding: 12px;
    }

    .top-navbar {
        height: 60px;
    }

    :root {
        --navbar-height: 60px;
    }

}