* { box-sizing: border-box; margin:0; padding:0; }
:root {
    --red: #E53935;
    --white: #FFFFFF;
    --dark: #212121;
    --light-bg: #f5f5f5;
    --card-bg: rgba(255,255,255,0.8);
    --glass-blur: blur(10px);
    --border-radius: 16px;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: 0.3s ease;
}
body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--light-bg);
    color: var(--dark);
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
    --card-bg: rgba(30,30,30,0.8);
}
/* splash */
#splash-screen {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: var(--red);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.8s ease;
}
.loader { display: flex; gap: 8px; margin-top: 20px; }
.dot { width: 12px; height: 12px; background: white; border-radius: 50%; animation: bounce 1.2s infinite ease-in-out; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
/* topbar */
.topbar {
    background: var(--red); color: white; padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
    position: fixed; top:0; left:0; right:0; z-index:1000;
}
.icon-btn {
    background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; margin-left:10px;
}
.main-content {
    padding: 70px 16px 90px;
    max-width: 960px; margin: 0 auto;
}
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--white); border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 12px rgba(229,57,53,0.3);
    display: flex; justify-content: space-around; padding: 10px 0;
    z-index: 1000;
}
body.dark-mode .bottom-nav { background: #1e1e1e; }
.nav-item {
    display: flex; flex-direction: column; align-items: center; color: #888; text-decoration: none; font-size: 0.7rem;
}
.nav-item.active { color: var(--red); }
.nav-item ion-icon { font-size: 1.5rem; }
/* cards */
.card {
    background: var(--card-bg); backdrop-filter: var(--glass-blur);
    border-radius: var(--border-radius); padding: 16px; margin-bottom: 16px;
    box-shadow: var(--shadow); transition: transform var(--transition);
}
.card:hover { transform: translateY(-2px); }
/* buttons */
.btn {
    background: var(--red); color: white; border: none; padding: 10px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
    transition: opacity var(--transition);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.loading { pointer-events: none; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid white; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px;
    background: rgba(255,255,255,0.7); backdrop-filter: blur(5px);
}
body.dark-mode .form-group input, body.dark-mode .form-group select { background: rgba(40,40,40,0.8); color: #eee; border-color: #555; }
/* autocomplete */
.autocomplete { position: relative; }
.autocomplete-items {
    position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #ccc; border-top: none; z-index: 10;
    max-height: 200px; overflow-y: auto; border-radius: 0 0 8px 8px;
}
.autocomplete-items div { padding: 10px; cursor: pointer; }
.autocomplete-items div:hover { background: #eee; }
body.dark-mode .autocomplete-items { background: #333; color: #ddd; }
body.dark-mode .autocomplete-items div:hover { background: #555; }
/* modal */
.modal-overlay {
    position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.modal-card {
    background: var(--card-bg); backdrop-filter: blur(12px);
    border-radius: 16px; width: 90%; max-width: 500px; padding: 20px; max-height: 80vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--dark); }
body.dark-mode .modal-close { color: #eee; }
.modal-footer { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; }
/* toast */
.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: rgba(33,33,33,0.9); color: white; padding: 10px 20px; border-radius: 8px;
    backdrop-filter: blur(4px); z-index: 3000; animation: slideUp 0.3s ease;
}
.toast.error { background: rgba(229,57,53,0.9); }
@keyframes slideUp { from { bottom: 50px; opacity:0; } }
/* map */
#map { height: 300px; border-radius: var(--border-radius); margin-bottom: 16px; }
/* table */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; }
body.dark-mode th, body.dark-mode td { border-color: #444; }
/* progress bar */
.progress-bar { background: #eee; border-radius: 10px; height: 10px; overflow: hidden; margin: 8px 0; }
.progress-fill { background: var(--red); height: 100%; width: 0%; border-radius: 10px; transition: width 0.5s; }