@charset "UTF-8";
/* =====================================================================
   PharmaSystem - Design System v3 (Professional)
   ===================================================================== */

/* -- Variables ------------------------------------------------------- */
:root {
    --sidebar-width:    258px;
    --navbar-height:    60px;

    /* Brand palette */
    --green-500: #16a34a;
    --green-600: #15803d;
    --green-700: #166534;
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;

    /* Semantic aliases */
    --brand:    var(--green-500);
    --brand-dk: var(--green-700);

    /* Sidebar */
    --sb-bg:      #111827;
    --sb-hover:   rgba(255,255,255,0.05);
    --sb-active:  rgba(22,163,74,0.15);
    --sb-border:  rgba(255,255,255,0.06);
    --sb-text:    #9ca3af;
    --sb-text-hv: #f3f4f6;
    --sb-section: rgba(255,255,255,0.3);

    /* Surface */
    --bg-body:   #f8fafc;
    --bg-card:   #ffffff;
    --bg-nav:    #ffffff;

    /* Text */
    --tx-base:    #0f172a;
    --tx-secondary:#475569;
    --tx-muted:   #94a3b8;
    --tx-disabled:#cbd5e1;

    /* Border */
    --border:     #e2e8f0;
    --border-dk:  #cbd5e1;

    /* Shadow tokens */
    --sh-xs: 0 1px 2px 0 rgba(0,0,0,0.05);
    --sh-sm: 0 1px 3px 0 rgba(0,0,0,0.07), 0 1px 2px -1px rgba(0,0,0,0.07);
    --sh-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.07);
    --sh-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --sh-xl: 0 20px 25px -5px rgba(0,0,0,0.10), 0 8px 10px -6px rgba(0,0,0,0.05);

    /* Radius */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  14px;
    --r-xl:  20px;
    --r-full:9999px;

    /* Motion */
    --ease: cubic-bezier(0.4,0,0.2,1);
    --dur-fast:   140ms;
    --dur-normal: 220ms;
}

/* -- Reset / Base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--bg-body);
    font-family: "Inter","Segoe UI",system-ui,-apple-system,sans-serif;
    color: var(--tx-base);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* -- Scrollbar ------------------------------------------------------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* -- Navbar ---------------------------------------------------------- */
.app-navbar {
    height: var(--navbar-height);
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    box-shadow: var(--sh-xs);
}

.app-navbar .brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.app-navbar .brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(22,163,74,0.40);
    flex-shrink: 0;
}

.app-navbar .brand-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--tx-base);
    letter-spacing: -0.02em;
}

.app-navbar .nav-spacer { flex: 1; }

.app-navbar .nav-date {
    font-size: 0.75rem;
    color: var(--tx-muted);
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.app-navbar .user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.625rem 0.25rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: transparent;
    cursor: pointer;
    color: var(--tx-base);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease);
    white-space: nowrap;
}

.app-navbar .user-pill:hover { background: var(--bg-body); border-color: var(--border-dk); }

.app-navbar .user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.app-navbar .sidebar-toggle {
    display: none;
    border: none;
    background: none;
    padding: 0.25rem 0.4rem;
    color: var(--tx-secondary);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: background var(--dur-fast) var(--ease);
}
.app-navbar .sidebar-toggle:hover { background: var(--bg-body); }

@media (max-width: 991.98px) { .app-navbar .sidebar-toggle { display: flex; } }

/* -- Layout ---------------------------------------------------------- */
.app-body {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

/* -- Sidebar --------------------------------------------------------- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sb-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform var(--dur-normal) var(--ease);
    overflow: hidden;
}

.sb-top {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sb-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sb-section);
    padding: 1rem 1.25rem 0.4rem;
    user-select: none;
}

.sb-divider {
    height: 1px;
    background: var(--sb-border);
    margin: 0.4rem 1rem;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 1rem 0.5625rem 1.125rem;
    margin: 1px 0.625rem;
    border-radius: var(--r-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sb-text);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: background var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease);
}

.app-sidebar .nav-link .nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--dur-fast) var(--ease);
}

.app-sidebar .nav-link:hover {
    background: var(--sb-hover);
    color: var(--sb-text-hv);
}

.app-sidebar .nav-link:hover .nav-icon { opacity: 1; }

.app-sidebar .nav-link.active {
    background: var(--sb-active);
    color: #fff;
    border-left-color: var(--green-500);
    font-weight: 600;
}

.app-sidebar .nav-link.active .nav-icon {
    opacity: 1;
    color: var(--green-500);
}

/* Sidebar user footer */
.sb-footer {
    border-top: 1px solid var(--sb-border);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.sb-footer-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sb-footer-info { flex: 1; min-width: 0; }

.sb-footer-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-footer-role {
    font-size: 0.6875rem;
    color: var(--sb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-footer-logout {
    color: var(--sb-text);
    background: none;
    border: none;
    padding: 0.3rem;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
    flex-shrink: 0;
    text-decoration: none;
}

.sb-footer-logout:hover { color: #f87171; background: rgba(248,113,113,0.1); }

/* Responsive */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: var(--navbar-height);
        bottom: 0;
        left: 0;
        z-index: 1040;
        transform: translateX(-100%);
    }
    .app-sidebar.show { transform: translateX(0); }
}

/* -- Main ------------------------------------------------------------ */
.app-main {
    flex: 1;
    min-width: 0;
    padding: 1.75rem 2rem;
    overflow-x: hidden;
}

@media (max-width: 991.98px) { .app-main { padding: 1.25rem 1rem; } }

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--tx-base);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.page-title i { color: var(--brand); }

/* -- Cards ----------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
}

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tx-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header i { color: var(--brand); font-size: 1rem; }

/* KPI cards */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--dur-normal) var(--ease),
                transform var(--dur-normal) var(--ease);
}

.kpi-card::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--kpi-color, var(--brand));
    border-radius: var(--r-lg) 0 0 var(--r-lg);
}

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

.kpi-card .card-body { padding: 1.25rem 1.25rem 1.25rem 1.5rem; }

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

.kpi-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tx-muted);
    margin-bottom: 0.2rem;
}

.kpi-value {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--tx-base);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.kpi-sub {
    font-size: 0.6875rem;
    color: var(--tx-muted);
    margin-top: 0.2rem;
}

/* -- Tables ---------------------------------------------------------- */
.table { font-size: 0.8125rem; color: var(--tx-base); }

.table thead th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tx-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 0.625rem 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.6875rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: #f8fafc; }

/* -- Buttons --------------------------------------------------------- */
.btn {
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--r-md);
    letter-spacing: 0.01em;
    transition: all var(--dur-fast) var(--ease);
}

.btn-success {
    background: var(--green-500);
    border-color: var(--green-500);
    color: #fff;
}

.btn-success:hover, .btn-success:focus-visible {
    background: var(--green-600);
    border-color: var(--green-600);
    box-shadow: 0 4px 14px rgba(22,163,74,0.38);
    color: #fff;
}

.btn-success:focus-visible { outline: 3px solid rgba(22,163,74,0.35); outline-offset: 2px; }

.btn-outline-success {
    color: var(--green-500);
    border-color: var(--green-500);
}

.btn-outline-success:hover {
    background: var(--green-500);
    border-color: var(--green-500);
    color: #fff;
}

/* -- Forms ----------------------------------------------------------- */
.form-control,
.form-select {
    font-size: 0.875rem;
    color: var(--tx-base);
    border-color: var(--border);
    border-radius: var(--r-md);
    background: #fff;
    transition: border-color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}

.form-control::placeholder { color: var(--tx-disabled); }

.form-control:focus,
.form-select:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.18);
    outline: none;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tx-secondary);
    margin-bottom: 0.375rem;
}

.input-group-text {
    font-size: 0.875rem;
    color: var(--tx-muted);
    border-color: var(--border);
    background: #f8fafc;
}

/* -- Badges ---------------------------------------------------------- */
.badge {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: var(--r-full);
    padding: 0.25em 0.6em;
}

/* -- Alerts ---------------------------------------------------------- */
.alert {
    font-size: 0.875rem;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    border-left-width: 4px;
}

.alert-success { background: #f0fdf4; border-color: #bbf7d0; border-left-color: var(--green-500); color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; border-left-color: #ef4444; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; border-left-color: #3b82f6; color: #1e40af; }

/* -- Dropdown -------------------------------------------------------- */
.dropdown-menu {
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    padding: 0.375rem;
}

.dropdown-item {
    border-radius: var(--r-sm);
    padding: 0.5rem 0.75rem;
    color: var(--tx-base);
    font-weight: 500;
    transition: background var(--dur-fast) var(--ease);
}

.dropdown-item:hover { background: var(--bg-body); }
.dropdown-divider { border-color: var(--border); margin: 0.25rem 0; }

/* -- Login ----------------------------------------------------------- */
.login-root {
    min-height: 100vh;
    display: flex;
}

/* Left: form panel */
.login-form-panel {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    background: #fff;
    position: relative;
    z-index: 1;
}

.login-form-panel::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 1px;
    background: var(--border);
}

.login-form-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.login-brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1875rem;
    box-shadow: 0 4px 14px rgba(22,163,74,0.35);
}

.login-brand-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tx-base);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.login-brand-sub {
    font-size: 0.6875rem;
    color: var(--tx-muted);
    font-weight: 400;
}

.login-heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tx-base);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    line-height: 1.25;
}

.login-sub {
    font-size: 0.875rem;
    color: var(--tx-muted);
    margin-bottom: 2rem;
}

.login-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tx-secondary);
    margin-bottom: 0.375rem;
}

.login-field + .login-field { margin-top: 1rem; }
.login-field:last-of-type { margin-bottom: 1.5rem; }

.login-input-wrap {
    position: relative;
}

.login-input-wrap .field-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tx-muted);
    font-size: 0.9375rem;
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.375rem;
    font-size: 0.9375rem;
    color: var(--tx-base);
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease),
                background var(--dur-fast) var(--ease);
}

.login-input-wrap input::placeholder { color: var(--tx-disabled); }

.login-input-wrap input:focus {
    background: #fff;
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.18);
}

.login-submit {
    width: 100%;
    padding: 0.6875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--green-500);
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease);
    letter-spacing: 0.01em;
}

.login-submit:hover {
    background: var(--green-600);
    box-shadow: 0 4px 16px rgba(22,163,74,0.4);
    transform: translateY(-1px);
}

.login-submit:active { transform: translateY(0); box-shadow: none; }

.login-footer-note {
    font-size: 0.6875rem;
    color: var(--tx-muted);
    text-align: center;
    padding-top: 1.5rem;
}

/* Right: brand panel */
.login-brand-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--sb-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* dot-grid pattern */
.login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* green glow orbs */
.login-brand-panel::after {
    content: "";
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22,163,74,0.25) 0%, transparent 70%);
    top: -80px; right: -80px;
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 2rem;
    max-width: 340px;
}

.login-brand-content .big-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(22,163,74,0.5));
}

.login-brand-content h2 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.login-brand-content p {
    font-size: 0.9rem;
    opacity: 0.65;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.login-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.login-feature-pill {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--r-full);
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
}

.login-feature-pill i { color: var(--green-500); font-size: 0.75rem; }

@media (max-width: 767.98px) {
    .login-form-panel { width: 100%; padding: 2rem 1.5rem; }
    .login-brand-panel { display: none; }
    .login-form-panel::after { display: none; }
    .login-brand { margin-bottom: 2rem; }
}

/* -- Utilities ------------------------------------------------------- */
.text-muted { color: var(--tx-muted) !important; }

/* -- POS ------------------------------------------------------------- */
.btn-pos {
    min-height: 70px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--r-lg);
}

/* -- Misc ------------------------------------------------------------ */
.login-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
