* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #155e95;
    --primary-light: #e8f4fd;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --text: #1e293b;
    --muted: #64748b;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --sidebar-w: 240px;
}
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); }

/* Screens */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* Login */
#login-screen { align-items: center; justify-content: center; background: linear-gradient(135deg, #155e95, #0f3460); }
.login-card { background: white; padding: 3rem; border-radius: 24px; width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { font-size: 4rem; margin-bottom: 1rem; }
.login-card h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.3rem; }
.login-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.login-card input { width: 100%; padding: 0.9rem 1rem; border: 1.5px solid var(--border); border-radius: 12px; font-size: 1rem; margin-bottom: 0.75rem; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-card button { width: 100%; padding: 1rem; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 0.5rem; }
.login-card button:hover { opacity: 0.9; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 0.75rem; font-weight: 600; }

/* Panel Layout */
#panel-screen { display: none; }
#panel-screen.active { display: flex; }
#sidebar { width: var(--sidebar-w); background: #0f172a; color: white; display: flex; flex-direction: column; height: 100vh; position: fixed; left: 0; top: 0; z-index: 100; }
.sidebar-header { padding: 1.5rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header .logo { font-size: 1.2rem; font-weight: 800; }
.sidebar-header .koop-name { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 0.3rem; }
#sidebar nav { flex: 1; padding: 1rem 0.5rem; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: rgba(255,255,255,0.7); text-decoration: none; border-radius: 10px; font-size: 0.88rem; font-weight: 600; transition: all 0.2s; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item i { width: 18px; text-align: center; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer button { width: 100%; padding: 0.6rem; background: rgba(239,68,68,0.15); color: #fca5a5; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* Content */
#content { margin-left: var(--sidebar-w); flex: 1; padding: 1.5rem; overflow-y: auto; height: 100vh; }
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h2 { font-size: 1.3rem; font-weight: 800; }
.page-header h2 i { color: var(--primary); margin-right: 0.5rem; }

/* Stats */
.header-stats { display: flex; gap: 1rem; }
.stat { background: var(--card); padding: 0.5rem 1rem; border-radius: 10px; font-size: 0.85rem; border: 1px solid var(--border); }
.stat.warning { background: #fef3c7; border-color: #fbbf24; }
.stat b { color: var(--primary); }
.stat.warning b { color: var(--danger); }

/* Map */
.map-container { height: calc(100vh - 160px); border-radius: 16px; overflow: hidden; border: 2px solid var(--border); }
#page-harita.active { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; align-items: start; }
#page-harita .page-header { grid-column: 1 / -1; }
#page-harita .map-container { height: calc(100vh - 180px); }
.vehicle-sidebar { background: white; border-radius: 14px; padding: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1); height: calc(100vh - 180px); overflow-y: auto; border: 1px solid var(--border); }
.vehicle-sidebar h3 { font-size: 0.9rem; font-weight: 800; margin-bottom: 0.75rem; color: var(--muted); }
.vehicle-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem; border-radius: 8px; margin-bottom: 0.4rem; cursor: pointer; transition: background 0.2s; }
.vehicle-item:hover { background: var(--primary-light); }
.vehicle-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.vehicle-dot.online { background: var(--success); }
.vehicle-dot.offline { background: #cbd5e1; }
.vehicle-dot.ihlal { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.vehicle-info { flex: 1; min-width: 0; }
.vehicle-info .plaka { font-weight: 700; font-size: 0.85rem; }
.vehicle-info .durum { font-size: 0.75rem; color: var(--muted); }

/* Buttons */
.btn-primary { background: var(--primary); color: white; border: none; padding: 0.6rem 1.2rem; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 0.88rem; }
.btn-primary:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.8rem; cursor: pointer; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; border-radius: 6px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.card { background: var(--card); border-radius: 14px; padding: 1.25rem; border: 1px solid var(--border); }
.card h4 { font-weight: 800; margin-bottom: 0.5rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; }
th { background: var(--bg); padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
td { padding: 0.75rem 1rem; border-top: 1px solid var(--border); font-size: 0.88rem; }
tr:hover td { background: var(--primary-light); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9999; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-content { background: white; border-radius: 20px; width: 500px; max-width: 95%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-weight: 800; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); }
#modal-body { padding: 1.5rem; }
#modal-body .form-group { margin-bottom: 1rem; }
#modal-body label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--muted); }
#modal-body input, #modal-body select { width: 100%; padding: 0.7rem 1rem; border: 1.5px solid var(--border); border-radius: 10px; font-size: 0.95rem; }
#modal-body input:focus, #modal-body select:focus { outline: none; border-color: var(--primary); }

/* Rapor Cards */
.rapor-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.rapor-card { background: white; border-radius: 14px; padding: 1.5rem; text-align: center; border: 1px solid var(--border); }
.rapor-card .value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.rapor-card .label { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

.placeholder { text-align: center; padding: 3rem; color: var(--muted); font-size: 1.1rem; }
.filters { display: flex; gap: 0.75rem; }
.filters input { padding: 0.5rem 0.75rem; border: 1.5px solid var(--border); border-radius: 8px; }

/* Responsive */
@media (max-width: 768px) {
    #sidebar { width: 60px; }
    .sidebar-header .logo { font-size: 1rem; }
    .sidebar-header .koop-name, .nav-item span { display: none; }
    #content { margin-left: 60px; }
    .vehicle-sidebar { display: none; }
}
