/* =========================================================
   NOESIA PUBLIC CSS - FINAL INTELLIGENCE VERSION (v101.8)
   - Layout: FIXED 50/50 Donate/Map Grid (Side by Side)
   - Catalog: Big/Small View Support Enabled
   - UI: Sound Button Fix
   ========================================================= */

:root {
    --ns-bg-color: #f0f4f8;      
    --ns-text-color: #333333;
    --ns-card-bg: #ffffff;
    --ns-border: #e1e4e8;
    --ns-accent: #007AFF;
    --ns-success: #10b981;
    --ns-danger: #ef4444;
    --ns-warning: #f59e0b;
    --ns-gold: #FFD700;
    --ns-intel: #7c3aed;
}

body.ns-dark-mode, .ns-dark-mode {
    --ns-bg-color: #000000 !important;
    --ns-text-color: #ffffff !important;
    --ns-card-bg: #111111 !important;
    --ns-border: #333333 !important;
}

/* --- GLOBAL LAYOUT --- */
#ns-pbl-root, .ns-pbl-dashboard, .ns-app-container, .ns-analytics-wrapper, .swa-orders-wrapper {
    background-color: var(--ns-bg-color) !important;
    color: var(--ns-text-color) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    min-height: 100vh !important; 
    width: 100% !important; 
    padding: 20px !important; 
    box-sizing: border-box !important; 
    display: block !important;
    overflow-x: hidden !important;
}
* { box-sizing: border-box; }

/* Dark Mode Text Fixes */
.ns-dark-mode, .ns-dark-mode h1, .ns-dark-mode h2, .ns-dark-mode h3, 
.ns-dark-mode h4, .ns-dark-mode p, .ns-dark-mode span, .ns-dark-mode div, 
.ns-dark-mode li, .ns-dark-mode label, .ns-dark-mode td {
    color: #bbbbbb !important;
}
.ns-dark-mode strong, .ns-dark-mode b { color: #ffffff !important; }
#ns-donate-btn, #ns-donate-btn span, #ns-donate-btn strong { color: #333 !important; }

/* --- TABS --- */
.ns-app-tabs { display: flex; gap: 10px; margin-bottom: 25px; overflow-x: auto; padding-bottom: 10px; border-bottom: 2px solid var(--ns-border); }
.ns-app-tab { background: var(--ns-card-bg); border: 1px solid var(--ns-border); padding: 12px 25px; border-radius: 30px; font-weight: 700; color: #888; cursor: pointer; white-space: nowrap; transition: all 0.2s; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; }
.ns-app-tab.active { background: var(--ns-accent); color: white !important; border-color: var(--ns-accent); box-shadow: 0 4px 10px rgba(0,122,255,0.3); transform: scale(1.05); }
.ns-app-content { display: none !important; animation: nsFadeIn 0.3s ease; }
.ns-app-content.active { display: block !important; }
@keyframes nsFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- MANAGER & DASHBOARD --- */
.ns-manager-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; gap: 15px; flex-wrap: wrap; }
.ns-mgr-logo-wrapper img { height: 50px !important; width: auto !important; max-width: 100%; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.ns-pbl-dash-head { display: flex; justify-content: space-between; align-items: center; background: var(--ns-card-bg); padding: 20px; border-radius: 16px; margin-bottom: 25px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }

/* Sound Button Fix */
.ns-sound-toggle-btn { position: relative; z-index: 99999 !important; cursor: pointer !important; user-select: none; }

.ns-pbl-status-btn { background: #fff; border: 1px solid #e5e7eb; padding: 10px 20px; border-radius: 12px; font-weight: 700; cursor: pointer; color: #444; font-size: 14px; margin-left: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.2s; display: inline-flex; align-items: center; gap: 5px; }
.ns-pbl-status-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.08); }

.ns-pbl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; width: 100%; }
.ns-pbl-card { background: var(--ns-card-bg); padding: 25px; border-radius: 16px; border: 1px solid var(--ns-border); box-shadow: 0 5px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; position: relative; transition: transform 0.2s; min-height: 180px; justify-content: space-between; }
.ns-pbl-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.ns-dark-mode .ns-pbl-card { background: #222 !important; border-color: #444 !important; }

.ns-pbl-card-head { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: flex-start; }
.ns-loc-main { font-size: 20px; font-weight: 900; color: var(--ns-text-color); }
.ns-loc-sub { font-size: 13px; color: #888; margin-top: 2px; font-weight: 500; }
.ns-edit-table { cursor: pointer; color: var(--ns-accent); margin-left: 5px; font-size: 14px; }
.ns-pbl-card-label { padding: 8px; border-radius: 8px; text-align: center; font-weight: bold; margin-bottom: 15px; display: block; font-size: 14px; }

.ns-time-badge { background: #f3f4f6; color: #555; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: bold; border: 1px solid #e5e7eb; }

/* Status Colors */
.type-bill { background-color: #dbeafe !important; color: #1e40af !important; }
.type-waiter { background-color: #f3f4f6 !important; color: #1f2937 !important; }
.type-order { background-color: #fee2e2 !important; color: #991b1b !important; }
.type-note { background-color: #fffbeb !important; color: #b45309 !important; }

/* Buttons */
.ns-create-pay-btn, .ns-btn-generator { width: 100%; padding: 12px; background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%); color: white !important; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; margin-bottom: 8px; font-size: 14px; box-shadow: 0 4px 10px rgba(0,122,255,0.3); transition: transform 0.1s; }
.ns-pbl-done { width: 100%; padding: 12px; background: #f2f2f2; border: 1px solid #e0e0e0; border-radius: 10px; font-weight: bold; cursor: pointer; color: #333; text-transform: uppercase; font-size: 13px; }
.ns-confirm-cash-btn { transition: all 0.2s; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); }
.ns-confirm-cash-btn:hover { background: #059669 !important; transform: translateY(-2px); }

/* --- ORDERS GRID --- */
.swa-orders-grid { display: grid !important; gap: 20px !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; width: 100%; }
.swa-order-card { background: var(--ns-card-bg); padding: 0; border-radius: 16px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid var(--ns-border); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.ord-head { background: #f8f9fa; padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #ccc; font-size: 13px; font-weight: 700; color: #555; }
.ns-dark-mode .ord-head { background: #222; border-color: #444; color: #ccc; }
.ord-body { padding: 25px; text-align: center; }
.ord-table { font-size: 32px; font-weight: 900; color: var(--ns-text-color); margin-bottom: 15px; }
.ord-total { font-size: 20px !important; color: #10b981 !important; font-weight: 900 !important; display: inline-block; margin-top: 5px; border: 2px solid #10b981; padding: 5px 15px; border-radius: 8px; background: rgba(16, 185, 129, 0.1); }

/* --- ANALYTICS --- */
.ns-analytics-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.ns-weather-widget { background: var(--ns-card-bg); padding: 10px 20px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 15px; border: 1px solid var(--ns-border); }
.ns-w-main { font-size: 24px; font-weight: bold; color: var(--ns-text-color); }
.ns-w-meta { font-size: 12px; color: #fff; text-transform: uppercase; font-weight: 700; }

.ns-stats-top-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 30px; }
.ns-stat-card { padding: 25px; border-radius: 16px; color: white !important; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 8px 15px rgba(0,0,0,0.1); position: relative; overflow: hidden; min-height: 140px; }
.card-today { background: linear-gradient(135deg, #11998e, #38ef7d); } 
.card-yesterday { background: linear-gradient(135deg, #3a7bd5, #3a6073); } 
.card-week { background: linear-gradient(135deg, #834d9b, #d04ed6); } 
.card-month { background: linear-gradient(135deg, #ff9966, #ff5e62); } 
.card-year { background: linear-gradient(135deg, #f12711, #f5af19); }

#ns-pbl-root .card-pending, .ns-analytics-wrapper .card-pending, .card-pending, body.ns-dark-mode .card-pending {
    background: linear-gradient(135deg, #000000 0%, #e0f7fa 100%) !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    color: #000000 !important;
}
#ns-pbl-root .card-pending *, .card-pending * { color: #000000 !important; }

.ns-stat-value { font-size: 32px; font-weight: 900; margin: 5px 0; line-height: 1.2; color: #000 !important; }
.ns-stat-label { font-size: 14px; opacity: 0.9; text-transform: uppercase; margin-bottom: 5px; font-weight: 600; color: #000 !important; }
.ns-stat-sub { font-size: 13px; opacity: 0.8; margin-top: 5px; color: #fff !important; }
.ns-stat-icon { font-size: 30px; opacity: 0.3; position: absolute; top: 20px; right: 20px; }

.ns-chart-container { background: var(--ns-card-bg); border-radius: 16px; padding: 25px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid var(--ns-border); }
.ns-bar-chart { display: flex !important; align-items: flex-end !important; justify-content: space-between !important; height: 200px !important; width: 100% !important; padding-top: 20px; }
.ns-chart-bar { background: #007AFF; width: 100%; border-radius: 5px 5px 0 0; transition: height 1s ease; opacity: 0.8; min-height: 5px; }

.ns-insights-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
@media (min-width: 1100px) { .ns-insights-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.ns-insight-box { background: var(--ns-card-bg); border-radius: 16px; padding: 25px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid var(--ns-border); }
.ns-insight-box h3 { margin-top: 0; color: var(--ns-text-color); border-bottom: 1px solid var(--ns-border); padding-bottom: 15px; margin-bottom: 20px; font-size: 16px; text-transform: uppercase; letter-spacing: 0.5px; }

.table-scroll-container { max-height: 300px; overflow-y: auto; overflow-x: hidden; padding-right: 5px; }
.ns-live-table-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.ns-lt-name { font-weight: bold; color: var(--ns-text-color); }
.ns-lt-time { color: #888; font-size: 12px; background: #f0f0f0; padding: 2px 6px; border-radius: 4px; }
.ns-ranking-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #eee; font-size: 14px; color: #333; }
.ns-badge { background: #e7f7ed; color: #065f46; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; }

/* --- AI SCHEDULER & CALENDAR --- */
.ns-sched-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ns-sched-card { background: var(--ns-card-bg); padding: 25px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid var(--ns-border); position: relative; transition: transform 0.2s; overflow: hidden; }
.ns-sched-day { font-size: 13px; text-transform: uppercase; font-weight: 700; color: #999; margin-bottom: 5px; }
.ns-sched-date { font-size: 22px; font-weight: 800; color: var(--ns-text-color); margin-bottom: 15px; display: block; }
.ns-sched-score { position: absolute; top: 20px; right: 20px; padding: 5px 12px; border-radius: 20px; font-weight: bold; color: white; font-size: 12px; }
.score-high { background: var(--ns-danger); } .score-med { background: var(--ns-warning); } .score-low { background: var(--ns-success); }
.ns-sched-meta { background: #f9fafb; padding: 15px; border-radius: 10px; margin-top: 15px; border: 1px solid #eee; font-size: 14px; color: #555; }
.ns-sched-tip { margin-top: 15px; font-size: 13px; color: #4b5563; font-style: italic; background: #eff6ff; padding: 10px; border-radius: 8px; border-left: 3px solid #3b82f6; }

.ns-calendar-wrapper { background: var(--ns-card-bg); padding: 25px; border-radius: 16px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid var(--ns-border); }
.ns-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.ns-cal-header h2 { margin: 0; font-size: 20px; color: var(--ns-text-color); text-transform: uppercase; }
.ns-cal-nav { background: #f0f0f0; border: none; width: 40px; height: 40px; border-radius: 50%; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 18px; color: #555; }
.ns-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.ns-cal-day { position: relative; height: 100px; border: 1px solid var(--ns-border); border-radius: 12px; padding: 8px; cursor: pointer; background: #fafafa; transition: 0.2s; display: flex; flex-direction: column; overflow: hidden; }
.ns-cal-day:hover { background: #fff; border-color: var(--ns-accent); transform: translateY(-2px); }
.ns-cal-day.today { border: 2px solid var(--ns-success); background: #e7f7ed; }
.ns-cal-num { font-weight: bold; font-size: 14px; margin-bottom: 5px; }
.ns-cal-note-text { font-size: 11px; color: #555; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }

/* Dark Mode Calendar */
.ns-dark-mode .ns-calendar-wrapper { background: #222 !important; border-color: #444 !important; }
.ns-dark-mode .ns-cal-day { background: #333 !important; border-color: #555 !important; }
.ns-dark-mode .ns-cal-num { color: #fff !important; }
.ns-dark-mode .ns-cal-note-text { color: #ccc !important; }
.ns-dark-mode .ns-cal-nav { background: #444 !important; color: #fff !important; }

/* --- CLIENT MENU UI --- */
.ns-pbl-app-header { text-align: center; margin-bottom: 20px; }
.ns-pbl-app-logo { width: 90px !important; height: 90px !important; object-fit: cover !important; border-radius: 50%; margin: 0 auto 15px; display: block; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.ns-pbl-app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-width: 500px; margin: 0 auto 25px; }
.ns-pbl-full-width { grid-column: span 2; width: 100%; }

.ns-pbl-card-btn { background: var(--ns-card-bg); color: var(--ns-text-color); border-radius: 16px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: none; min-height: 120px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: bold; font-size: 15px; transition: transform 0.1s; }
.ns-dark-mode .ns-pbl-card-btn { background: #333 !important; color: #fff !important; border: 1px solid #555 !important; box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important; }
.ns-dark-mode .ns-pbl-card-btn span { color: #ffffff !important; }
.ns-pbl-card-btn:active { transform: scale(0.95); }

.ns-shop-title { font-size: 24px; margin: 10px 0; color: #333; }
.ns-dark-mode .ns-shop-title { color: #fff !important; }

.ns-pbl-payment-btn { background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%) !important; color: white !important; border: none; padding: 20px 25px; font-size: 18px; font-weight: 800; border-radius: 15px; width: 100%; box-shadow: 0 10px 20px rgba(0,122,255,0.3); cursor: pointer; text-transform: uppercase; transition: transform 0.1s; }
.ns-pbl-cash-btn { background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%) !important; color: white !important; }

/* --- FIXED SQUARE 50/50 DONATE & MAP GRID (MEDIUM SIZE) --- */
.ns-charity-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Forces 2 columns */
    gap: 15px;
    height: 220px !important; /* Fixed Medium Height */
    margin-top: 20px;
    margin-bottom: 25px;
    overflow: hidden;
}

/* Map specific override to fit the square */
.ns-client-map {
    width: 100% !important;
    height: 100% !important; 
    min-height: 0 !important;
    margin: 0 !important; 
    border-radius: 16px; 
    border: 2px solid #333;
    background-color: #1a1a2e;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/e/ec/World_map_blank_without_borders.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: block !important;
}

/* Donate Button specific override to fit the square */
#ns-donate-btn { 
    width: 100% !important;
    height: 100% !important; 
    min-height: 0 !important; 
    padding: 10px !important; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
#ns-donate-btn .ns-pbl-icon { font-size: 32px !important; margin-bottom: 10px !important; }
#ns-donate-btn span { font-size: 14px !important; line-height: 1.4; display:block !important; }

/* Donate Button Text Contrast - Black for Yellow BG */
#ns-donate-btn span, #ns-donate-btn strong {
    color: #000000 !important; /* Force black for contrast on yellow/white bg */
}
.ns-dark-mode #ns-donate-btn span, .ns-dark-mode #ns-donate-btn strong {
    color: #000000 !important;
}

/* Next Donation Box (Client Modal) - Styling */
.ns-next-donation-box {
    background: #fffbeb;
    color: #333;
    border: 1px dashed #d97706;
}

/* Dark Mode Fixes for Donation Box */
.ns-dark-mode .ns-next-donation-box {
    background: #451a03 !important; /* Dark brown/orange */
    border-color: #92400e !important;
}
.ns-dark-mode .ns-next-donation-box strong {
    color: #fbbf24 !important; /* Amber */
}
.ns-dark-mode .ns-next-donation-box div {
    color: #ffffff !important;
}
.ns-dark-mode .ns-next-donation-box span {
    color: #fff !important;
}
.ns-dark-mode .ns-next-donation-box p {
    color: #ccc !important;
    border-color: #555 !important;
}

/* MAP INTERNALS */
#ns-live-map { width: 100%; overflow: hidden; position: relative; }
.ns-map-stats-overlay { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.8); padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); color: #fff !important; max-width: 90%; font-size: 10px; backdrop-filter: blur(4px); z-index: 5; }
.ns-map-quote { font-style: italic; color: #ddd !important; margin-bottom: 5px; font-size: 10px; line-height: 1.2; display: none; } /* Hidden on small map */
.ns-map-data-row { font-weight: bold; margin-bottom: 5px; color: #fff !important; }
.ns-map-drop-row { background: linear-gradient(135deg, #3b82f6, #6366f1); color: white !important; padding: 4px 8px; border-radius: 8px; font-size: 10px; display: inline-block; }
.ns-map-hero-card { background: #ffffff !important; padding: 10px; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 2px solid #FFD700; margin-top: 5px; min-width: 150px; color: #000 !important; }
.ns-hero-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: #FFD700 !important; font-weight: 900; }
#ns-hero-msg { font-size: 11px !important; }
.ns-pulse-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; border-radius: 50%; border: 5px solid #FFD700; opacity: 0; animation: pulseRing 2s ease-out infinite; }
@keyframes pulseRing { 0% { width: 20px; height: 20px; opacity: 1; border-width: 5px; } 100% { width: 200px; height: 200px; opacity: 0; border-width: 0px; } }
.ns-map-info-win { position: absolute; bottom: 10px; left: 10px; right: 10px; background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,1)); border: 1px solid #FFD700; padding: 8px; border-radius: 8px; color: #FFD700 !important; font-weight: 800; font-size: 11px; text-align: center; z-index: 10; }

/* --- OTHER ELEMENTS --- */
.ns-msg-container { text-align: center; margin: 20px 0; width: 100%; }
.ns-msg-btn { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white !important; border: none; padding: 12px 25px; border-radius: 50px; font-size: 15px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.ns-social-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding-bottom: 30px; }
.ns-social-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; font-weight: 700; text-decoration: none; font-size: 14px; color: white !important; transition: transform 0.2s; min-width: 110px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.ns-btn-call { background: #10b981; } .ns-btn-google { background: #4285F4; } .ns-btn-insta { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); } .ns-btn-fb { background: #1877F2; }

/* Sticky & Modals */
#ns-sticky-status { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #ffc107; color: #000; padding: 12px 30px; border-radius: 50px; font-weight: 900; cursor: pointer; z-index: 9999; display: none; box-shadow: 0 10px 30px rgba(0,0,0,0.3); white-space: nowrap; border: 3px solid #fff; animation: slideUp 0.5s ease; }
#ns-sticky-status.ready { background: #10b981; color: white; border-color: #047857; }
.ns-dark-mode #ns-sticky-status { color: #ffffff !important; border-color: #ffffff !important; box-shadow: 0 5px 20px rgba(255,255,255,0.2) !important; }
@keyframes slideUp { from { transform: translate(-50%, 100px); } to { transform: translate(-50%, 0); } }
.ns-modal-overlay, .ns-status-popup { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 100000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.ns-modal-overlay.ns-show, .ns-status-popup.ns-show { display: flex; }
.ns-modal-box, .ns-status-content { background: var(--ns-card-bg); width: 90%; max-width: 450px; padding: 35px; border-radius: 20px; text-align: center; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: popIn 0.3s ease; }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.ns-close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: #999; z-index: 1001; }

.ns-tip-options { display: flex; justify-content: center; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.ns-tip-select { padding: 12px 20px; border: 2px solid #eee; border-radius: 12px; background: #f9f9f9; font-weight: 700; cursor: pointer; min-width: 60px; text-align: center; color: #333; }
.ns-tip-select.selected { background: #007AFF; color: white; border-color: #007AFF; transform: scale(1.1); box-shadow: 0 5px 15px rgba(0,122,255,0.3); }
.ns-dark-mode .ns-tip-select { background: #333 !important; border-color: #555 !important; color: #fff !important; }
.ns-dark-mode .ns-tip-select.selected { background: #007AFF !important; border-color: #007AFF !important; color: #fff !important; }
.ns-tip-no { background: #fff; border: 2px solid #ccc; color: #777; font-weight: 800; padding: 15px; width: 100%; border-radius: 12px; font-size: 16px; margin-top: 15px; cursor: pointer; }
.ns-dark-mode .ns-tip-no { background: #333 !important; color: #ccc !important; border-color: #555 !important; }

/* FIX: Popup Contrast Dark */
.ns-dark-mode .ns-status-content div[style*="background:#f0fbf7"], .ns-dark-mode .ns-receipt-ready-box { background: #064e3b !important; border-color: #065f46 !important; color: #a7f3d0 !important; }
.ns-dark-mode .ns-status-content div[style*="background:#f0fbf7"] strong, .ns-dark-mode .ns-receipt-ready-box strong { color: #fff !important; }

/* Safety & Treats */
.ns-safety-shield-btn { width: 100%; padding: 18px; background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 800; text-transform: uppercase; cursor: pointer; box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3); }
.ns-safety-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 15px 0; }
.ns-safety-option { background: #f9f9f9; border: 2px solid #eee; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: bold; font-size: 14px; transition: 0.2s; }
.ns-safety-option.selected { border-color: #ef4444; background: #fef2f2; color: #b91c1c; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1); }
.ns-dark-mode .ns-safety-option { background: #333 !important; border-color: #555 !important; color: #ccc !important; }
.ns-dark-mode .ns-safety-option.selected { background: #7f1d1d !important; border-color: #991b1b !important; color: #fca5a5 !important; }
.ns-treat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; margin-top: 20px; }
.ns-treat-btn { background: #f9f9f9; border: 1px solid #ddd; border-radius: 12px; padding: 10px; cursor: pointer; transition: all 0.2s; font-size: 12px; font-weight: bold; color: #555; }
.ns-treat-btn:hover { background: #e91e63; color: white; border-color: #e91e63; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3); }

.ns-history-table-container { background: var(--ns-card-bg); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.08); border: 1px solid var(--ns-border); margin: 30px auto; max-width: 900px; }
.ns-history-table { width: 100%; border-collapse: collapse; text-align: center; }
.ns-history-table th { background: #f8f9fa; padding: 18px; font-size: 14px; text-transform: uppercase; color: #555; border-bottom: 2px solid #e1e4e8; text-align: center; font-weight: 800; }
.ns-history-table td { padding: 18px; border-bottom: 1px solid #f0f0f0; color: #333; font-size: 15px; }
.ns-history-status { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; text-transform: uppercase; background:#eee; color:#555; }

/* --- RICH CATALOG DESIGN --- */
#ns-catalog-wrapper { margin: 40px auto; text-align: center; position: relative; z-index: 5; padding-bottom: 40px; }

.ns-cat-nav { display: flex; justify-content: center !important; flex-wrap: wrap; gap: 12px !important; padding: 15px 0 25px 0; }
@media(max-width: 768px) { .ns-cat-nav { justify-content: flex-start !important; flex-wrap: nowrap !important; overflow-x: auto; padding-left: 20px; padding-right: 20px; -webkit-overflow-scrolling: touch; } .ns-cat-pill { flex: 0 0 auto; } }
.ns-cat-pill { background: #ffffff !important; color: #555 !important; border: 1px solid #f0f0f0 !important; box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important; padding: 12px 25px !important; font-size: 15px !important; font-weight: 700 !important; border-radius: 50px !important; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important; cursor: pointer; letter-spacing: 0.5px; }
.ns-cat-pill:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important; color: #333 !important; }
.ns-cat-pill.active { background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%) !important; color: #ffffff !important; border-color: #007AFF !important; box-shadow: 0 8px 20px rgba(0,122,255,0.4) !important; transform: scale(1.05); }

/* CATALOG VIEWS */
.ns-view-toggle { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 20px; padding-right: 20px; }
.ns-view-btn { padding: 8px 15px; border-radius: 8px; border: 1px solid #ddd; background: white; cursor: pointer; font-weight: bold; transition: all 0.2s; }
.ns-view-btn.active { background: #333; color: white; border-color: #333; }

.ns-cat-section { display: grid; gap: 20px !important; padding: 10px; }
.ns-catalog-item { background: #ffffff !important; border: none !important; border-radius: 24px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important; transition: all 0.3s ease !important; display: flex; flex-direction: column; justify-content: space-between; text-align: center !important; align-items: center !important; min-height: 180px !important; position: relative; overflow: hidden; cursor: pointer; padding: 20px !important; }
.ns-cat-header { display: block; grid-column: 1 / -1; text-align: left; margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.ns-cat-header h4 { font-size: 24px; color: #333; margin: 0; font-weight: 800; }
.ns-dark-mode .ns-cat-header h4 { color: #fff; }

/* 1. GRID VIEW (Small/Default) */
.ns-catalog-container.grid-view .ns-cat-section { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; }

/* 2. LIST VIEW */
.ns-catalog-container.list-view .ns-cat-section { display: block !important; }
.ns-catalog-container.list-view .ns-catalog-item { display: flex; flex-direction: row; align-items: center; text-align: left !important; min-height: auto !important; margin-bottom: 10px; padding: 15px 20px !important; border-radius: 12px !important; }
.ns-catalog-container.list-view .ns-cat-emoji { font-size: 32px !important; margin-right: 20px; margin-bottom: 0; }
.ns-catalog-container.list-view .ns-cat-info { flex: 1; }
.ns-catalog-container.list-view .ns-cat-title { font-size: 18px !important; margin-bottom: 4px; }
.ns-catalog-container.list-view .ns-cat-actions { display: flex; align-items: center; gap: 15px; margin-top: 0; }
.ns-catalog-container.list-view .ns-add-badge { position: static; width: 30px; height: 30px; }

/* 3. BIG VIEW (ENHANCED FOR FRONTEND) */
.ns-catalog-container.big-view .ns-cat-section { 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important; 
}
.ns-catalog-container.big-view .ns-catalog-item { 
    min-height: 300px !important; 
    padding: 30px !important;
}
.ns-catalog-container.big-view .ns-cat-emoji { 
    font-size: 80px !important; 
    margin-bottom: 20px; 
}
.ns-catalog-container.big-view .ns-cat-title { 
    font-size: 22px !important; 
    margin-bottom: 10px;
}
.ns-catalog-container.big-view .ns-cat-desc { 
    font-size: 15px !important; 
    margin-bottom: 20px;
}
.ns-catalog-container.big-view .ns-cat-price {
    font-size: 18px !important;
    padding: 8px 18px;
}

/* Item Styling */
.ns-cat-emoji { font-size: 48px !important; margin-bottom: 12px; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.1)); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.ns-catalog-item:hover .ns-cat-emoji { transform: scale(1.2) rotate(5deg); }
.ns-cat-title { font-size: 16px !important; font-weight: 800 !important; color: var(--ns-text-color); margin-bottom: 6px; line-height: 1.3; }
.ns-cat-desc { font-size: 12px !important; color: #888; margin-bottom: 15px; line-height: 1.4; max-width: 90%; opacity: 0.8; }
.ns-cat-price { background: #e7f7ed; color: #10b981; padding: 6px 14px; border-radius: 20px; font-weight: 900 !important; font-size: 14px !important; box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2); }
.ns-dark-mode .ns-cat-pill { background: #333 !important; border-color: #444 !important; color: #ccc !important; }
.ns-dark-mode .ns-cat-pill.active { background: #007AFF !important; color: #fff !important; }
.ns-dark-mode .ns-catalog-item { background: #222 !important; box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important; }
.ns-dark-mode .ns-cat-title { color: #fff !important; }
.ns-dark-mode .ns-cat-price { background: #064e3b; color: #a7f3d0; }

.vibration-btn { background: transparent !important; border: 1px solid var(--ns-border); border-radius: 50px; padding: 8px 20px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #888; transition: all 0.3s ease; box-shadow: none !important; }
.ns-dark-mode .vibration-btn { background: transparent !important; border-color: #777 !important; color: #ccc !important; }
.vibration-btn.active, .ns-dark-mode .vibration-btn.active { background: rgba(212, 175, 55, 0.1) !important; color: #d4af37 !important; border-color: #d4af37 !important; }

.ns-add-badge { position: absolute; bottom: 10px; right: 10px; width: 24px; height: 24px; background: var(--ns-accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: transform 0.2s; }
.ns-catalog-item:hover .ns-add-badge { transform: scale(1.2); }

#ns-cart-fab { display: flex !important; align-items: center !important; justify-content: center !important; color: #ffffff !important; font-size: 24px !important; box-shadow: 0 10px 30px rgba(0,122,255,0.5) !important; text-shadow: 0 1px 3px rgba(0,0,0,0.2); background:#fff!important; }
.ns-dark-mode #ns-cart-close, .ns-dark-mode .ns-remove-item { color: #ffffff !important; }

.ns-seat-btn { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: white !important; border: none; padding: 15px 30px; border-radius: 50px; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4); transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin: 15px auto; }
.ns-seat-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(236, 72, 153, 0.6); }
.ns-seat-btn.active { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); }

.ns-social-wrapper { background: #fff; border-radius: 16px; padding: 20px; margin: 20px 0; display: flex !important; flex-direction: column !important; align-items: center !important; text-align: center !important; border: 1px solid #e1e4e8; box-shadow: 0 5px 15px rgba(0,0,0,0.03); position: relative; z-index: 10; }
.ns-dark-mode .ns-social-wrapper { background: #2d2d2d !important; border-color: #444 !important; }
.ns-dark-mode .ns-social-header h3 { color: #FFD700 !important; }
.ns-dark-mode .ns-social-header p { color: #fff !important; opacity: 0.8; }
.ns-dark-mode #ns-open-tables-list { color: #fff !important; }

.ns-info-btn { width: 24px; height: 24px; background: #f0f0f0; color: #555; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; font-family: monospace; cursor: pointer; margin-right: 8px; border: 1px solid #ccc; transition: transform 0.2s; }
.ns-info-btn:hover { background: #007AFF; color: #fff; border-color: #007AFF; transform: scale(1.1); }
.ns-cat-actions { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 10px; }
@media (min-width: 1024px) { .ns-catalog-container.list-view .ns-cat-actions { margin-top: 0; justify-content: flex-end; } }

.ns-detail-box { width: 95% !important; max-width: 600px !important; background: #fff; border-radius: 20px; padding: 25px; box-shadow: 0 25px 50px rgba(0,0,0,0.3); position: relative; max-height: 90vh; overflow-y: auto; animation: slideUpFade 0.4s ease; }
@keyframes slideUpFade { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ns-detail-box h2 { font-size: 22px; color: #333; margin-bottom: 10px; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; }
.ns-detail-box img { box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.ns-detail-box .ns-close-btn { top: 15px; right: 15px; font-size: 28px; color: #333; background: rgba(255,255,255,0.8); backdrop-filter: blur(2px); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.ns-dark-mode .ns-detail-box { background: #222; color: #fff; }
.ns-dark-mode .ns-detail-box h2 { color: #fff; border-color: #444; }
.ns-dark-mode .ns-detail-box #ns-detail-text { color: #ccc !important; }
.ns-dark-mode .ns-info-btn { background: #333; border-color: #555; color: #ccc; }

/* --- TOAST NOTIFICATIONS (RESTORED) --- */
#ns-pbl-toast {
    visibility: hidden; min-width: 250px; background-color: #333; color: #fff;
    text-align: center; border-radius: 12px; padding: 16px; position: fixed;
    z-index: 100000; left: 50%; bottom: 30px; font-size: 16px; font-weight: bold;
    transform: translateX(-50%); box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
#ns-pbl-toast.show { visibility: visible; -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@-webkit-keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@-webkit-keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }