/* ================= RESET & CORE VARIABLES ================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

:root {
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f9fafb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-modal: 0 -20px 25px -5px rgb(0 0 0 / 0.1), 0 -10px 10px -5px rgb(0 0 0 / 0.04);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body { 
    background: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.5; 
    overflow-x: hidden; 
    width: 100vw;
    position: fixed;
    height: 100vh;
    overflow: hidden;
}

body.no-scroll { 
    overflow: hidden; 
    height: 100vh; 
    touch-action: none; 
}

#appView {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding-bottom: 90px;
}

/* ================= UTILITIES ================= */
.flex { display: flex; } 
.flex-col { flex-direction: column; } 
.items-center { align-items: center; } 
.justify-between { justify-content: space-between; } 
.justify-center { justify-content: center; } 
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; } 
.gap-2 { gap: 0.5rem; } 
.gap-3 { gap: 0.75rem; } 
.gap-4 { gap: 1rem; }
.w-full { width: 100%; } 
.h-full { height: 100%; } 
.flex-1 { flex: 1; }
.text-center { text-align: center; } 
.text-right { text-align: right; }
.font-bold { font-weight: 700; } 
.font-semibold { font-weight: 600; } 
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; } 
.text-xs { font-size: 0.75rem; } 
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-muted); } 
.text-primary { color: var(--primary); } 
.text-danger { color: var(--danger); } 
.text-success { color: var(--success); }
.mt-2 { margin-top: 0.5rem; } 
.mt-4 { margin-top: 1rem; } 
.mb-2 { margin-bottom: 0.5rem; } 
.mb-4 { margin-bottom: 1rem; } 
.p-4 { padding: 1rem; }
.ml-1 { margin-left: 0.25rem; }

/* ================= BUTTONS & INPUTS ================= */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.5rem; 
    padding: 0.875rem 1.25rem; 
    font-size: 0.9rem; 
    font-weight: 600; 
    border-radius: var(--radius-md); 
    border: none; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    outline: none; 
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-surface-hover); border-color: #94a3b8; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.form-control { 
    width: 100%; 
    padding: 0.875rem 1rem; 
    font-size: 0.95rem; 
    border: 1.5px solid var(--border); 
    border-radius: var(--radius-md); 
    background: var(--bg-body); 
    color: var(--text-main); 
    transition: 0.2s; 
    outline: none; 
}
.form-control:focus { 
    border-color: var(--primary); 
    background: var(--bg-surface); 
    box-shadow: 0 0 0 4px var(--primary-light); 
}
select.form-control { 
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); 
    background-repeat: no-repeat; 
    background-position: right 1rem center; 
    background-size: 1em; 
    padding-right: 2.5rem; 
}

/* ================= TOAST & LOADER ================= */
.toast-box { 
    position: fixed; 
    top: 1.5rem; 
    left: 50%; 
    transform: translateX(-50%) translateY(-100px); 
    background: var(--secondary); 
    color: white; 
    padding: 1rem 1.5rem; 
    border-radius: var(--radius-lg); 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    box-shadow: var(--shadow-lg); 
    z-index: 9999; 
    opacity: 0; 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    min-width: 300px; 
    max-width: 90vw; 
}
.toast-box.show { 
    transform: translateX(-50%) translateY(0); 
    opacity: 1; 
}
.toast-icon { 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.8rem; 
}
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }

/* ================= SEARCH ================= */
.search-wrapper { 
    position: relative; 
    margin-bottom: 1.5rem; 
}
.search-wrapper i { 
    position: absolute; 
    left: 1.25rem; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-muted); 
}
.search-input { 
    width: 100%; 
    padding: 1rem 1rem 1rem 3rem; 
    background: var(--bg-body); 
    border: 1.5px solid var(--border); 
    border-radius: var(--radius-lg); 
    font-size: 0.95rem; 
    outline: none; 
    transition: 0.2s; 
}
.search-input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px var(--primary-light); 
    background: white; 
}