@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+SC:wght@400;500;700;900&display=swap');
@import url('loading.css');

/**
 * Dashboard & Application Core Design System - Commercial Agency Group
 */
:root {
    --aw-logo-red: #E30613; --aw-red-primary: var(--aw-logo-red); --brand-primary-red: var(--aw-logo-red); --brand-primary-light: var(--aw-logo-red);
    --aw-logo-metallic-gray: #8C8C8C; --metallic-silver-hex: var(--aw-logo-metallic-gray);
    --aw-logo-dark-gray: #1A1A1A; --metallic-dark: var(--aw-logo-dark-gray);
    --aw-pure-black: #000000; --aw-black-metal: #0A0A0A;
    --aw-silver-highlights: #E6E6E6; --metallic-light: var(--aw-silver-highlights); --metallic-silver-gradient: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 50%, #E6E6E6 100%);
    --aw-red-dark: #A00000; --brand-primary: #891811; --brand-primary-hover: #70130E; --brand-primary-gradient: linear-gradient(135deg, var(--aw-logo-red, #E30613) 0%, var(--brand-primary, #891811) 100%);
    --color-primary: var(--brand-primary, #891811); --color-primary-light: var(--aw-logo-red, #E30613); --color-primary-neon: #a31811; --color-primary-hover: var(--brand-primary-hover, #70130E);
    --metallic-border: rgba(140, 140, 140, 0.35); --metallic-base: var(--aw-logo-metallic-gray, #8C8C8C);
    --bg-app: #F5F7FA; --bg-surface: #FFFFFF; --text-primary: #1A1A1A; --text-secondary: #5A5A5A;
    --color-bg-page: var(--bg-app); --color-surface: var(--bg-surface); --color-surface-translucent: rgba(255, 255, 255, 0.94); --color-nav-dark: #121316;
    --color-text-main: var(--text-primary); --color-text-muted: var(--text-secondary); --color-text-light: #8C8C8C;
    --action-success: #1B5E20; --action-success-hover: #144718; --action-success-bg: #E8F5E9; --action-destructive: #891811; --action-destructive-hover: #70130E;
    --color-success: var(--action-success); --color-warning: #f59e0b; --color-danger: var(--brand-primary);
    --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-pill: 9999px;
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.04); --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08); --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    --z-base: 1; --z-dropdown: 50; --z-fab: 85; --z-sheet: 150; --z-header: 300; --z-nav: 300; --z-modal: 10000; --z-lightbox: 10050; --z-toast: 100005;
    --font-main: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --app-header-height: 60px; --bottom-nav-height: 72px; --safe-area-bottom: env(safe-area-inset-bottom, 0px); --safe-area-top: env(safe-area-inset-top, 0px);
    --scroll-bottom-padding: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 24px); --scroll-top-padding: 6px;
}

[data-theme="dark"] { --bg-app: #121212; --bg-surface: #1E1E1E; --text-primary: #ECEFF1; --text-secondary: #90A4AE; --metallic-border: #37474F; --color-bg-page: #121212; --color-surface: #1E1E1E; --color-text-main: #ECEFF1; --color-text-muted: #90A4AE; --color-primary: var(--brand-primary, #891811); --color-primary-light: var(--aw-logo-red, #E30613); --color-primary-neon: #a31811; --color-primary-hover: var(--brand-primary-hover, #70130E); }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-main); -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; height: 100dvh; background-color: #0e1013; overflow: hidden; }
html[dir="rtl"] { direction: rtl; text-align: right; font-family: 'Cairo', -apple-system, sans-serif; }
html[dir="ltr"] { direction: ltr; text-align: left; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif; }
html[dir="ltr"] .user-info { flex-direction: row; }
html[dir="ltr"] .section-title-wrap { flex-direction: row; }
html[dir="ltr"] .section-link i { transform: rotate(180deg); }
html[dir="ltr"] .nav-logo-btn { left: 8px; right: auto; }
html[dir="ltr"] .nav-items-grid { grid-template-columns: 58px repeat(5, 1fr); padding-left: 0; padding-right: 6px; }

/* Responsive Viewport & App Container */
.viewport-wrapper { width: 100%; height: 100%; height: 100dvh; display: flex; justify-content: center; align-items: center; background: #14161a; overflow: hidden; }
.app-container { width: 100%; max-width: 440px; height: 100%; height: 100dvh; background-color: var(--color-bg-page); position: relative; display: flex; flex-direction: column; justify-content: flex-start; padding: 0; overflow: hidden; }
@media (min-width: 500px) { .viewport-wrapper { height: 100vh; height: 100dvh; overflow: hidden; } .app-container { height: min(920px, 96vh); height: min(920px, 96dvh); max-height: 96vh; max-height: 96dvh; border-radius: 46px; border: 4px solid #282a30; box-shadow: 0 25px 65px rgba(0, 0, 0, 0.6); padding: 0 6px; } }

/* Scrollable Body */
.scrollable-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-behavior: smooth; padding: var(--scroll-top-padding) 4px var(--scroll-bottom-padding); scrollbar-width: none; position: relative; width: 100%; box-sizing: border-box; }
.scrollable-body::-webkit-scrollbar { display: none; }

/* 1. Top Fixed Header */
.app-header { flex-shrink: 0; width: 100%; position: relative; top: 0; z-index: var(--z-header, 300); display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 6px) 6px 6px 6px; margin-bottom: 2px; background: rgba(245, 247, 250, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--metallic-border, rgba(176, 190, 197, 0.25)); transition: var(--transition); box-sizing: border-box; }
.app-header.scrolled { background: rgba(245, 247, 250, 0.98); border-bottom: 1px solid var(--metallic-border, #B0BEC5); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); padding-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-bottom: 10px; }
.user-info { display: flex; align-items: center; gap: 8px; overflow: hidden; min-width: 0; flex: 1; }
.user-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--metallic-light, #CFD8DC); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); transition: transform 0.2s ease, border-color 0.2s ease; }
.user-avatar:hover { transform: scale(1.04); border-color: var(--brand-primary, #C8102E); }
.user-details { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.user-name { font-size: 1rem; font-weight: 900; color: var(--text-primary, #121212); letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 6px; }

/* 2. Balance Card */
.balance-card { background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 45%, #E6E6E6 100%); border-radius: var(--radius-lg); height: 60px; padding: 6px 16px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85); margin-bottom: 16px; position: relative; border: 1.5px solid var(--metallic-border, rgba(140, 140, 140, 0.35)); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; }
.balance-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95); border-color: rgba(140, 140, 140, 0.55); transform: translateY(-1px); }
.card-logo-badge { position: absolute; top: 0; bottom: 0; left: 0; height: 100%; display: flex; align-items: center; justify-content: flex-start; pointer-events: none; z-index: 1; opacity: 1; overflow: hidden; -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 45%, rgba(0, 0, 0, 0) 100%); mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 45%, rgba(0, 0, 0, 0) 100%); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; transition: opacity 0.35s ease, transform 0.35s ease; }
html[dir="ltr"] .card-logo-badge { left: auto; right: 0; justify-content: flex-end; -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 45%, rgba(0, 0, 0, 0) 100%); mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.7) 45%, rgba(0, 0, 0, 0) 100%); }
.balance-card:hover .card-logo-badge { transform: scale(1.04) translateX(2px); }
.card-logo-badge img { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: left center; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.04)); }
html[dir="ltr"] .card-logo-badge img { object-position: right center; }
.balance-content { display: flex; align-items: center; gap: 8px; position: relative; z-index: 2; }
.balance-label { font-size: 0.95rem; font-weight: 800; color: var(--color-text-muted); }
.balance-dots { font-size: 1.15rem; font-weight: 800; color: var(--color-text-main); letter-spacing: 2px; min-width: 85px; text-align: center; }
.eye-toggle-btn { background: none; border: none; font-size: 1.15rem; color: var(--color-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 4px; transition: var(--transition); }
.eye-toggle-btn:active { transform: scale(0.88); }

/* 3. Hero Bulletin Slider */
.bulletin-slider {
    width: 100%;
    height: clamp(120px, 30vw, 200px);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #1A1A1A 0%, #2D3748 100%);
    border: 1px solid var(--metallic-border, rgba(140, 140, 140, 0.35));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
    transition: transform 0.3s var(--transition);
}
.bulletin-slider:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}
.bulletin-slides { position: relative; width: 100%; height: 100%; overflow: hidden; }
.bulletin-slide { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out; pointer-events: none; z-index: 1; }
.bulletin-slide.active { opacity: 1; visibility: visible; pointer-events: auto; z-index: 2; }
.bulletin-slide.is-graphic img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-lg); }
.bulletin-card-content { width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px; position: relative; box-sizing: border-box; }
.bulletin-card-body { display: flex; flex-direction: column; gap: 4px; max-width: 75%; z-index: 2; }
.bulletin-slide-tag { align-self: flex-start; font-size: 0.64rem; font-weight: 800; padding: 2px 8px; border-radius: var(--radius-pill, 9999px); background: var(--brand-primary-gradient, linear-gradient(135deg, #E30613 0%, #891811 100%)); color: #ffffff; box-shadow: 0 2px 8px rgba(137, 24, 17, 0.45); display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.2px; }
.bulletin-slide.is-graphic .bulletin-slide-tag { position: absolute; top: 10px; right: 12px; z-index: 5; }
.bulletin-slide-title { margin: 0; font-size: 0.95rem; font-weight: 800; color: #ffffff; line-height: 1.25; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulletin-slide-desc { margin: 0; font-size: 0.72rem; font-weight: 600; color: #e2e8f0; line-height: 1.3; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulletin-card-actions { display: flex; align-items: center; justify-content: flex-end; z-index: 2; }
.bulletin-cta-btn { padding: 4px 12px !important; font-size: 0.72rem !important; font-weight: 800 !important; border-radius: var(--radius-sm, 6px) !important; display: inline-flex !important; align-items: center !important; gap: 4px !important; text-decoration: none !important; white-space: nowrap !important; flex-shrink: 0 !important; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), inset 0 1px 1px #ffffff !important; transition: all 0.2s ease !important; }
.bulletin-cta-btn:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 2px #ffffff !important; }
.bulletin-indicators { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 10; }
.bulletin-dot { width: 6px; height: 6px; background-color: rgba(255, 255, 255, 0.45); border-radius: var(--radius-pill); transition: var(--transition); cursor: pointer; }
.bulletin-dot.active { width: 18px; background: var(--brand-primary-gradient, linear-gradient(135deg, #E30613 0%, #891811 100%)); box-shadow: 0 0 8px rgba(227, 6, 19, 0.7); }

/* 4. Modular App Sections */
.app-section { margin-bottom: 6px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; padding: 0 2px; }
.section-title-wrap { display: flex; align-items: center; gap: 6px; }
.section-title-wrap i { color: var(--color-primary); font-size: 0.85rem; }
.section-title { font-size: 0.85rem; font-weight: 800; color: var(--color-text-muted); letter-spacing: -0.3px; }
.section-link { font-size: 0.65rem; font-weight: 800; color: var(--color-primary); text-decoration: none; display: flex; align-items: center; gap: 4px; transition: var(--transition); }
.section-link:hover { color: var(--color-primary-light); transform: translateX(-3px); }
.agencies-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; }
.agencies-grid > .card, .agencies-grid > a { grid-column: span 2; }
.agencies-grid > .span-2 { grid-column: span 2 !important; }
.agencies-grid > .span-3 { grid-column: span 3 !important; }
.agencies-grid > .span-6 { grid-column: span 6 !important; }

/* 4.1 Store Filter Chips & Pills */
.store-filters-section { margin-bottom: 6px; }
.store-filter-bar-wrap { width: 100%; margin: 0 0 2px 0; overflow: hidden; position: relative; padding: 2px 0 4px 0; }
.store-filter-scroll { display: flex; align-items: center; gap: 8px; overflow-x: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 2px 6px 2px; cursor: grab; user-select: none; -webkit-user-select: none; width: 100%; box-sizing: border-box; }
.store-filter-scroll.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.store-filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip-btn { display: inline-flex; align-items: center; justify-content: center; height: 32px; min-height: 32px; gap: 6px; padding: 0 6px; border-radius: 8px; background: var(--bg-surface, #ffffff); border: 1px solid var(--metallic-border, rgba(176, 190, 197, 0.4)); color: var(--text-secondary, #546E7A); font-size: 0.8rem; font-weight: 700; cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); transition: var(--transition); position: relative; box-sizing: border-box; line-height: 1; }
.filter-chip-btn .chip-icon-wrap { font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary, #546E7A); line-height: 1; transition: color 0.2s ease, transform 0.2s ease; }
.filter-chip-btn .chip-label { display: inline-flex; align-items: center; line-height: 1; }
.filter-chip-btn:hover { border-color: var(--brand-primary, #C8102E); color: var(--brand-primary, #C8102E); box-shadow: 0 2px 8px rgba(200, 16, 46, 0.12); transform: translateY(-1px); }
.filter-chip-btn:hover .chip-icon-wrap { color: var(--brand-primary, #C8102E); transform: scale(1.08); }
.filter-chip-btn:active { transform: scale(0.96); }
.filter-chip-btn.active { background: var(--brand-primary-gradient, linear-gradient(135deg, #E52535 0%, #990012 100%)); color: #ffffff; border-color: transparent; box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3); }
.filter-chip-btn.active .chip-icon-wrap { color: #ffffff; }
.filter-chip-btn .chip-badge { font-size: 0.65rem; font-weight: 800; padding: 2px 3px; border-radius: 6px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; text-transform: uppercase; letter-spacing: 0.2px; }
.filter-chip-btn .chip-badge.badge-danger { background: #ff4757; color: #ffffff; }
.filter-chip-btn .chip-badge.badge-neon { background: #2ed573; color: #ffffff; }
.filter-chip-btn .chip-badge.badge-warning { background: #ffa502; color: #ffffff; }
.filter-chip-btn.active .chip-badge { background: rgba(255, 255, 255, 0.25); color: #ffffff; }

/* 5. Bottom Wave Navigation */
.bottom-nav-container { position: absolute; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-height, 72px); flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom, 0px); background-color: var(--color-nav-dark); box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(255, 255, 255, 0.08); display: flex; align-items: center; z-index: var(--z-nav, 300); overflow: hidden; }
@media (min-width: 500px) { .bottom-nav-container { border-bottom-left-radius: 42px; border-bottom-right-radius: 42px; } }
.nav-logo-btn { position: absolute; right: 8px; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff3b30 0%, #e10606 50%, #990000 100%); box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.6),inset 0 -2px 4px rgba(0, 0, 0, 0.35),0 4px 14px rgba(225, 6, 6, 0.45); display: flex; align-items: center; justify-content: center; border: 1.5px solid rgba(255, 255, 255, 0.4); z-index: 10; cursor: pointer; overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.nav-logo-btn:hover { box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.8), inset 0 -2px 4px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(225, 6, 6, 0.65); }
.nav-logo-btn:active { transform: scale(0.92); }
.nav-logo-btn img { width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.wave-svg-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.wave-svg-layer path { fill: none; stroke: url(#redFadeGradient); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0px 0px 6px rgba(163, 8, 18, 0.85)); transition: d 0.4s cubic-bezier(0.34, 1.25, 0.64, 1); }
.nav-items-grid { box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.6),inset 0 -2px 4px rgba(0, 0, 0, 0.35),0 4px 14px rgba(225, 6, 6, 0.45); border: 1.5px solid rgba(255, 255, 255, 0.4); width: 100%; height: 100%; display: grid; grid-template-columns: 58px repeat(5, 1fr); align-items: center; z-index: 5; padding-left: 6px; }
.nav-item { position: relative; background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #ffffff; cursor: pointer; height: 100%; transition: color 0.3s ease; user-select: none; padding: 0; width: 100%; }
.nav-item i { font-size: 19px; transition: var(--transition-bounce), color 0.3s ease; color: #ffffff; }
.nav-item span.nav-text { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1px; transition: transform 0.3s ease, color 0.3s ease; color: #ffffff; line-height: 1.1; }
.active-red-dot { position: absolute; bottom: 5px; width: 5px; height: 5px; background-color: var(--color-primary-neon); border-radius: 50%; opacity: 0; transform: scale(0); box-shadow: 0 0 6px rgba(230, 0, 35, 0.9); transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-item.active { color: #ffffff; }
.nav-item.active i { color: #ff2b47; transform: translateY(-2px) scale(1.12); }
.nav-item.active span.nav-text { color: #ffffff; font-weight: 800; }
.nav-item.active .active-red-dot { opacity: 1; transform: scale(1); }