/* =============================================
   PHARMAPRO - CUSTOM STYLES
   Green/Teal Pharmacy Theme
   ============================================= */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== Root Variables ===== */
:root {
    --primary:        #059669;
    --primary-dark:   #047857;
    --primary-light:  #10B981;
    --secondary:      #0EA5E9;
    --secondary-dark: #0284C7;
    --warning:        #F59E0B;
    --danger:         #EF4444;
    --info:           #8B5CF6;
    --dark:           #1E293B;
    --dark-2:         #334155;
    --dark-3:         #475569;
    --light:          #F8FAFC;
    --light-2:        #F0FDF4;
    --light-3:        #D1FAE5;
    --white:          #FFFFFF;
    --sidebar-width:  270px;
    --header-height:  65px;
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
    --shadow:         0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg:      0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl:      0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius:         12px;
    --radius-sm:      8px;
    --radius-lg:      16px;
    --transition:     all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F0FDF4;
    color: var(--dark);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #064E3B 0%, #059669 50%, #0EA5E9 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -150px;
    right: -150px;
    animation: float 6s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-20px); }
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 430px;
    padding: 45px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--dark-3);
    font-size: 13px;
}

.login-card .form-control {
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--light);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
    background: var(--white);
}

.login-card .form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--dark-2);
    margin-bottom: 6px;
}

.login-card .input-group-text {
    border: 2px solid #E2E8F0;
    border-right: none;
    background: var(--light);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--dark-3);
}

.login-card .input-group .form-control {
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

.lang-switch {
    text-align: center;
    margin-top: 20px;
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--dark-3);
    transition: var(--transition);
}

.lang-switch a:hover, .lang-switch a.active {
    background: var(--light-2);
    color: var(--primary);
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #064E3B 0%, #022C22 100%);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

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

.sidebar-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.sidebar-brand {
    color: white;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.sidebar-brand small {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.sidebar-menu {
    padding: 12px 0;
}

.menu-label {
    padding: 12px 20px 4px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255,255,255,0.3);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.6);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin: 1px 0;
    position: relative;
}

.sidebar-menu a:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

.sidebar-menu a.active {
    color: white;
    background: rgba(16, 185, 129, 0.18);
    border-left-color: var(--primary-light);
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-menu a .badge-alert {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
}

/* Scrollbar sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* =============================================
   TOP HEADER
   ============================================= */
.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    text-transform: capitalize;
}

.header-left .breadcrumb-text {
    font-size: 12px;
    color: var(--dark-3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    color: var(--dark-3);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

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

.header-btn .badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.3); }
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--danger);
    background: rgba(239,68,68,0.1);
    transition: var(--transition);
}

.header-logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* Alert count badge in header */
.alert-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.alert-count-badge:hover {
    background: var(--danger);
    color: white;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
}

.content-wrapper {
    padding: 25px;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--dark-3);
    margin-top: 3px;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #E2E8F0;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card .stat-icon.green  { background: rgba(16, 185, 129,0.12); color: var(--primary-light); }
.stat-card .stat-icon.blue   { background: rgba(14, 165, 233,0.12); color: var(--secondary); }
.stat-card .stat-icon.yellow { background: rgba(245,158, 11,0.12);  color: var(--warning); }
.stat-card .stat-icon.red    { background: rgba(239, 68, 68,0.12);  color: var(--danger); }
.stat-card .stat-icon.purple { background: rgba(139, 92,246,0.12);  color: var(--info); }
.stat-card .stat-icon.cyan   { background: rgba(6, 182,212,0.12);   color: #06B6D4; }

.stat-card .stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--dark-3);
    margin-top: 5px;
    font-weight: 500;
}

.stat-card .stat-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}
.stat-card .stat-trend.up   { color: var(--primary-light); }
.stat-card .stat-trend.down { color: var(--danger); }

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 90px; height: 90px;
    border-radius: 0 0 0 90px;
    opacity: 0.06;
}
.stat-card:nth-child(1)::after { background: var(--primary-light); }
.stat-card:nth-child(2)::after { background: var(--secondary); }
.stat-card:nth-child(3)::after { background: var(--warning); }
.stat-card:nth-child(4)::after { background: var(--danger); }

/* ===== Cards ===== */
.card-custom {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #E2E8F0;
    overflow: hidden;
    margin-bottom: 0;
}

.card-custom .card-header-custom {
    padding: 18px 22px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
}

.card-custom .card-header-custom h5 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card-custom .card-body-custom {
    padding: 22px;
}

/* ===== Tables ===== */
.table-responsive-custom {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.table-custom thead th {
    background: #F8FAFC;
    padding: 12px 15px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--dark-3);
    border-bottom: 2px solid #E2E8F0;
    white-space: nowrap;
}

.table-custom tbody td {
    padding: 12px 15px;
    font-size: 13.5px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: #F0FDF4;
}

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

/* ===== Status Badges ===== */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-status.active,
.badge-status.paid,
.badge-status.in_stock    { background: rgba(16,185,129,0.12); color: var(--primary-light); }
.badge-status.active::before,
.badge-status.paid::before,
.badge-status.in_stock::before { background: var(--primary-light); }

.badge-status.pending,
.badge-status.partial,
.badge-status.near_expiry { background: rgba(245,158,11,0.12);  color: var(--warning); }
.badge-status.pending::before,
.badge-status.partial::before,
.badge-status.near_expiry::before { background: var(--warning); }

.badge-status.inactive,
.badge-status.unpaid,
.badge-status.expired,
.badge-status.out_of_stock { background: rgba(239,68,68,0.12);  color: var(--danger); }
.badge-status.inactive::before,
.badge-status.unpaid::before,
.badge-status.expired::before,
.badge-status.out_of_stock::before { background: var(--danger); }

.badge-status.low_stock { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-status.low_stock::before { background: var(--warning); }

/* ===== Expiry Badges ===== */
.expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.expiry-badge.expired    { background: rgba(239,68,68,0.12);  color: var(--danger); }
.expiry-badge.near       { background: rgba(245,158,11,0.12); color: var(--warning); }
.expiry-badge.good       { background: rgba(16,185,129,0.12); color: var(--primary-light); }

/* ===== Buttons ===== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(5,150,105,0.35);
    color: white;
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14,165,233,0.35);
    color: white;
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-danger-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239,68,68,0.35);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    color: var(--dark-3);
    border: 2px solid #E2E8F0;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-outline-custom:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(5,150,105,0.05);
}

.btn-sm-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.btn-sm-action.edit   { background: rgba(14,165,233,0.1);  color: var(--secondary); }
.btn-sm-action.edit:hover { background: var(--secondary); color: white; }

.btn-sm-action.delete { background: rgba(239,68,68,0.1);   color: var(--danger); }
.btn-sm-action.delete:hover { background: var(--danger); color: white; }

.btn-sm-action.view   { background: rgba(5,150,105,0.1);   color: var(--primary); }
.btn-sm-action.view:hover { background: var(--primary); color: white; }

.btn-sm-action.print  { background: rgba(139,92,246,0.1);  color: var(--info); }
.btn-sm-action.print:hover { background: var(--info); color: white; }

/* ===== Forms ===== */
.form-custom .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-2);
    margin-bottom: 6px;
}

.form-custom .form-control,
.form-custom .form-select {
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    transition: var(--transition);
    background: var(--light);
    color: var(--dark);
}

.form-custom .form-control:focus,
.form-custom .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
    background: var(--white);
}

.form-custom .input-group-text {
    border: 2px solid #E2E8F0;
    border-right: none;
    background: var(--light);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--dark-3);
    font-weight: 600;
}

.form-custom .input-group .form-control {
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--dark-3);
}

.empty-state i {
    font-size: 48px;
    opacity: 0.25;
    margin-bottom: 15px;
    display: block;
}

.empty-state h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-3);
    margin: 0;
}

/* ===== Employee / User Avatar ===== */
.employee-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.avatar-green  { background: linear-gradient(135deg, #10B981, #059669); }
.avatar-blue   { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.avatar-yellow { background: linear-gradient(135deg, #F59E0B, #D97706); }
.avatar-red    { background: linear-gradient(135deg, #EF4444, #DC2626); }
.avatar-purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.avatar-cyan   { background: linear-gradient(135deg, #06B6D4, #0891B2); }

/* ===== Alerts ===== */
.alert-custom {
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border: none;
}

.alert-custom.success { background: rgba(16,185,129,0.1);  color: #065F46; border-left: 4px solid var(--primary-light); }
.alert-custom.danger  { background: rgba(239,68,68,0.1);   color: #7F1D1D; border-left: 4px solid var(--danger); }
.alert-custom.warning { background: rgba(245,158,11,0.1);  color: #78350F; border-left: 4px solid var(--warning); }
.alert-custom.info    { background: rgba(14,165,233,0.1);  color: #0C4A6E; border-left: 4px solid var(--secondary); }

/* ===== Sidebar Overlay (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid #E2E8F0;
    z-index: 998;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--dark-3);
    font-size: 10px;
    font-weight: 600;
    transition: var(--transition);
    padding: 5px 12px;
    border-radius: 8px;
    text-decoration: none;
}

.mobile-bottom-nav a i {
    font-size: 18px;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
    color: var(--primary);
}

.mobile-bottom-nav a.nav-logout { color: var(--danger); }

/* ===== POS Specific ===== */
.pos-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--header-height) - 50px);
}

.pos-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.pos-right {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #E2E8F0;
    overflow: hidden;
}

.pos-search {
    position: relative;
}

.pos-search input {
    width: 100%;
    padding: 14px 50px 14px 16px;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background: white;
}

.pos-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}

.pos-search i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-3);
    font-size: 16px;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.pos-products-grid::-webkit-scrollbar { width: 4px; }
.pos-products-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.product-card {
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.product-card:hover {
    border-color: var(--primary);
    background: #F0FDF4;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card .med-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    margin: 0 auto 10px;
}

.product-card .med-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 3px;
    line-height: 1.3;
}

.product-card .med-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
}

.product-card .med-stock {
    font-size: 11px;
    color: var(--dark-3);
    margin-top: 3px;
}

/* Cart */
.cart-header {
    padding: 18px 20px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h5 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.cart-item {
    background: #F8FFFE;
    border: 1px solid #D1FAE5;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item .item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.cart-item .item-price {
    font-size: 12px;
    color: var(--dark-3);
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover { background: var(--primary-dark); }

.qty-input {
    width: 36px;
    text-align: center;
    border: 1px solid #D1FAE5;
    border-radius: 6px;
    padding: 3px;
    font-size: 13px;
    font-weight: 700;
}

.remove-item {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    opacity: 0.6;
    transition: var(--transition);
}
.remove-item:hover { opacity: 1; }

.cart-summary {
    padding: 16px 20px;
    border-top: 1px solid #F1F5F9;
    background: #FAFAFA;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--dark-3);
    margin-bottom: 8px;
}

.cart-summary .summary-row.total {
    font-size: 16px;
    font-weight: 800;
    color: var(--dark);
    padding-top: 8px;
    border-top: 2px dashed #E2E8F0;
    margin-top: 6px;
}

.cart-summary .summary-row.total span:last-child {
    color: var(--primary);
}

.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5,150,105,0.45);
}

.cart-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== Print Invoice ===== */
.invoice-print {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ===== Pill Category Filters ===== */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid #E2E8F0;
    color: var(--dark-3);
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.filter-pill:hover,
.filter-pill.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ===== Search Bar ===== */
.search-bar {
    position: relative;
}
.search-bar input {
    padding-left: 42px;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-sm);
}
.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-3);
}

/* ===== Progress / Stock Indicator ===== */
.stock-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-bar {
    flex: 1;
    height: 6px;
    background: #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.stock-bar-fill.good   { background: var(--primary-light); }
.stock-bar-fill.low    { background: var(--warning); }
.stock-bar-fill.empty  { background: var(--danger); }

/* ===== Pulse Working Indicator ===== */
.working-indicator {
    width: 36px;
    height: 36px;
    background: rgba(16,185,129,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(16,185,129, 0); }
    100% { box-shadow: 0 0 0 0  rgba(16,185,129, 0); }
}

/* ===== Quick Info Cards ===== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #F1F5F9;
}
.info-row:last-child { border-bottom: none; }
.info-row .info-label { font-size: 13px; color: var(--dark-3); }
.info-row .info-value { font-size: 13px; font-weight: 700; color: var(--dark); }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-header,
    .main-content {
        margin-left: 0;
        left: 0;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .main-content {
        padding-bottom: 70px;
    }
    .pos-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 15px;
    }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 24px; }
}

/* ===== Print Styles ===== */
@media print {
    .sidebar, .main-header, .mobile-bottom-nav,
    .no-print, .btn-print-hide { display: none !important; }
    .main-content { margin-left: 0; padding-top: 0; }
    body { background: white; }
    .invoice-print { box-shadow: none; }
}
