/* --- GLOBAL VARIABLES & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root { 
    --sidebar-bg: #1e293b; 
    --sidebar-width: 260px; 
    --primary: #4361ee; 
    --bg-body: #f1f5f9; /* Admin BG */
    --bg-res: #f8f9fa;  /* Resident BG */
    --danger: #ef4444; 
    --success: #10b981; 
}

body { font-family: 'Poppins', sans-serif; color: #334155; }
.uppercase-input { text-transform: uppercase; }

/* --- ADMIN PANEL STYLES --- */
body.admin-page { background-color: var(--bg-body); }
.sidebar { width: var(--sidebar-width); height: 100vh; background-color: var(--sidebar-bg); color: #cbd5e1; position: fixed; top: 0; left: 0; transition: all 0.3s ease; z-index: 1050; overflow-y: auto; }
.sidebar-header { padding: 25px 20px; border-bottom: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; }
.nav-link { color: #cbd5e1; padding: 15px 20px; margin: 5px 10px; border-radius: 10px; transition: 0.3s; display: flex; align-items: center; cursor: pointer; font-size: 0.95rem; }
.nav-link:hover, .nav-link.active { background-color: var(--primary); color: white; box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3); }
.nav-link i { width: 25px; font-size: 1.1rem; margin-right: 10px; text-align: center; }
.main-content { margin-left: var(--sidebar-width); padding: 30px; transition: all 0.3s ease; }
.content-tab { display: none; animation: fadeIn 0.4s; }
.card-custom { background: white; border: none; border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); padding: 25px; margin-bottom: 20px; }
.toast-admin { position: fixed; bottom: 30px; right: 30px; z-index: 9999; background: #1e293b; color: white; border-left: 5px solid #4361ee; padding: 15px 20px; border-radius: 10px; display: none; animation: slideUp 0.5s forwards; min-width: 300px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
#adminAuthModal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #1e293b; z-index: 11000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mobile-header { display: none; background: var(--sidebar-bg); padding: 15px 20px; color: white; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1040; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1045; }
.pagination-container { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.page-btn { border: 1px solid #dee2e6; background: white; color: #334155; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.page-btn:hover { background: #f1f5f9; }
.page-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { font-size: 0.9rem; color: #64748b; }

/* Admin Media Queries */
@media (max-width: 991px) { 
    .mobile-header { display: flex; } 
    .sidebar { transform: translateX(-100%); } 
    .sidebar.active { transform: translateX(0); } 
    .sidebar-overlay.active { display: block; } 
    .main-content { margin-left: 0; padding: 20px; } 
    .table-responsive-custom { display: block; width: 100%; overflow-x: auto; } 
}

/* --- RESIDENT APP STYLES --- */
body.res-page { background-color: var(--bg-res); color: #2b2d42; padding-bottom: 120px; }
.toast-custom { position: fixed; top: 20px; right: 20px; z-index: 9999; background: white; border-left: 5px solid #22c55e; padding: 15px 20px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: none; animation: slideIn 0.5s forwards; min-width: 300px; }
.monitor-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 11000; display: none; flex-direction: column; align-items: center; justify-content: center; color: #333; text-align: center; }
.monitor-active { color: #0f0; text-shadow: 0 0 10px #0f0; animation: pulseGreen 2s infinite; }
.emergency-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(220, 38, 38, 0.95); z-index: 10000; display: none; flex-direction: column; align-items: center; justify-content: center; color: white; text-align: center; padding: 20px; animation: pulseRed 1s infinite; }
#authSection { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4361ee 0%, #4cc9f0 100%); padding: 20px; z-index: 2000; position: relative; }
.auth-card { background: white; width: 100%; max-width: 450px; padding: 40px; border-radius: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.hero-header { background: white; padding: 15px 0; box-shadow: 0 4px 20px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 100; margin-bottom: 30px; }
.service-card { background: white; border: 2px solid transparent; border-radius: 18px; padding: 20px 10px; text-align: center; transition: all 0.2s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.03); height: 100%; cursor: pointer; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.service-card.active { border-color: var(--primary); background-color: #eff6ff; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(67, 97, 238, 0.15); }
.service-card.disabled { background: #f1f5f9; border-color: #e2e8f0; cursor: not-allowed; opacity: 0.7; filter: grayscale(100%); }
.check-indicator { position: absolute; top: 10px; right: 10px; width: 25px; height: 25px; background: var(--primary); color: white; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 0.8rem; }
.service-card.active .check-indicator { display: flex; }
.icon-box { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.5rem; }
.icon-doc { background: #e0f2fe; color: #0ea5e9; } .icon-card { background: #dcfce7; color: #22c55e; } .icon-store { background: #ffedd5; color: #f97316; } .icon-heart { background: #fce7f3; color: #ec4899; }
.price-badge { background: #f1f5f9; color: #64748b; font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; margin-top: auto; }
.req-box { background-color: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px; margin: 10px 0; width: 100%; text-align: left; }
.req-title { font-size: 0.65rem; font-weight: bold; color: #64748b; text-transform: uppercase; margin-bottom: 4px; display: block; }
.req-list { list-style: none; padding: 0; margin: 0; }
.req-item { font-size: 0.7rem; color: #334155; margin-bottom: 2px; display: flex; align-items: flex-start; line-height: 1.3; }
.req-item i { color: #10b981; margin-right: 5px; margin-top: 3px; font-size: 0.6rem; }
.job-card-mini { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; transition: 0.2s; cursor: pointer; height: 100%; display: flex; flex-direction: column; justify-content: space-between; min-height: 90px; }
.job-card-mini:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.job-mini-title { font-size: 0.85rem; font-weight: 700; color: #2b2d42; margin-bottom: 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-info-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 8px; margin-top: auto; }
.job-rate-badge { background: #ecfdf5; color: var(--success); font-weight: 700; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; }
.job-purok-text { font-size: 0.7rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
#cartBar { position: fixed; bottom: 0; left: 0; width: 100%; background: white; padding: 15px 20px; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); z-index: 1000; display: none; border-top-left-radius: 20px; border-top-right-radius: 20px; }
.btn-header { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: none; background: #f1f5f9; color: #64748b; transition: 0.3s; position: relative; flex-shrink: 0; }
.btn-header:hover { background: #e2e8f0; color: var(--primary); }
.notif-badge { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; background: #ef4444; color: white; font-size: 0.65rem; border-radius: 50%; display: none; align-items: center; justify-content: center; border: 2px solid white; font-weight: bold; }
.panic-btn { position: fixed; bottom: 100px; right: 20px; width: 60px; height: 60px; background: #ef4444; color: white; border-radius: 50%; border: 4px solid #fecaca; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4); z-index: 1040; cursor: pointer; transition: all 0.2s; -webkit-user-select: none; user-select: none; overflow: hidden;}
.panic-btn:active { transform: scale(0.95); }
.panic-progress { position: absolute; bottom: 0; left: 0; height: 100%; width: 100%; background: rgba(0,0,0,0.3); transform: scaleY(0); transform-origin: bottom; transition: transform 0s linear; pointer-events: none; }
.panic-btn.holding .panic-progress { transform: scaleY(1); transition: transform 3s linear; }
.btn-blotter { background: #fff1f2; color: #e11d48; border: 1px solid #fda4af; white-space: nowrap; }
.btn-blotter:hover { background: #e11d48; color: white; }
.scrollable-list { max-height: 400px; overflow-y: auto; }
.hotline-item { transition: 0.2s; cursor: pointer; border: 1px solid #eee; }
.hotline-item:hover { background-color: #fef2f2; border-color: #fee2e2; }
.hotline-number { font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.1rem; }

/* Resident Media Queries */
@media (max-width: 576px) {
    .toast-custom { right: 10px; left: 10px; min-width: auto; top: 10px; }
    .auth-card { padding: 30px 20px; }
    .hero-header { padding: 10px 0; }
    #greetName { max-width: 100%; white-space: normal; overflow: visible; font-size: 0.9rem; line-height: 1.2; }
    .btn-blotter { padding: 0 12px !important; font-size: 0.75rem; height: 38px; }
    .btn-header { width: 38px; height: 38px; }
    #servicesContainer { --bs-gutter-x: 0.75rem; --bs-gutter-y: 0.75rem; }
    .service-card { padding: 15px 5px; min-height: 140px; }
    .icon-box { width: 50px; height: 50px; font-size: 1.3rem; }
    #cartBar { padding: 12px 15px; border-radius: 15px 15px 0 0; }
    #cartBar h3 { font-size: 1.2rem; }
    #cartBar .btn { padding: 10px 20px !important; font-size: 0.9rem; }
    .panic-btn { bottom: 110px; right: 15px; width: 55px; height: 55px; font-size: 1.3rem; }
    .emergency-overlay { padding: 10px; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes pulseGreen { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
@keyframes pulseRed { 0% { background: rgba(220, 38, 38, 0.95); } 50% { background: rgba(185, 28, 28, 1); } 100% { background: rgba(220, 38, 38, 0.95); } }