/**
 * Medical Shop Billing System - Main Stylesheet
 * Theme: Professional Medical Teal/Green
 * Colors from reference design
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    --primary: #1B9A8B;
    --primary-dark: #148176;
    --primary-light: #E8F5F3;
    --secondary: #2C3E50;
    --accent: #27AE60;
    --danger: #E74C3C;
    --warning: #F39C12;
    --info: #3498DB;
    --success: #2ECC71;
    
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition-fast: 150ms ease;
    --transition: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: all var(--transition-fast);
}

input, select, textarea {
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease forwards; }
.animate-slideInLeft { animation: slideInLeft 0.5s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.5s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transform: rotate(-15deg);
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 150%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    transform: rotate(15deg);
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
    color: var(--white);
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s ease 0.2s both;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.login-form .input-wrapper {
    position: relative;
}

.login-form .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.125rem;
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition-fast);
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 154, 139, 0.15);
}

.login-form input::placeholder {
    color: var(--gray-400);
}

.login-form .error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    animation: fadeIn 0.3s ease;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.login-footer p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.login-footer .demo-credentials {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    text-align: left;
}

.login-footer .demo-credentials strong {
    color: var(--primary-dark);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-footer .demo-credentials code {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-700);
    background: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
}

/* ==================== LAYOUT ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.sidebar-brand-text h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

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

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-600);
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.page-title p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    position: relative;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.header-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition-fast);
    animation: fadeInUp 0.5s ease both;
}

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

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

.stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.stat-icon.info {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #27ae60;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 154, 139, 0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-hint {
    color: var(--gray-500);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

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

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: #d68910;
}

.badge-info {
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeInDown 0.3s ease;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.2);
    color: #d68910;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

/* ==================== LOADING ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== GRID ==================== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-gray { color: var(--gray-500); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none !important; }

/* ==================== BILLING PAGE SPECIFIC ==================== */
.billing-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
}

.billing-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.billing-section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.billing-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.billing-section-body {
    padding: 1.5rem;
}

/* Customer Search */
.customer-search-result {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    display: none;
}

.customer-search-result.active {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.customer-result-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.customer-result-item:hover {
    background: var(--gray-50);
}

.customer-result-item:last-child {
    border-bottom: none;
}

.customer-result-name {
    font-weight: 500;
    color: var(--gray-800);
}

.customer-result-mobile {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.customer-result-points {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 500;
}

/* Medicine Search */
.medicine-search-container {
    position: relative;
}

.medicine-search-result {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}

.medicine-search-result.active {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.medicine-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.medicine-result-item:hover {
    background: var(--gray-50);
}

.medicine-result-name {
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.medicine-result-generic {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.medicine-result-price {
    font-weight: 600;
    color: var(--primary);
}

/* Bill Items Table */
.bill-items-table {
    width: 100%;
}

.bill-items-table th,
.bill-items-table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.bill-items-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    background: var(--gray-50);
}

.bill-items-table td {
    font-size: 0.9375rem;
}

.bill-item-name {
    font-weight: 500;
    color: var(--gray-800);
}

.bill-item-generic {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.qty-input {
    width: 70px;
    text-align: center;
    padding: 0.375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
}

.btn-remove-item {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.btn-remove-item:hover {
    background: var(--danger);
    color: var(--white);
}

/* Bill Summary */
.bill-summary {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}

.summary-row:not(:last-child) {
    border-bottom: 1px dashed var(--gray-300);
}

.summary-label {
    color: var(--gray-600);
}

.summary-value {
    font-weight: 500;
    color: var(--gray-800);
}

.summary-row.discount {
    color: var(--success);
}

.summary-row.discount .summary-value {
    color: var(--success);
}

.summary-row.total {
    font-size: 1.125rem;
    font-weight: 700;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--gray-300);
}

.summary-row.total .summary-value {
    color: var(--primary);
    font-size: 1.25rem;
}

/* Points Section */
.points-section {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.points-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.points-label {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.points-value {
    font-weight: 600;
    color: var(--primary);
}

.points-input-group {
    display: flex;
    gap: 0.5rem;
}

.points-input-group input {
    flex: 1;
}

/* Success Animation */
.success-animation {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--success) 0%, #27ae60 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 3rem;
    color: var(--white);
    animation: successPop 0.5s ease;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.success-message {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.bill-number-display {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.bill-number-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.bill-number-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .billing-container {
        grid-template-columns: 1fr;
    }
    
    .billing-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0.75rem 1rem;
    }
    
    .page-title h1 {
        font-size: 1.25rem;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .modal {
        width: 95%;
        margin: 1rem;
    }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Print styles for bill */
@media print {
    .sidebar,
    .header,
    .btn-print,
    .btn-share {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
