:root {
  --primary: #E23744;
  --bg-color: #FFF5F6;
  --text-dark: #333333;
  --text-light: #777777;
  --white: #FFFFFF;
  --border: #f0f0f0;
  --shadow: 0 4px 12px rgba(226, 55, 68, 0.1);
  --success: #10B981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-color); color: var(--text-dark); min-height: 100vh; overflow-x: hidden; }

/* Router and Pages */
.page { display: none; min-height: 100vh; width: 100%; padding-bottom: 120px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page.active { display: block; animation: fadeIn 0.3s ease-in-out; }

/* Custom Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.9); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Headers */
header { background: var(--white); box-shadow: 0 2px 8px rgba(0,0,0,0.05); padding: calc(env(safe-area-inset-top, 25px) + 15px) 20px 15px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
header h1, header h2 { color: var(--primary); font-size: 1.25rem; flex: 1; text-align: center; }
.back-btn { background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 5px; width: 40px; }
.menu-btn { background: none; border: none; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 5px; width: 40px; }
.header-actions { display: flex; gap: 10px; width: 40px; justify-content: flex-end; }

/* Splash Screen */
#splashPage.active { display: flex; position: fixed; inset: 0; background: var(--primary); flex-direction: column; align-items: center; justify-content: center; z-index: 999; color: var(--white); }
#splashPage h1 { font-size: 2.2rem; margin-top: 20px; text-shadow: 1px 1px 4px rgba(0,0,0,0.2); animation: pop 0.5s ease-out; color: white; }
#splashPage img { width: 150px; border-radius: 50%; box-shadow: 0 4px 15px rgba(0,0,0,0.2); animation: pop 0.5s ease-out; background: white; padding: 10px; }

/* Buttons */
.btn { background: var(--primary); color: var(--white); border: none; padding: 12px 20px; border-radius: 8px; font-size: 1rem; font-weight: bold; width: 100%; cursor: pointer; transition: transform 0.1s; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.96); }
.btn-secondary { background: var(--white); color: var(--text-dark); border: 1px solid #ddd; }
.btn-small { padding: 8px 12px; font-size: 0.9rem; width: auto; }
.btn-danger { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn-edit { background: var(--white); color: #2563eb; border: 1px solid #2563eb; }
.btn-stop-milk { background: var(--white); color: #ea580c; border: 1px solid #ea580c; }
.btn-start-milk { background: var(--white); color: var(--success); border: 1px solid var(--success); }

/* Forms */
.form-container { padding: 20px; }
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 0.9rem; color: var(--text-light); margin-bottom: 8px; font-weight: 600; }
input, select { width: 100%; padding: 14px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; outline: none; transition: border 0.3s; background: var(--white); }
input:focus, select:focus { border: 1px solid var(--primary); box-shadow: 0 0 0 2px rgba(226, 55, 68, 0.1); }
.hint { font-size: 0.8rem; color: var(--text-light); margin-top: 5px; }

/* Home Grid layout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; }
.home-btn { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 1.1rem; border-radius: 16px; background: var(--white); color: var(--text-dark); border: none; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.1s; font-weight: 600; text-align: center; }
.home-btn:active { transform: scale(0.95); background: var(--primary); color: var(--white); }
.home-btn:active svg { stroke: var(--white); }
.home-btn svg { width: 44px; height: 44px; stroke: var(--primary); stroke-width: 1.5; fill: none; }

/* Cards */
.card-list { padding: 15px; display: flex; flex-direction: column; gap: 15px; }
.card { background: var(--white); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); border-left: 4px solid var(--primary); display: flex; flex-direction: column; gap: 10px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.card-title { font-size: 1.2rem; font-weight: bold; color: var(--text-dark); margin-bottom: 4px; }
.card-subtitle { font-size: 0.9rem; color: var(--text-light); }
.card-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }

.badge { background: #fee2e2; color: var(--primary); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }


/* List rows for billing/daily */
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.amount-text { color: var(--primary); font-weight: bold; font-size: 1.2rem; }
.absent-text { color: var(--primary); font-weight: bold; background: #fee2e2; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem;}
.present-text { color: var(--success); font-weight: bold; background: #d1fae5; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem;}

/* Modal Overlay */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s; }
.modal-content { background: var(--white); width: 100%; max-width: 400px; border-radius: 12px; padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.modal-title { font-size: 1.25rem; font-weight: bold; margin-bottom: 15px; color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Toast Notification */
.toast { position: fixed; top: 24px; left: 50%; transform: translate(-50%, -20px); background: #222; color: var(--white); padding: 14px 24px; border-radius: 16px; font-size: 0.95rem; font-weight: 600; z-index: 100010; opacity: 0; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease; pointer-events: none; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.25); max-width: 90%; text-align: center; word-wrap: break-word; display: flex; align-items: center; justify-content: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: #10B981 !important; color: #ffffff !important; border-left: 4px solid #047857; }
.toast-error { background: #EF4444 !important; color: #ffffff !important; border-left: 4px solid #B91C1C; }
.toast-info { background: #3B82F6 !important; color: #ffffff !important; border-left: 4px solid #1D4ED8; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--text-light); }
.empty-state svg { width: 64px; height: 64px; stroke: #ccc; fill: none; margin: 0 auto 15px; }

/* Dashboard specific */
.dash-stat { background: var(--primary); color: var(--white); padding: 20px; border-radius: 12px; margin: 20px; text-align: center; box-shadow: var(--shadow); }
.dash-stat h3 { font-size: 2rem; font-weight: 900; }
.dash-stat p { font-size: 0.9rem; opacity: 0.9; }

/* Flex utilities */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.mt-4 { margin-top: 16px; }

/* Checklist Styles */
.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid var(--text-light);
}
.checklist-item.present { border-left-color: var(--success); }
.checklist-item.absent { border-left-color: var(--primary); }
.checklist-item.auto { background: #fffdfd; border-left-style: dashed; }

.checklist-info { flex: 1; }
.checklist-name { font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.checklist-subtitle { font-size: 0.75rem; color: var(--text-light); }

.checklist-actions { 
    display: flex; 
    gap: 12px; 
    align-items: center; 
}

.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
.btn-tick { background: #f0fdf4; color: var(--success); }
.btn-tick:active { background: #dcfce7; }
.btn-cross { background: #fff1f2; color: var(--primary); }
.btn-cross:active { background: #fee2e2; }
.btn-auto { background: #fff1f2; color: var(--primary); font-size: 0.65rem; font-weight: 800; border: 1px solid #fee2e2; }
.btn-auto.active { background: var(--primary); color: white; border-color: var(--primary); }

.adj-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #f8f8f8;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.adj-btn:active { background: #eee; transform: scale(0.9); }
.adj-plus { color: var(--success); }
.adj-minus { color: var(--primary); }

.qty-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-left: 5px;
}
.qty-extra { background: #fee2e2; color: var(--primary); }
.qty-less { background: #ffedd5; color: #9a3412; }
.qty-exact { background: #f0fdf4; color: var(--success); }

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-present { background: #d1fae5; color: #065f46; }
.status-absent { background: #fee2e2; color: #991b1b; }
.stat-card { border-left-width: 4px; padding: 12px 15px; }

/* Swipe to Remove */
.checklist-wrapper {
    position: relative;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 12px;
    background-color: #ef4444;
}
.swipe-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    font-weight: bold;
    z-index: 0;
}
.checklist-wrapper .checklist-item {
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
}
.checklist-item.swiping {
    transition: none;
}

/* Form Validation */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.error-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal-overlay.show {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: white;
    padding: 25px;
    border-radius: 16px;
    width: 85%;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(-150px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.modal-overlay.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Modern Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
.modern-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

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

.list-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #333;
}

.absent-text {
    color: #E23744;
    font-weight: bold;
}

.bill-table th, .bill-table td { border: 1px solid #000; padding: 6px; }
.absent-row { background: #fee2e2 !important; }
.highlight-blue { background: #e0f2fe !important; } /* Subtle blue for deviations */

#billPrintArea {
    background: #fff;
    padding: 20px;
    border: 1px solid #000;
    color: #000;
    font-family: 'Segoe UI', Arial, sans-serif;
    border-radius: 8px;
}

@media (max-width: 480px) {
    #billPreviewModal .modal-content {
        padding: 15px 8px 10px 8px !important;
        width: 98% !important;
        max-height: 95vh !important;
    }
    #billPrintArea {
        padding: 10px !important;
    }
    .bill-table {
        font-size: 0.72rem !important;
    }
    .bill-table th, .bill-table td {
        padding: 4px 2px !important;
    }
    #billPrintArea h1 {
        font-size: 1.1rem !important;
    }
    #billPrintArea h2 {
        font-size: 1.1rem !important;
    }
    #billPrintArea p {
        font-size: 0.75rem !important;
    }
}



@media print {
    body * { visibility: hidden; background: #fff !important; }
    #billPrintArea, #billPrintArea * { visibility: visible; }
    #billPrintArea {
        position: fixed;
        left: 50%;
        top: 30px;
        transform: translateX(-50%);
        width: 480px;
        max-width: 95%;
        margin: 0 auto;
        padding: 20px;
        border: 2px solid #000 !important;
        border-radius: 12px;
        box-shadow: none !important;
    }
}

.loader-overlay-fixed {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.loader-overlay-fixed .modern-spinner {
    border: 4px solid rgba(226, 55, 68, 0.15);
    border-top-color: var(--primary);
}
.loader-overlay-fixed.active {
    display: flex;
}

/* Sidebar Drawer */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none; opacity: 0; transition: opacity 0.3s ease; }
.sidebar-overlay.active { display: block; opacity: 1; }
.sidebar { position: fixed; top: 0; left: -280px; width: 280px; height: 100vh; background: var(--white); z-index: 2100; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 10px 0 25px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
.sidebar.active { left: 0; }
.sidebar-header { padding: 40px 20px 20px; background: var(--primary); color: white; display: flex; flex-direction: column; gap: 10px; }
.sidebar-header .cow-icon { font-size: 2.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.sidebar-header h2 { color: white; font-size: 1.4rem; font-weight: 800; }
.sidebar-menu { padding: 20px 0; flex: 1; overflow-y: auto; }
.sidebar-item { display: flex; align-items: center; gap: 15px; padding: 15px 25px; color: var(--text-dark); text-decoration: none; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.sidebar-item:active { background: var(--bg-color); color: var(--primary); }
.sidebar-item svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; opacity: 0.7; }
.sidebar-footer { padding: 20px; border-top: 1px solid #eee; font-size: 0.8rem; color: var(--text-light); text-align: center; }

/* App Guide / Onboarding Tour */
.tour-highlight {
    position: relative !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
    box-shadow: 0 0 0 4px var(--primary), 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    background: var(--white) !important;
    transform: scale(1.04) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes bounceUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.animate-tour-bounce {
    animation: bounceUpDown 0.8s infinite ease-in-out;
}

/* PIN Lock keypad styling */
.keypad-btn:active {
    background: #e2e2e2 !important;
    transform: scale(0.92);
}
.pin-dot.filled {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    transform: scale(1.15);
}

/* Premium Authentication Screen Styling */
#appAuthModal {
    background: rgba(255, 245, 246, 0.75) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
}

#appAuthModal .modal-content {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(226, 55, 68, 0.15) !important;
    border-left: 5px solid var(--primary) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(226, 55, 68, 0.15) !important;
    color: var(--text-dark) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 35px 25px !important;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

#appAuthModal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#authRegisterForm {
    border-left-color: #2563eb !important;
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25) !important;
}

#authForgotForm {
    border-left-color: #ea580c !important;
    box-shadow: 0 25px 50px -12px rgba(234, 88, 12, 0.25) !important;
}

#appAuthModal h3 {
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-size: 1.5rem;
    text-shadow: none !important;
}

#appAuthModal p {
    color: var(--text-light) !important;
    font-size: 0.85rem;
    margin-bottom: 25px;
}

#appAuthModal label {
    color: var(--text-light) !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

#appAuthModal input, #appAuthModal select {
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    color: var(--text-dark) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#appAuthModal input:focus, #appAuthModal select:focus {
    border-color: var(--primary) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(226, 55, 68, 0.15) !important;
}

#authRegisterForm input:focus, #authRegisterForm select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

#authForgotForm input:focus {
    border-color: #ea580c !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15) !important;
}

#appAuthModal select option {
    background: #ffffff !important;
    color: var(--text-dark) !important;
}

#appAuthModal .btn {
    background: linear-gradient(135deg, var(--primary), #ff5d7c) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 20px !important;
    font-size: 1rem !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(226, 55, 68, 0.3) !important;
    transition: all 0.3s ease !important;
}

#appAuthModal .btn:active {
    transform: scale(0.97) !important;
    box-shadow: 0 4px 10px rgba(226, 55, 68, 0.2) !important;
}

#authRegisterForm .btn {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3) !important;
}

#authForgotForm .btn {
    background: linear-gradient(135deg, #ea580c, #f97316) !important;
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3) !important;
}

#appAuthModal .btn-secondary {
    background: #ffffff !important;
    color: var(--text-dark) !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
}

#appAuthModal .btn-secondary:active {
    background: #f0f0f0 !important;
}

#appAuthModal a {
    transition: all 0.2s ease;
    opacity: 0.85;
}

/* ----------- Premium Light-Themed Modals ----------- */
/* Base modal overlay */
.modal-overlay {
  background: rgba(15, 23, 42, 0.4) !important; /* Soft Slate-900 overlay, clean and light */
  backdrop-filter: blur(6px) !important;
}
/* Base modal content */
.modal-content {
  background: #ffffff !important; /* Pure white card background */
  border: 1px solid #e2e8f0 !important; /* Subtle border */
  border-left: 5px solid var(--modal-accent, var(--primary)) !important;
  border-radius: 24px !important;
  padding: 25px 20px !important;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 1px 0 rgba(0, 0, 0, 0.1) !important; /* Soft premium shadow */
  backdrop-filter: none !important;
  transform: scale(0.9) translateY(30px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.4s ease;
}
.modal-overlay.show .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}
/* Accent colors per modal */
#appAuthModal .modal-content { --modal-accent: var(--primary); }
#loginSettingsModal .modal-content { --modal-accent: var(--primary); }
#dairySettingsModal .modal-content { --modal-accent: var(--primary); }
#customerNoticeModal .modal-content { --modal-accent: var(--primary); }
#customModal .modal-content { --modal-accent: var(--primary); }
#milkBreakdownModal .modal-content { --modal-accent: var(--primary); }
#billPreviewModal .modal-content { --modal-accent: var(--primary); }
#customerComplaintModal .modal-content { --modal-accent: var(--primary); }
#sellerComplaintsModal .modal-content { --modal-accent: var(--primary); }
#sellerProfileModal .modal-content { --modal-accent: var(--primary); }

/* Button styling inside modals */
.modal-content .btn {
  background: linear-gradient(135deg, var(--primary), #ff5d7c) !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 14px 20px !important;
  font-size: 1rem !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 20px rgba(226,55,68,0.25) !important;
  transition: all 0.3s ease !important;
  color: #ffffff !important;
}
.modal-content .btn:active {
  transform: scale(0.97) !important;
  box-shadow: 0 4px 10px rgba(226,55,68,0.15) !important;
}
.modal-content .btn-secondary {
  background: #f1f5f9 !important; /* Soft grey background */
  color: #334155 !important; /* Dark text */
  border: 1px solid #cbd5e1 !important; /* Slate-300 border */
  box-shadow: none !important;
}
.modal-content .btn-secondary:active {
  background: #cbd5e1 !important;
}
/* Title and text inside modals */
.modal-content h3 {
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 15px;
  font-size: 1.5rem;
}
.modal-content p {
  color: #4b5563 !important; /* Slate-600 for high readability */
  font-size: 0.85rem !important;
  margin-bottom: 20px;
}
/* Ensure inputs, select lists, and textareas inside any modal adopt proper light styles */
.modal-content input,
.modal-content select,
.modal-content textarea {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important; /* Slate-300 border */
  color: #1e293b !important; /* Dark text */
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-size: 1rem !important;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1) !important;
}
.modal-content input::placeholder,
.modal-content textarea::placeholder {
  color: #94a3b8 !important;
}
.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color: var(--modal-accent) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(226,55,68,0.15) !important;
}
/* Close button for modals */
.modal-content .modal-close {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  background: none !important;
  border: none !important;
  font-size: 1.8rem !important;
  color: #64748b !important; /* Slate-500 */
  cursor: pointer !important;
  padding: 5px !important;
  line-height: 1 !important;
  z-index: 10 !important;
  transition: color 0.2s !important;
}
.modal-content .modal-close:hover {
  color: #334155 !important;
}

#appAuthModal a:hover {
    opacity: 1;
    text-shadow: 0 0 8px currentColor;
    transform: translateY(-1px);
}

#appAuthModal {
    background: #E63946 !important;
    backdrop-filter: none !important;
}

/* Offline Tailwind Fallback Mapping for Auth Screens */
#appAuthModal .bg-white { background-color: #ffffff !important; }
#appAuthModal .rounded-3xl { border-radius: 24px !important; }
#appAuthModal .shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important; }
#appAuthModal .p-8 { padding: 32px !important; }
#appAuthModal .w-full { width: 100% !important; }
#appAuthModal .max-w-sm { max-width: 380px !important; }
#appAuthModal .flex-col { display: flex !important; flex-direction: column !important; }
#appAuthModal .items-center { align-items: center !important; }
#appAuthModal .mb-8 { margin-bottom: 32px !important; }
#appAuthModal .mb-4 { margin-bottom: 16px !important; }
#appAuthModal .mt-1 { margin-top: 4px !important; }
#appAuthModal .mt-4 { margin-top: 16px !important; }
#appAuthModal .text-2xl { font-size: 1.5rem !important; }
#appAuthModal .text-sm { font-size: 0.875rem !important; }
#appAuthModal .text-gray-800 { color: #1f2937 !important; }
#appAuthModal .text-gray-700 { color: #374151 !important; }
#appAuthModal .text-gray-500 { color: #6b7280 !important; }
#appAuthModal .font-bold { font-weight: 700 !important; }
#appAuthModal .font-semibold { font-weight: 600 !important; }
#appAuthModal .space-y-4 > * + * { margin-top: 16px !important; }
#appAuthModal .block { display: block !important; }
#appAuthModal .mb-1 { margin-bottom: 4px !important; }
#appAuthModal .px-4 { padding-left: 16px !important; padding-right: 16px !important; }
#appAuthModal .py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
#appAuthModal .rounded-xl { border-radius: 12px !important; }
#appAuthModal .border { border: 1px solid #e5e7eb !important; }
#appAuthModal .border-gray-200 { border-color: #e5e7eb !important; }
#appAuthModal .w-24 { width: 96px !important; }
#appAuthModal .h-24 { height: 96px !important; }
#appAuthModal .rounded-full { border-radius: 9999px !important; }
#appAuthModal .border-4 { border-width: 4px !important; }
#appAuthModal .border-\[\#E63946\] { border-color: #E23744 !important; }
#appAuthModal .bg-\[\#E63946\] { background-color: #E23744 !important; }
#appAuthModal .hover\:bg-\[\#d62839\]:hover { background-color: #c52935 !important; }
#appAuthModal .text-white { color: #ffffff !important; }
#appAuthModal .shadow-lg { box-shadow: 0 10px 15px -3px rgba(226, 55, 68, 0.3) !important; }
#appAuthModal .text-center { text-align: center !important; }
#appAuthModal .underline { text-decoration: underline !important; }
#appAuthModal .cursor-pointer { cursor: pointer !important; }
#appAuthModal .absolute { position: absolute !important; }
#appAuthModal .top-6 { top: 24px !important; }
#appAuthModal .left-6 { left: 24px !important; }
#appAuthModal .right-6 { right: 24px !important; }
#appAuthModal .z-10 { z-index: 10 !important; }

/* Connection Status Badge Styling inside appAuthModal */
#loginConnStatusBadge {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    backdrop-filter: blur(5px) !important;
}

#authTopBecomeSeller button {
    color: #ffffff !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: 0 !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    text-decoration: underline !important;
}



