:root {
    /* Belediye markası: mavi + turuncu vurgular */
    --brand-blue: #0077b6;
    --brand-blue-dark: #005f91;
    --brand-orange: #ff6600;
    --primary: #0077b6;
    --primary-hover: #005f91;
    --primary-light: #e0f2fe;
    --primary-dark: #0c4a6e;
    --primary-glow: rgba(0, 119, 182, 0.35);
    --secondary: #0f172a;
    --accent: #ea580c;
    --accent-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --bg-app: #f1f5f9;
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --ring-focus: 0 0 0 3px rgba(0, 119, 182, 0.25);
    --header-height: 60px;
    --sidebar-width: 400px;
    --camera-list-panel-max: min(52vh, 420px);
    --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    background-image:
        radial-gradient(ellipse 120% 80% at 100% -20%, rgba(0, 119, 182, 0.07), transparent 50%),
        radial-gradient(ellipse 80% 60% at 0% 100%, rgba(234, 88, 12, 0.04), transparent 45%);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    letter-spacing: -0.01em;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 3vw, 1.75rem);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.app-header-enhanced {
    background: linear-gradient(135deg, #0a1628 0%, #0c4a6e 38%, #075985 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 30px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.logo-mark-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
    display: block;
    background: #fff;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.municipality-logo {
    height: 40px;
    width: 40px;
    border-radius: 8px;
}

.titles h1 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.titles h2 {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    margin: 0.15rem 0 0 0;
    letter-spacing: 0.02em;
}

.nav-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-pills {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-pills .nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-md);
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nav-pills .nav-link:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-pills .nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-session {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.app-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.app-content:has(.panel-page) {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

/* Map Area */
.map-wrap {
    flex: 1;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
}

#map {
    height: 100%;
    width: 100%;
    background: #cbd5e1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
    z-index: 900;
}

.sidebar-section {
    padding: 1.35rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-section h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3::before {
    content: '';
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, #818cf8 100%);
    flex-shrink: 0;
}

.sidebar-section--stats {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, var(--bg-surface) 100%);
}

.sidebar-section--form {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.form-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--primary-light);
    border: 1px solid rgba(79, 70, 229, 0.15);
    transition: background 0.2s, border-color 0.2s;
}

.form-advanced-toggle:hover {
    background: #e0e7ff;
    border-color: rgba(79, 70, 229, 0.25);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.85rem;
    line-height: 1.45;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(241, 245, 249, 0.9);
    border-left: 3px solid var(--border-strong);
}

.location-block {
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.location-block__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.location-block__coords {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    margin: 0.25rem 0 0;
    padding: 0;
    line-height: 1.4;
    word-break: break-all;
}

.location-block__hint {
    margin-top: 0.5rem;
    margin-bottom: 0;
    border-left-color: rgba(37, 99, 235, 0.45);
}

.map-locate-control {
    border: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.map-locate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    line-height: 1;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: #fff;
    color: #1e40af;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.map-locate-btn:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.map-locate-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring-focus);
}

.form-actions-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.1rem;
}

.form-actions-bar .btn-primary {
    flex: 2;
}

.form-actions-bar .btn-ghost {
    flex: 1;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-main);
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    box-shadow: var(--shadow-xs);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring-focus);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(180deg, #0ea5e9 0%, var(--primary) 45%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow-sm), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
    border-radius: var(--radius-md);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #38bdf8 0%, var(--primary-hover) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: #fff;
    border-color: var(--border);
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
    background: var(--bg-surface);
    border-color: var(--border-strong);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Kamera listesi — açılır panel + iç kaydırma */
.sidebar-section--camera-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 0;
}

.camera-list-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    min-height: 48px;
    background: var(--bg-card);
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s, color 0.15s;
}

.camera-list-toggle:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.camera-list-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    z-index: 1;
    position: relative;
}

.camera-list-count {
    font-weight: 500;
    opacity: 0.75;
    text-transform: none;
    letter-spacing: normal;
}

.camera-list-chevron {
    flex-shrink: 0;
    font-size: 0.7rem;
    line-height: 1;
    color: var(--primary);
    transition: transform 0.25s ease;
}

.camera-list-section.is-collapsed .camera-list-chevron {
    transform: rotate(-90deg);
}

.camera-list-panel {
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid var(--border);
}

.camera-list-section:not(.is-collapsed) .camera-list-panel {
    max-height: var(--camera-list-panel-max);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.camera-list-section.is-collapsed .camera-list-panel {
    max-height: 0;
    border-bottom-color: transparent;
}

.camera-list-panel .camera-list {
    padding: 0.75rem 1rem 1rem;
}

/* Camera List Cards */
.camera-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.camera-card {
    padding: 0.95rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: var(--shadow-xs);
}

.camera-card:hover {
    border-color: rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.camera-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2), var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    flex: 1;
    min-width: 0;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-live-pill {
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-live-pill:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    transform: scale(1.05);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.status-online { background: var(--accent-soft); color: #047857; border: 1px solid #a7f3d0; }
.status-offline { background: var(--danger-soft); color: #b91c1c; border: 1px solid #fecaca; }

.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
}

.toast {
    padding: 1rem 1.35rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9rem;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--danger);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

.modal-overlay.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border);
}

.live-stream-modal {
    z-index: 3100;
}

.modal-content--live {
    max-width: min(960px, 96vw);
    padding: 0;
    overflow: hidden;
    background: #0f172a;
}

.live-stream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.live-stream-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
}

.live-stream-close {
    border: none;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.live-stream-close:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

.live-stream-body {
    padding: 0.75rem;
    min-height: 180px;
    max-height: min(72vh, 640px);
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}

.live-stream-video,
.live-stream-mjpeg {
    width: 100%;
    max-height: min(68vh, 600px);
    border-radius: 12px;
    background: #000;
    object-fit: contain;
}

.live-stream-placeholder {
    color: #e2e8f0;
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 40rem;
}

.live-stream-placeholder p {
    margin: 0 0 0.75rem;
}

.live-stream-placeholder p:last-child {
    margin-bottom: 0;
}

.live-stream-placeholder code {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.75rem;
    text-align: left;
    word-break: break-all;
}

.live-hint {
    font-size: 0.82rem !important;
    opacity: 0.88;
}

/* QR Scanner Box */
#qr-reader {
    width: 100% !important;
    border: none !important;
    border-radius: 12px;
    overflow: hidden;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 0;
}

.stat-item {
    text-align: center;
    padding: 0.85rem 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.stat-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: rgba(79, 70, 229, 0.2);
}

.stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--secondary);
}

.stat-value--online {
    color: var(--accent) !important;
}

.stat-value--offline {
    color: var(--danger) !important;
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.35rem;
}

/* Map Markers Custom Styles */
.cam-marker-wrap svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.2s;
}

.cam-marker-wrap:not(.cam-marker-selected):hover svg {
    transform: scale(1.1);
}

.cam-marker-wrap.cam-marker-selected svg {
    filter: drop-shadow(0 4px 18px rgba(99, 102, 241, 0.55)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.cam-marker-wrap.cam-marker-selected:hover svg {
    transform: scale(1.04);
}

/* Auth: header */
.nav-links-end {
    flex: 1;
    justify-content: flex-end;
}

.nav-user {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-logout-form {
    display: inline;
    margin: 0;
}

.nav-link-btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.nav-link-btn:hover {
    background: rgba(248, 113, 113, 0.25);
    color: #fff;
}

/* Login page — tam ekran, iki sütun (masaüstü) */
.login-body {
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100dvh;
    min-height: 100vh;
    font-family: var(--font-sans);
    background: #0c1222;
    color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.login-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
}

.login-blob--1 {
    width: min(55vw, 480px);
    height: min(55vw, 480px);
    background: #0077b6;
    top: -12%;
    right: -8%;
}

.login-blob--2 {
    width: min(45vw, 380px);
    height: min(45vw, 380px);
    background: #0d9488;
    bottom: -10%;
    left: -5%;
    opacity: 0.35;
}

.login-blob--3 {
    width: 280px;
    height: 280px;
    background: #7c3aed;
    top: 42%;
    left: 35%;
    opacity: 0.2;
    filter: blur(100px);
}

.login-layout {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100dvh;
    min-height: 100vh;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    .login-layout {
        grid-template-columns: 1fr minmax(420px, 480px);
    }
}

/* Sol panel — marka */
.login-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.5rem, 4vw, 3rem);
    position: relative;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 27, 75, 0.88) 50%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 960px) {
    .login-hero {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        min-height: 100vh;
    }
}

.login-hero-inner {
    max-width: 28rem;
}

.login-hero-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a5b4fc;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(165, 180, 252, 0.25);
    margin-bottom: 1.25rem;
}

.login-hero-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.75rem 0;
    color: #fff;
}

.login-hero-lead {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #94a3b8;
    margin: 0 0 1.5rem 0;
}

.login-hero-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.login-hero-list li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.65rem;
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.login-hero-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #34d399);
}

.login-hero-art {
    display: none;
    margin-top: 2rem;
    position: relative;
    height: 140px;
}

@media (min-width: 960px) {
    .login-hero-art {
        display: block;
    }
}

.login-hero-rings {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 200px;
    height: 200px;
}

.login-hero-rings span {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    inset: 0;
    animation: login-ring 8s ease-in-out infinite;
}

.login-hero-rings span:nth-child(2) {
    inset: 18px;
    animation-delay: -2s;
    opacity: 0.7;
}

.login-hero-rings span:nth-child(3) {
    inset: 36px;
    animation-delay: -4s;
    opacity: 0.45;
}

@keyframes login-ring {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.03); opacity: 0.85; }
}

.login-hero-dots {
    position: absolute;
    right: 2rem;
    bottom: 2.5rem;
    display: flex;
    gap: 0.5rem;
}

.login-hero-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
}

.login-hero-dots span:nth-child(2) { background: rgba(129, 140, 248, 0.8); }
.login-hero-dots span:nth-child(3) { background: rgba(52, 211, 153, 0.7); }
.login-hero-dots span:nth-child(4) { background: rgba(255, 255, 255, 0.15); }

/* Sağ — form */
.login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--radius-xl);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 24px 48px -12px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(15, 23, 42, 0.06);
}

.login-card-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}

.login-card-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(145deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.login-card-mark--brand {
    padding: 4px;
    background: #fff;
    font-size: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.login-card-mark--brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.login-hero-logo {
    display: block;
    width: 96px;
    height: auto;
    margin: 0 0 1rem 0;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.28));
}

.login-card-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--secondary);
}

.login-card-sub {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-field {
    margin-bottom: 1.15rem;
}

.login-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap::before {
    content: '';
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
}

.login-input-wrap--user::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.login-input-wrap--lock::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.login-input {
    width: 100%;
    padding: 0.75rem 0.85rem 0.75rem 2.85rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input:hover {
    background: #fff;
    border-color: var(--border-strong);
}

.login-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: var(--ring-focus);
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-submit-arrow {
    flex-shrink: 0;
    opacity: 0.95;
}

.login-footnote {
    margin-top: 1.5rem;
    max-width: 400px;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    padding: 0 0.5rem;
}

.login-validation {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    background: var(--danger-soft);
    border: 1px solid #fecaca;
}

.login-validation ul {
    margin: 0;
    padding-left: 1.1rem;
}

.text-danger {
    color: var(--danger);
    font-size: 0.75rem;
    display: block;
    margin-top: 0.35rem;
}

/* Login — mobil: bottom sheet kartı, güvenli alan, tek sütun akış */
@media (max-width: 959px) {
    .login-body {
        background: #0b1120;
    }

    .login-decor .login-blob--3 {
        opacity: 0.14;
        top: 8%;
        left: 50%;
        transform: translateX(-50%);
    }

    .login-layout {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        min-height: 100vh;
        background: linear-gradient(165deg, #0c4a6e 0%, #0f172a 40%, #0b1120 100%);
    }

    .login-hero {
        flex: 0 0 auto;
        border-bottom: none;
        background: transparent;
        padding:
            max(1rem, env(safe-area-inset-top, 0px))
            1.25rem
            1rem;
        text-align: center;
        align-items: center;
        justify-content: flex-start;
    }

    .login-hero-inner {
        max-width: 22rem;
        margin: 0 auto;
    }

    .login-hero-logo {
        width: 80px;
        margin-left: auto;
        margin-right: auto;
    }

    .login-hero-badge {
        margin-bottom: 0.65rem;
        font-size: 0.62rem;
        padding: 0.3rem 0.65rem;
    }

    .login-hero-title {
        font-size: 1.35rem;
        margin-bottom: 0.4rem;
    }

    .login-hero-lead {
        font-size: 0.8125rem;
        margin-bottom: 0;
        line-height: 1.45;
        color: #a8b4c8;
    }

    .login-hero-list {
        display: none;
    }

    .login-main {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0.35rem 0 0;
        background: transparent;
        min-height: 0;
    }

    .login-card {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 22px 22px 0 0;
        padding:
            1.65rem 1.35rem 1.5rem;
        padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
        box-shadow:
            0 -8px 32px rgba(15, 23, 42, 0.35),
            0 0 0 1px rgba(15, 23, 42, 0.06);
        background: #fafbfc;
    }

    .login-card-head {
        margin-bottom: 1.35rem;
        align-items: center;
    }

    .login-card-mark {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        font-size: 1.05rem;
    }

    .login-card-mark--brand img {
        width: 36px;
        height: 36px;
    }

    .login-card-title {
        font-size: 1.2rem;
    }

    .login-card-sub {
        font-size: 0.8125rem;
    }

    /* iOS: 16px altında zoom tetiklenmesin */
    .login-input {
        font-size: 16px;
        padding: 0.8rem 0.9rem 0.8rem 2.9rem;
        min-height: 48px;
        box-sizing: border-box;
    }

    .login-submit {
        min-height: 48px;
        margin-top: 0.65rem;
        padding: 0.9rem 1.25rem;
        font-size: 1rem;
        border-radius: var(--radius-md);
        -webkit-tap-highlight-color: transparent;
    }

    .login-footnote {
        margin-top: 0;
        margin-bottom: 0;
        padding:
            0.85rem 1.35rem max(0.75rem, env(safe-area-inset-bottom, 0px));
        max-width: none;
        font-size: 0.7rem;
        color: #94a3b8;
        background: rgba(15, 23, 42, 0.35);
        line-height: 1.45;
    }

    .login-validation {
        font-size: 0.8125rem;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .login-hero-title {
        font-size: 1.2rem;
    }
}

/* Panel (users) */
.panel-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 1.5rem;
}

.panel-page-narrow {
    max-width: 520px;
}

.panel-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.02em;
}

.panel-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    max-width: 36rem;
    line-height: 1.5;
}

.panel-breadcrumb {
    margin-bottom: 1rem;
}

.panel-breadcrumb a {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.panel-breadcrumb a:hover {
    text-decoration: underline;
}

.panel-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.panel-card-pad {
    padding: 1.75rem;
}

.stack-form .form-group {
    margin-bottom: 1.1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.checkbox-row {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.checkbox-label input {
    width: auto;
    accent-color: var(--primary);
}

.input-readonly {
    background: #f1f5f9 !important;
    color: var(--text-muted);
    cursor: default;
}

.btn-glow {
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-glow:hover {
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.45);
}

.btn-icon {
    margin-right: 0.35rem;
    font-weight: 700;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.empty-hint {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.cell-actions {
    white-space: nowrap;
    text-align: right;
}

.inline-form {
    display: inline;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-admin {
    background: #eef2ff;
    color: #4338ca;
}

.badge-user {
    background: #f1f5f9;
    color: #475569;
}

/* Mobil: harita üstte, panel altta; dokunma ve taşma */
@media (max-width: 768px) {
    :root {
        --camera-list-panel-max: min(38vh, 300px);
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100dvh;
    }

    .main-wrapper {
        min-height: 100dvh;
        height: auto;
    }

    /* Üst bar: sabit 60px + sarılma kullanıcı/çıkış satırını kesiyordu; harita üstüne biniyordu */
    .app-header {
        height: auto;
        min-height: var(--header-height);
        align-items: flex-start;
        z-index: 2000;
        position: relative;
        padding-bottom: 0.5rem;
    }

    .app-header-enhanced {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-top: max(0.35rem, env(safe-area-inset-top));
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 0.5rem;
        column-gap: 0.75rem;
    }

    .logo {
        flex: 1 1 auto;
        min-width: 0;
        align-items: center;
    }

    .logo .titles h1 {
        font-size: 0.9rem;
    }

    .logo .titles h2 {
        font-size: 0.7rem;
    }

    .nav-toolbar {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .nav-pills {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-session {
        border-left: none;
        padding-left: 0;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .nav-user {
        max-width: min(100%, 12rem);
        flex-shrink: 1;
    }

    .nav-pills .nav-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.78rem;
    }

    .app-content {
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: visible;
    }

    .map-wrap {
        flex: none;
        width: 100%;
        height: min(44vh, 380px);
        min-height: 240px;
        order: 1;
    }

    #map {
        min-height: 240px;
    }

    .sidebar {
        width: 100%;
        max-width: none;
        border-right: none;
        border-top: 1px solid var(--border);
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        order: 2;
    }

    .sidebar-section {
        padding: 1rem;
    }

    .camera-list-toggle {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    :root {
        --camera-list-panel-max: min(35vh, 260px);
    }

    .map-wrap {
        height: min(40vh, 320px);
        min-height: 220px;
    }

    #map {
        min-height: 220px;
    }
}
