* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
    color: #fff;
}
.topbar h1 { margin: 0; font-size: 28px; }
.subtitle { margin-top: 4px; opacity: 0.9; }
.actions { display: flex; gap: 10px; align-items: center; }
.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    cursor: pointer;
}
.btn.primary { background: #22c55e; color: #fff; border-color: #22c55e; }
.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    padding: 20px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.sidebar {
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}
.content {
    min-height: 0;
    height: 100%;
}
.card, .table-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 16px;
}
#map {
    width: 100%;
    height: 100%;
    min-height: 640px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 0;
}
.leaflet-control-layers {
    border: 0 !important;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}
.table-title { font-weight: bold; margin-bottom: 10px; font-size: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px;
    text-align: left;
    font-size: 14px;
}
th { background: #f8fafc; }
.muted { color: #64748b; font-size: 13px; }
.report-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
}
@media (max-width: 900px) {
    body { display: block; overflow: auto; }
    .layout { grid-template-columns: 1fr; height: auto; overflow: visible; }
    .sidebar { overflow: visible; }
    .content { height: auto; }
    #map { height: 65vh; min-height: 420px; }
    .topbar { flex-direction: column; align-items: flex-start; }
}

.full-table { margin: 18px; overflow-x: auto; }
.filter-row { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.filter-row input, .filter-row select { padding: 10px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; background: rgba(255,255,255,.08); color: inherit; min-width: 240px; }
.filter-row option { color: #111; }

.toolbar-card { margin: 18px; padding: 16px; border-radius: 18px; background: rgba(255,255,255,0.92); box-shadow: 0 12px 32px rgba(15,23,42,0.12); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar-card input[type="date"] { padding: 9px 12px; border: 1px solid #d5dce8; border-radius: 10px; }
.wide-table { margin: 18px; overflow-x: auto; }
.primary { font-weight: 700; }


.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px;
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: #334155;
}
.form-grid input, .form-grid select, .form-grid textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: #0f172a;
}
.span-2 { grid-column: span 2; }
.form-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.notice { margin: 0 18px; padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.notice.success { background: #dcfce7; color: #166534; }
.notice.error { background: #fee2e2; color: #991b1b; }
.inline-form { display: inline; }
.mini-btn {
    display: inline-block;
    margin: 2px;
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    cursor: pointer;
    font-size: 12px;
}
.mini-btn.danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.nowrap { white-space: nowrap; }
.filter-row.light input { background: #fff; color: #0f172a; border-color: #cbd5e1; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } }


.full-content {
    width: calc(100% - 40px);
    margin: 20px;
}

.toolbar-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0;
}

.is-sirasi-table tbody tr {
    cursor: move;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.is-sirasi-table tbody tr.dragging {
    opacity: 0.55;
}

.drag-cell {
    white-space: nowrap;
}

.drag-handle {
    font-weight: bold;
    margin-right: 6px;
    color: #374151;
}

.durum-normal,
.durum-yesil {
    background: #ecfdf5;
}

.durum-birinci,
.durum-sari {
    background: #fffbeb;
}

.durum-ikinci,
.durum-kirmizi {
    background: #fef2f2;
}

.status-pill {
    display: inline-block;
    min-width: 70px;
    text-align: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}

.status-normal,
.status-yesil {
    background: #16a34a;
    color: #fff;
}

.status-birinci,
.status-sari {
    background: #f59e0b;
    color: #111827;
}

.status-ikinci,
.status-kirmizi {
    background: #dc2626;
    color: #fff;
}

.mini-btn {
    border: 0;
    border-radius: 8px;
    padding: 7px 10px;
    font-weight: 700;
    cursor: pointer;
}

.mini-btn.success {
    background: #15803d;
    color: #fff;
}

.mini-btn.warning {
    background: #f59e0b;
    color: #111827;
}

/* Modal liste düzeni */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(15, 23, 42, 0.62);
    align-items: center;
    justify-content: center;
    padding: 22px;
}
.modal-backdrop.show { display: flex; }
.modal-panel {
    width: min(1100px, 96vw);
    max-height: 88vh;
    background: rgba(255,255,255,0.98);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
}
.large-modal { width: min(1250px, 97vw); }
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, rgba(248,250,252,0.98), rgba(239,246,255,0.98));
}
.modal-close {
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 28px;
    line-height: 34px;
    color: #334155;
    background: #e2e8f0;
}
.modal-close:hover { background: #cbd5e1; }
.modal-table {
    max-height: calc(88vh - 98px);
    overflow: auto;
    padding: 0;
}
.modal-table table { margin: 0; }
.modal-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.import-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    margin-bottom: 14px;
}


.plate-marker {
    background: transparent;
    border: 0;
}

.plate-badge {
    display: inline-block;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #1d4ed8;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

@media (max-width: 900px) {
    .plate-badge { font-size: 11px; padding: 3px 6px; }
}


.modal-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}
.modal-search-row input {
    flex: 1 1 280px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
}
.modal-search-status { font-weight: 700; color: #475569; }


.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top left, #dbeafe 0, #f8fafc 42%, #e2e8f0 100%);
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 28px;
    border-radius: 22px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.login-brand {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.login-subtitle {
    color: #475569;
    margin-bottom: 18px;
}

.login-card label {
    display: block;
    font-weight: 700;
    margin: 12px 0 6px;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
}

.login-button {
    width: 100%;
    margin-top: 18px;
    border: 0;
    font-weight: 800;
}

.login-notice {
    margin: 0 0 12px 0;
}

.login-help {
    margin-top: 14px;
    line-height: 1.45;
}
