/* =============================================
   Land Hub — Main Stylesheet
   Primary: #1A3A6E | Accent: #F59E0B | Success: #10B981
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary:       #1A3A6E;
    --primary-dark:  #0F2347;
    --primary-light: #2563EB;
    --accent:        #F59E0B;
    --success:       #10B981;
    --success-dark:  #059669;
    --danger:        #EF4444;
    --warning:       #F59E0B;
    --info:          #3B82F6;
    --bg:            #F1F5F9;
    --white:         #FFFFFF;
    --text:          #1E293B;
    --text-muted:    #64748B;
    --border:        #E2E8F0;
    --shadow:        0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg:     0 10px 40px rgba(0,0,0,0.12);
    --radius:        20px;
    --radius-sm:     12px;
    --radius-lg:     28px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: #CBD5E1;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    font-size: 15px;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, select, button, textarea { font-family: inherit; }

/* ── App Shell ── */
.app-shell {
    width: 100%;
    max-width: 480px;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 60px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    padding-bottom: 76px;
}

/* ── Page Header ── */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 0 14px;
    height: 60px;
    border-radius: 0;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.page-header .back-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    z-index: 20;
}
.page-header .back-btn i {
    pointer-events: none;
}
.page-header h1 {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 0 56px;
}
.page-header p {
    font-size: 11px;
    opacity: 0.65;
    text-align: center;
    margin-top: 2px;
    padding: 0 56px;
}

/* ── Content ── */
.content {
    padding: 16px 18px 0;
    margin-top: 0;
    position: relative;
    flex: 1;
}

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card + .card { margin-top: 16px; }

/* ── Wallet Pill ── */
.wallet-pill {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.wallet-pill:active { background: rgba(255,255,255,0.25); }
.wallet-pill i { color: var(--accent); font-size: 16px; }
.wallet-pill span { font-size: 15px; font-weight: 800; color: white; }

/* ── Form Elements ── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    margin-left: 2px;
}
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #F8FAFC;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.form-control:focus {
    border-color: var(--primary-light);
    background: var(--white);
}
.form-control::placeholder { color: #94A3B8; font-weight: 500; }
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 22px;
    padding-right: 36px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    width: 100%;
    text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(26,58,110,0.25);
}
.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 8px 20px rgba(16,185,129,0.25);
}
.btn-danger  { background: var(--danger);  color: white; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-sm { padding: 10px 16px; font-size: 13px; border-radius: 10px; width: auto; }
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    background: #F1F5F9;
    color: var(--text-muted);
    border: none;
}
.btn-icon:hover { background: var(--border); }

/* ── Apply CTA Button ── */
.btn-apply {
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 800;
    font-size: 16px;
    margin: 16px 0;
    box-shadow: 0 8px 24px rgba(26,58,110,0.28);
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-apply:active { transform: scale(0.97); color: white; }
.btn-apply span   { font-size: 12px; opacity: 0.8; font-weight: 600; }

/* ── Service Dashboard ── */
.stat-bar { display: flex; background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.stat-item { flex: 1; text-align: center; padding: 18px 10px; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-item i    { font-size: 24px; display: block; margin-bottom: 6px; }
.stat-item b    { font-size: 22px; font-weight: 900; color: var(--primary); display: block; }
.stat-item span { font-size: 9px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

.filter-row { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 10px; }
.filter-row .section-label { margin: 0; }
.filter-select { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--primary); outline: none; background: white; cursor: pointer; }

.doc-card { background: white; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); text-decoration: none; color: inherit; animation: fadeUp 0.3s ease; cursor: pointer; }
.status-bar-line { width: 5px; height: 48px; border-radius: 6px; flex-shrink: 0; }
.doc-info { flex: 1; }
.doc-info b    { font-size: 14px; font-weight: 800; display: block; color: var(--primary); }
.doc-info span { font-size: 12px; color: var(--text-muted); }
.doc-right { text-align: right; }
.doc-right b { font-size: 14px; font-weight: 800; color: var(--text); display: block; }
.doc-right .doc-date { font-size: 10px; color: var(--text-muted); margin-top: 3px; display: block; }
.btn-sm-action { font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 6px; border: none; cursor: pointer; margin-top: 6px; display: inline-block; text-decoration: none; }
.btn-pay      { background: #FEE2E2; color: var(--danger); }
.btn-download { background: #D1FAE5; color: var(--success-dark); }
.btn-waiting  { background: #DBEAFE; color: var(--info); cursor: default; }

/* ── Status Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-pending    { background: #FEE2E2; color: #EF4444; }
.badge-process    { background: #DBEAFE; color: #3B82F6; }
.badge-approval   { background: #D1FAE5; color: #10B981; }
.badge-rejected   { background: #F1F5F9; color: #94A3B8; }
.badge-cancelled  { background: #FEF3C7; color: #F59E0B; }

/* ── Bottom Navigation ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    background: var(--primary-dark);
    display: flex;
    justify-content: space-around;
    height: 60px;
    border-radius: 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.25);
    z-index: 1000;
}
.nav-item {
    text-decoration: none;
    color: rgba(255,255,255,0.38);
    text-align: center;
    flex: 1;
    position: relative;
    transition: color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.nav-item.active { color: var(--accent); }
.nav-item:active  { color: white; }
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
}
.nav-item i { font-size: 22px; display: block; margin-bottom: 3px; }
.nav-item span { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; }

/* ── Service Grid ── */
.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}
.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 18px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1.5px solid var(--border);
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.service-card:active { transform: scale(0.95); }
.service-card .svc-icon {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.service-card b { font-size: 14px; font-weight: 800; display: block; }
.service-card span { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: block; }
.service-card .badge-new {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    font-size: 9px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(239,68,68,0.4);
    animation: pulseBadge 2s infinite;
}

/* ── Order Cards ── */
.order-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: fadeUp 0.35s ease;
}
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 12px;
}
.service-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    background: #F1F5F9;
    border-radius: 8px;
    color: var(--text-muted);
}
.order-title { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 3px; }
.order-sub   { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Toast ── */
#toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 380px;
    pointer-events: none;
}
.toast {
    background: white;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    border-left: 5px solid var(--success);
    animation: slideDown 0.35s ease;
    pointer-events: all;
}
.toast.error { border-left-color: var(--danger); }
.toast.info  { border-left-color: var(--info); }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px 40px;
    color: var(--text-muted);
}
.empty-state i    { font-size: 52px; opacity: 0.35; display: block; margin-bottom: 16px; }
.empty-state h3   { font-size: 18px; color: var(--primary); margin-bottom: 6px; }
.empty-state p    { font-size: 13px; }

/* ── Offline Bar ── */
.offline-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--danger);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    font-weight: 800;
    z-index: 10000;
    display: none;
}

/* ── Section Label ── */
.section-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 10px 4px;
}

/* ── Divider ── */
.divider {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 16px 0;
}

/* ── Animations ── */
@keyframes fadeUp    { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulseBadge { 0%,100% { transform:scale(1); } 50% { transform:scale(1.1); } }
@keyframes ripple    { 0% { transform:scale(1); opacity:0.8; } 100% { transform:scale(3); opacity:0; } }
@keyframes popIn     { from { transform:scale(0.75); opacity:0; } to { transform:scale(1); opacity:1; } }
@keyframes spin      { to { transform: rotate(360deg); } }

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Modal Overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,35,71,0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.show { display: flex; }
.modal-card {
    background: white;
    width: 100%;
    max-width: 360px;
    border-radius: 28px;
    padding: 36px 24px 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: popIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
.modal-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 34px;
}
.modal-icon.success { background: var(--success); color: white; box-shadow: 0 10px 25px rgba(16,185,129,0.35); }
.modal-icon.warning { background: #FEF3C7; color: var(--warning); }
.modal-card h2 { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.modal-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }

/* ── Tab Switcher ── */
.tab-box {
    display: flex;
    background: #F1F5F9;
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 20px;
}
.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}
.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ── Footer Disclaimer ── */
.site-footer {
    text-align: center;
    padding: 24px 20px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.6;
}
.site-footer a { color: var(--primary-light); }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ── Select Bottom Sheet Modal ── */
.sm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s;
}
.sm-overlay.sm-open { opacity: 1; pointer-events: all; }
.sm-sheet {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%; max-width: 480px;
    height: 75vh;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
}
.sm-overlay.sm-open .sm-sheet { transform: translateY(0); }
.sm-handle { width: 40px; height: 4px; background: #CBD5E1; border-radius: 4px; margin: 10px auto 0; flex-shrink: 0; }
.sm-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 10px; flex-shrink: 0; }
.sm-title { font-size: 15px; font-weight: 800; color: #1E293B; }
.sm-close { background: #F1F5F9; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 13px; color: #64748B; display: flex; align-items: center; justify-content: center; }
.sm-search-wrap { position: relative; padding: 0 14px 12px; flex-shrink: 0; border-bottom: 1px solid #F1F5F9; }
.sm-search-icon { position: absolute; left: 26px; top: 50%; transform: translateY(-60%); color: #94A3B8; font-size: 13px; pointer-events: none; }
.sm-search { width: 100%; box-sizing: border-box; padding: 10px 14px 10px 34px; border: 1.5px solid #E2E8F0; border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; background: #F8FAFC; }
.sm-search:focus { border-color: var(--secondary); background: #fff; }
.sm-list { flex: 1; overflow-y: auto; padding: 4px 0 20px; }
.sm-item { padding: 14px 18px; font-size: 14px; font-weight: 600; color: #1E293B; cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #F8FAFC; -webkit-tap-highlight-color: transparent; }
.sm-item:active { background: #F5F8FF; }
.sm-item.sm-selected { color: var(--secondary); }
.sm-item.sm-selected::after { content: '✓'; font-weight: 900; font-size: 15px; }
.sm-empty { padding: 30px 18px; text-align: center; color: #94A3B8; font-size: 13px; }
