:root {
    color-scheme: dark;
    --font-sans: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "URW Palladio L", Georgia, serif;
    --bg: #08111d;
    --bg-soft: #0d1828;
    --panel: rgba(12, 21, 36, 0.78);
    --panel-border: rgba(148, 170, 196, 0.11);
    --text: #f3f7fd;
    --muted: #9caec6;
    --accent: #62c8f8;
    --accent-2: #38d7b2;
    --danger: #ff5f79;
    --warning: #ffb84d;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
    --font-size-label: 0.78rem;
    --font-size-body: 0.95rem;
    --font-size-table-head: 0.76rem;
    --line-height-body: 1.45;
    --control-height: 46px;
    --control-padding-x: 16px;
    --radius-control: 14px;
    --panel-padding: 20px;
    --panel-padding-tight: 16px;
    --table-row-height: 50px;
    --table-cell-padding-x: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    background:
        radial-gradient(circle at top left, rgba(98, 200, 248, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(56, 215, 178, 0.08), transparent 24%),
        linear-gradient(180deg, #09111d 0%, #060c15 100%);
    color: var(--text);
}

body.app-page:not(.page-map) {
    color-scheme: light;
    --bg: #f4f7fb;
    --bg-soft: #edf2f8;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(115, 136, 162, 0.14);
    --text: #152235;
    --muted: #667892;
    --accent: #2c8fd7;
    --accent-2: #22b79a;
    --shadow: 0 18px 48px rgba(32, 52, 79, 0.08);
    --panel-padding: 16px;
    --panel-padding-tight: 14px;
    background:
        radial-gradient(circle at top left, rgba(44, 143, 215, 0.08), transparent 24%),
        radial-gradient(circle at top right, rgba(34, 183, 154, 0.06), transparent 22%),
        linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

body.app-page:not(.page-map)::before {
    background-image: linear-gradient(rgba(17, 34, 58, 0.028) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 34, 58, 0.028) 1px, transparent 1px);
}

.app-shell {
    display: block;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 20px;
    border-right: 1px solid var(--panel-border);
    background: rgba(7, 14, 24, 0.72);
    backdrop-filter: blur(22px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    position: fixed;
    left: 20px;
    top: 20px;
    bottom: 20px;
    width: 280px;
    height: auto;
    border-radius: 28px;
    z-index: 1300;
    transform: translateX(calc(-100% - 32px));
    transition: transform 220ms ease;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 14, 0.36);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 1250;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    min-height: 60px;
    justify-content: center;
    width: 100%;
}

.brand strong,
.login-brand h1,
.panel-header h2,
.topbar h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand small,
.login-brand p,
.topbar p,
.panel-header p,
.user-card span {
    color: var(--muted);
}

.brand-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.brand-meta::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(56, 215, 178, 0.8);
    box-shadow: 0 0 0 4px rgba(56, 215, 178, 0.12);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-grid;
    place-items: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #021521;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 14px 34px rgba(98, 200, 248, 0.22);
}

.brand-logo-image {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 58px;
    object-fit: contain;
}

.nav {
    display: grid;
    gap: 10px;
    margin-top: 36px;
}

.nav a,
.ghost-button,
.primary-button,
.menu-button {
    border-radius: 14px;
    transition: 180ms ease;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: 0.88;
}

.nav-icon::before,
.nav-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.nav a[data-icon="map"] .nav-icon::before {
    inset: 2px;
    border: 1.5px solid currentColor;
    border-radius: 5px;
}

.nav a[data-icon="map"] .nav-icon::after {
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: skew(-18deg);
}

.nav a[data-icon="vehicle"] .nav-icon::before {
    left: 2px;
    top: 6px;
    width: 14px;
    height: 7px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
}

.nav a[data-icon="vehicle"] .nav-icon::after {
    left: 4px;
    top: 3px;
    width: 10px;
    height: 5px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}

.nav a[data-icon="reports"] .nav-icon::before {
    left: 3px;
    bottom: 3px;
    width: 3px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 5px -3px 0 0 currentColor, 10px -6px 0 0 currentColor;
}

.nav a[data-icon="alerts"] .nav-icon::before {
    left: 4px;
    top: 2px;
    width: 10px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 3px 3px;
}

.nav a[data-icon="alerts"] .nav-icon::after {
    left: 7px;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.nav a[data-icon="geofence"] .nav-icon::before {
    left: 4px;
    top: 2px;
    width: 10px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 999px 999px 999px 0;
    transform: rotate(-45deg);
}

.nav a[data-icon="geofence"] .nav-icon::after {
    left: 7px;
    top: 5px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.nav a[data-icon="settings"] .nav-icon::before {
    left: 4px;
    top: 4px;
    width: 10px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    box-shadow:
        0 -6px 0 -3px currentColor,
        0 6px 0 -3px currentColor,
        6px 0 0 -3px currentColor,
        -6px 0 0 -3px currentColor;
}

.nav a[data-icon="users"] .nav-icon::before {
    left: 3px;
    top: 3px;
    width: 5px;
    height: 5px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    box-shadow: 7px 2px 0 -1px currentColor;
}

.nav a[data-icon="users"] .nav-icon::after {
    left: 2px;
    bottom: 3px;
    width: 12px;
    height: 5px;
    border: 1.5px solid currentColor;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 0;
}

.nav a[data-icon="manage"] .nav-icon::before {
    left: 3px;
    top: 2px;
    width: 12px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
}

.nav a[data-icon="manage"] .nav-icon::after {
    left: 6px;
    top: 5px;
    width: 6px;
    height: 1.5px;
    background: currentColor;
    box-shadow: 0 4px 0 0 currentColor, 0 8px 0 0 currentColor;
}

.nav a:hover,
.nav a.active {
    color: var(--text);
    background: rgba(98, 200, 248, 0.065);
    border-color: rgba(98, 200, 248, 0.12);
}

.sidebar-footer {
    display: grid;
    gap: 12px;
}

.user-card,
.panel,
.stat-card,
.login-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.user-card {
    padding: var(--panel-padding-tight);
    border-radius: 18px;
    display: grid;
    gap: 4px;
}

.content {
    padding: 22px 22px 22px 96px;
    display: grid;
    gap: 22px;
    min-height: 100vh;
}

.app-page:not(.page-map) .content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 112px 28px 42px;
    gap: 14px;
}

.topbar,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar {
    padding: 0;
    min-height: 58px;
}

.app-page:not(.page-map) .topbar {
    position: fixed;
    top: 22px;
    left: 50%;
    width: min(1000px, calc(100vw - 56px));
    transform: translateX(-50%);
    z-index: 1200;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 14px;
    padding: 0;
    pointer-events: none;
}

.app-page:not(.page-map) .topbar > * {
    pointer-events: auto;
}

.app-page:not(.page-map) .topbar > div:first-of-type {
    min-height: 52px;
    padding: 14px 18px 16px;
    border-radius: 22px;
    border: 1px solid rgba(115, 136, 162, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 42px rgba(32, 52, 79, 0.1);
    backdrop-filter: blur(18px);
}

.app-page:not(.page-map) .topbar-meta {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(115, 136, 162, 0.14);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 42px rgba(32, 52, 79, 0.08);
    backdrop-filter: blur(18px);
}

.topbar p,
.panel-header p {
    margin: 6px 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.app-page:not(.page-map) .stats-grid {
    gap: 14px;
}

body[data-page="manage"] .content,
body[data-page="alerts"] .content,
body[data-page="reports"] .content {
    max-width: 960px;
}

.stat-card,
.panel,
.login-card {
    border-radius: 24px;
    padding: var(--panel-padding);
}

.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 2rem;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(148, 170, 196, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.018);
}

.app-page:not(.page-map) .table-wrap {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(115, 136, 162, 0.14);
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th, td {
    height: var(--table-row-height);
    padding: 12px var(--table-cell-padding-x);
    text-align: left;
    border-bottom: 1px solid rgba(149, 168, 194, 0.08);
    white-space: nowrap;
    vertical-align: middle;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(9, 17, 29, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: inset 0 -1px 0 rgba(148, 170, 196, 0.08);
}

.app-page:not(.page-map) thead th {
    background: rgba(248, 250, 252, 0.96);
    box-shadow: inset 0 -1px 0 rgba(115, 136, 162, 0.12);
}

th {
    color: var(--muted);
    font-size: var(--font-size-table-head);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

tbody tr {
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

tbody tr:hover {
    background: rgba(98, 200, 248, 0.04);
}

.app-page:not(.page-map) tbody tr:hover {
    background: rgba(44, 143, 215, 0.04);
}

tbody tr:hover td {
    box-shadow: inset 0 1px 0 rgba(98, 200, 248, 0.03), inset 0 -1px 0 rgba(98, 200, 248, 0.03);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.status.online {
    background: rgba(92, 63, 140, 0.14);
    color: #5b367f;
    border-color: rgba(92, 63, 140, 0.18);
}

.status.offline {
    background: rgba(255, 95, 121, 0.11);
    color: #ff9cae;
    border-color: rgba(255, 95, 121, 0.14);
}

.primary-button,
.ghost-button,
.menu-button,
.login-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #03121d;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(72, 176, 208, 0.16);
}

.ghost-button,
.menu-button {
    background: rgba(98, 200, 248, 0.045);
    color: var(--text);
    border-color: rgba(148, 170, 196, 0.11);
}

.app-page:not(.page-map) .ghost-button,
.app-page:not(.page-map) .menu-button {
    background: rgba(44, 143, 215, 0.04);
    border-color: rgba(115, 136, 162, 0.14);
}

.button-icon {
    gap: 10px;
}

.button-glyph {
    position: relative;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.button-glyph::before,
.button-glyph::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.button-icon[href$="/logout.php"] .button-glyph::before {
    left: 1px;
    top: 2px;
    width: 7px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-right: 0;
    border-radius: 3px 0 0 3px;
}

.button-icon[href$="/logout.php"] .button-glyph::after {
    right: 0;
    top: 5px;
    width: 7px;
    height: 4px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.button-icon[data-toggle-map-drawer] .button-glyph::before,
.button-icon[data-close-detail] .button-glyph::before {
    left: 1px;
    top: 6px;
    width: 12px;
    border-top: 1.5px solid currentColor;
}

.button-icon[data-toggle-map-drawer] .button-glyph::after {
    right: 1px;
    top: 3px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.button-icon[data-close-detail] .button-glyph::after {
    left: 2px;
    top: 2px;
    width: 10px;
    height: 10px;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    box-shadow: -7px 0 0 -5.5px transparent;
}

.table-action {
    min-width: 0;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.table-action .button-glyph {
    width: 13px;
    height: 13px;
}

.table-action[data-action="save"] .button-glyph::before {
    left: 1px;
    top: 1px;
    width: 11px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
}

.table-action[data-action="save"] .button-glyph::after {
    left: 4px;
    top: 3px;
    width: 5px;
    height: 3px;
    border-top: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    transform: rotate(180deg);
    box-shadow: 0 4px 0 0 currentColor;
}

.table-action[data-action="check"] .button-glyph::before {
    left: 2px;
    top: 3px;
    width: 8px;
    height: 4px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}

.table-action[data-action="check"] .button-glyph::after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.menu-button {
    width: 52px;
    height: 52px;
    margin-left: 14px;
    padding: 0;
    border-radius: 18px;
    display: inline-grid;
    grid-template-rows: repeat(3, 2px);
    align-content: center;
    gap: 6px;
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: currentColor;
}

.inline-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.app-page:not(.page-map) .sidebar {
    background: linear-gradient(145deg, rgba(224, 205, 248, 0.95) 0%, rgba(236, 225, 251, 0.94) 38%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(151, 117, 206, 0.18);
    box-shadow: 0 18px 50px rgba(92, 63, 140, 0.14);
}

.app-page:not(.page-map) .sidebar-backdrop {
    background: rgba(246, 249, 252, 0.66);
    backdrop-filter: blur(10px);
}

.page-map .sidebar {
    background: linear-gradient(145deg, rgba(224, 205, 248, 0.96) 0%, rgba(236, 225, 251, 0.95) 38%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(151, 117, 206, 0.2);
    box-shadow: 0 18px 50px rgba(92, 63, 140, 0.16);
}

.page-map .sidebar-backdrop {
    background: rgba(246, 249, 252, 0.44);
    backdrop-filter: blur(10px);
}

.page-map .brand strong,
.page-map .user-card strong,
.page-map .nav a.active,
.page-map .nav a:hover,
.page-map .menu-button {
    color: #152235;
}

.page-map .brand small,
.page-map .user-card span,
.page-map .nav a,
.page-map .inline-meta {
    color: #62758f;
}

.page-map .user-card,
.page-map .nav a:hover,
.page-map .nav a.active {
    background: linear-gradient(145deg, rgba(232, 218, 249, 0.9) 0%, rgba(245, 238, 252, 0.88) 100%);
    border-color: rgba(151, 117, 206, 0.16);
}

.app-page:not(.page-map) .panel,
.app-page:not(.page-map) .login-card,
.app-page:not(.page-map) .stat-card,
.app-page:not(.page-map) .user-card {
    background: linear-gradient(145deg, rgba(224, 205, 248, 0.92) 0%, rgba(236, 225, 251, 0.9) 36%, rgba(255, 255, 255, 0.94) 100%);
    border-color: rgba(151, 117, 206, 0.16);
    box-shadow: 0 18px 44px rgba(92, 63, 140, 0.1);
}

.app-page:not(.page-map) .panel-header h2,
.app-page:not(.page-map) .topbar h1 {
    color: #122033;
}

.app-page:not(.page-map) .stat-card strong {
    font-size: 1.7rem;
}

.app-page:not(.page-map) .nav a:hover,
.app-page:not(.page-map) .nav a.active {
    background: rgba(44, 143, 215, 0.07);
    border-color: rgba(44, 143, 215, 0.12);
}

.app-page:not(.page-map) .status::before {
    box-shadow: none;
}

.app-page:not(.page-map) .login-form {
    width: 100%;
}

.app-page:not(.page-map) .login-form label {
    width: 100%;
}

.app-page:not(.page-map) .login-form input,
.app-page:not(.page-map) .login-form select,
.app-page:not(.page-map) .login-form textarea {
    border: 1px solid rgba(115, 136, 162, 0.16);
    background: rgba(245, 248, 252, 0.98);
    color: #152235;
}

.app-page:not(.page-map) .login-form input::placeholder,
.app-page:not(.page-map) .login-form textarea::placeholder {
    color: rgba(98, 117, 143, 0.7);
}

.app-page:not(.page-map) .login-form select {
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(21, 34, 53, 0.62) 50%),
        linear-gradient(135deg, rgba(21, 34, 53, 0.62) 50%, transparent 50%);
}

body[data-page="manage"] .page-section,
body[data-page="alerts"] .page-section,
body[data-page="reports"] .page-section {
    padding: 18px;
    border-radius: 26px;
}

body[data-page="manage"] .page-section .panel-header,
body[data-page="alerts"] .page-section .panel-header,
body[data-page="reports"] .page-section .panel-header {
    margin-bottom: 14px;
}

body[data-page="manage"] .page-section .panel-header p,
body[data-page="alerts"] .page-section .panel-header p,
body[data-page="reports"] .page-section .panel-header p {
    max-width: 62ch;
}

body[data-page="manage"] .table-wrap,
body[data-page="alerts"] .table-wrap,
body[data-page="reports"] .table-wrap {
    border-radius: 22px;
}

body[data-page="alerts"] .page-section-filters .login-form,
body[data-page="reports"] .page-section-filters .login-form {
    display: grid;
    gap: 12px;
    align-items: end;
}

body[data-page="alerts"] .page-section-filters .login-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

body[data-page="reports"] .page-section-filters .login-form {
    grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)) auto;
}

body[data-page="manage"] .responsive-table td[data-label="Güncelle"],
body[data-page="alerts"] .responsive-table td[data-label="İşlem"],
body[data-page="users"] .responsive-table td[data-label="İşlem"] {
    width: 1%;
}

body[data-page="manage"] .responsive-table td[data-label="Unique ID"] {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.alert {
    border-radius: 18px;
    padding: 14px var(--panel-padding-tight);
}

.alert-danger {
    background: rgba(255, 95, 121, 0.1);
    border: 1px solid rgba(255, 95, 121, 0.16);
}

.alert-success {
    background: rgba(56, 215, 178, 0.1);
    border: 1px solid rgba(56, 215, 178, 0.16);
}

.alert-info {
    background: rgba(98, 200, 248, 0.09);
    border: 1px solid rgba(98, 200, 248, 0.15);
}

#map {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
    overflow: hidden;
}

.map-panel {
    padding: 0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.map-stage {
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
}

.map-drawer {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 88px;
    padding: var(--panel-padding);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(224, 205, 248, 0.96) 0%, rgba(236, 225, 251, 0.94) 36%, rgba(255, 255, 255, 0.95) 100%);
    color: #152235;
    border: 1px solid rgba(151, 117, 206, 0.2);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 48px rgba(92, 63, 140, 0.16);
    z-index: 1100;
    transform: translateY(calc(100% + 32px));
    transition: transform 220ms ease;
}

.map-drawer.is-open {
    transform: translateY(0);
}

.map-table {
    max-height: 240px;
    background: linear-gradient(145deg, rgba(246, 241, 252, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.map-drawer-header {
    align-items: center;
}

.map-drawer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-drawer-toggle {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1110;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(151, 117, 206, 0.18);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(228, 211, 249, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%);
    color: #152235;
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 34px rgba(92, 63, 140, 0.14);
    cursor: pointer;
}

.map-drawer-toggle strong {
    display: inline-grid;
    min-width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: rgba(140, 90, 230, 0.12);
    font-size: 0.9rem;
}

.detail-panel {
    position: fixed;
    top: 76px;
    right: 20px;
    width: min(360px, calc(100% - 40px));
    max-height: calc(100% - 96px);
    overflow: auto;
    padding: var(--panel-padding);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(224, 205, 248, 0.97) 0%, rgba(236, 225, 251, 0.95) 36%, rgba(255, 255, 255, 0.96) 100%);
    color: #152235;
    border: 1px solid rgba(151, 117, 206, 0.2);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 48px rgba(92, 63, 140, 0.16);
    z-index: 1120;
    transform: translateX(calc(100% + 24px));
    transition: transform 220ms ease;
}

.detail-panel.is-open {
    transform: translateX(0);
}

.detail-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-kicker {
    margin: 0 0 6px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.detail-panel h2 {
    margin: 0;
    font-size: 1.35rem;
}

.detail-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.detail-actions,
.report-actions,
.report-form,
.report-summary {
    display: flex;
    gap: 10px;
}

.detail-actions {
    margin-bottom: 14px;
}

.report-modal[hidden] {
    display: none;
}

.report-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
}

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 28, 46, 0.22);
    backdrop-filter: blur(8px);
}

.report-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    transform: translate(-50%, -50%);
    padding: var(--panel-padding);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(224, 205, 248, 0.97) 0%, rgba(236, 225, 251, 0.95) 34%, rgba(255, 255, 255, 0.96) 100%);
    color: #152235;
    border: 1px solid rgba(151, 117, 206, 0.2);
    box-shadow: 0 24px 64px rgba(92, 63, 140, 0.18);
}

.user-edit-dialog {
    width: min(620px, calc(100vw - 32px));
}

.user-edit-form {
    width: 100%;
}

.user-edit-meta {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(151, 117, 206, 0.14);
    background: linear-gradient(145deg, rgba(242, 235, 251, 0.9) 0%, rgba(255, 255, 255, 0.88) 100%);
}

.report-form {
    align-items: end;
    margin-bottom: 16px;
}

.report-form label {
    display: grid;
    gap: 8px;
    width: min(100%, 240px);
}

.report-form input {
    width: 100%;
    min-height: var(--control-height);
    border-radius: var(--radius-control);
    border: 1px solid rgba(115, 136, 162, 0.16);
    background: rgba(244, 247, 251, 0.98);
    color: #152235;
    padding: 0 var(--control-padding-x);
    font: inherit;
}

.report-form input::placeholder {
    color: rgba(98, 117, 143, 0.7);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.compact-stat {
    padding: 14px 16px;
}

.compact-stat strong {
    font-size: 1.15rem;
}

.report-actions {
    justify-content: flex-end;
    margin-bottom: 14px;
}

.report-table-wrap {
    max-height: 42vh;
}

.detail-grid {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-grid div {
    padding: 12px var(--panel-padding-tight);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(242, 235, 251, 0.92) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 1px solid rgba(151, 117, 206, 0.12);
}

.detail-grid dt {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.8rem;
}

.detail-grid dd {
    margin: 0;
    word-break: break-word;
}

#mapVehicleRows tr {
    cursor: pointer;
    transition: background 160ms ease;
}

#mapVehicleRows tr:hover,
#mapVehicleRows tr.is-selected {
    background: rgba(140, 90, 230, 0.09);
}

#mapVehicleRows tr.is-selected td {
    box-shadow: inset 0 1px 0 rgba(140, 90, 230, 0.12), inset 0 -1px 0 rgba(140, 90, 230, 0.12);
}

.page-map .content {
    position: fixed;
    inset: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
    z-index: 1;
}

.page-map .content > .alert {
    display: none;
}

.page-map .topbar {
    position: fixed;
    top: 22px;
    left: 22px;
    right: 22px;
    z-index: 1200;
    pointer-events: none;
}

.page-map .topbar > * {
    pointer-events: auto;
}

.page-map .topbar h1,
.page-map .topbar p {
    display: none;
}

.page-map .menu-button {
    color: #152235 !important;
    background: rgba(44, 143, 215, 0.04) !important;
    border-color: rgba(115, 136, 162, 0.14) !important;
}

.page-map .menu-button span {
    background: #152235 !important;
}

.page-map .topbar-meta {
    display: none;
}

.page-map .ghost-button {
    background: rgba(44, 143, 215, 0.04);
    color: #152235;
    border-color: rgba(115, 136, 162, 0.14);
}

.page-map .inline-meta,
.page-map .detail-kicker,
.page-map .detail-grid dt,
.page-map .panel-header p {
    color: #62758f;
}

.page-map thead th {
    background: rgba(248, 250, 252, 0.96);
    box-shadow: inset 0 -1px 0 rgba(115, 136, 162, 0.12);
}

.page-map .map-drawer thead th,
.page-map .report-dialog thead th {
    color: #5b367f;
}

.page-map .map-panel {
    margin: 0;
}

.login-page {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    color-scheme: light;
    background:
        radial-gradient(circle at top left, rgba(44, 143, 215, 0.08), transparent 26%),
        radial-gradient(circle at top right, rgba(34, 183, 154, 0.06), transparent 22%),
        linear-gradient(180deg, #f8fbfd 0%, #eef3f8 100%);
    color: #152235;
    position: relative;
    overflow: hidden;
}

.login-shell {
    width: min(100%, 480px);
    position: relative;
    z-index: 2;
    margin: auto;
}

.login-page.has-login-background {
    background:
        linear-gradient(180deg, rgba(8, 16, 29, 0.12) 0%, rgba(8, 16, 29, 0.22) 100%),
        var(--login-background-image) center / cover no-repeat;
}

.login-page.has-login-background::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 0;
}

.login-card {
    display: grid;
    gap: 22px;
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(151, 117, 206, 0.24);
    background:
        linear-gradient(145deg, rgba(224, 205, 248, 0.98) 0%, rgba(236, 225, 251, 0.96) 36%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 24px 60px rgba(92, 63, 140, 0.16);
    backdrop-filter: blur(20px);
}

.login-brand {
    justify-content: center;
    text-align: center;
    width: 100%;
}

.login-brand .brand-logo-image {
    margin: 0 auto;
    max-height: 72px;
}

.login-brand > div {
    display: grid;
    gap: 6px;
}

.login-form {
    display: grid;
    gap: 16px;
    width: min(100%, 720px);
}

.login-form label {
    display: grid;
    gap: 8px;
    width: min(100%, 560px);
}

.login-form span {
    color: var(--muted);
    font-size: var(--font-size-label);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-page .login-form span {
    color: #7a4fc2;
}

.form-help {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.login-form input,
.login-form select,
.login-form textarea {
    width: 100%;
    min-height: var(--control-height);
    border-radius: var(--radius-control);
    border: 1px solid rgba(115, 136, 162, 0.16);
    background: rgba(245, 248, 252, 0.98);
    color: #152235;
    padding: 0 var(--control-padding-x);
    font: inherit;
}

.login-form input::placeholder,
.login-form textarea::placeholder {
    color: rgba(98, 117, 143, 0.7);
}

.login-form textarea {
    min-height: 120px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.login-form select {
    appearance: none;
    text-align: left;
    justify-content: flex-start;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(21, 34, 53, 0.62) 50%),
        linear-gradient(135deg, rgba(21, 34, 53, 0.62) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.login-form button {
    width: fit-content;
    min-width: 180px;
}

.login-page .full-width {
    width: 100%;
}

.login-page .primary-button {
    background: linear-gradient(135deg, #8c5ae6 0%, #b389f4 100%);
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(121, 78, 194, 0.22);
}

.page-map #openReportModal {
    background: linear-gradient(135deg, #8c5ae6 0%, #b389f4 100%);
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(121, 78, 194, 0.22);
}

.login-page .alert {
    background: rgba(255, 95, 121, 0.08);
    border: 1px solid rgba(255, 95, 121, 0.14);
    color: #8d3347;
}

.inline-edit-form {
    display: inline-flex;
    align-items: center;
}

.inline-edit-form .primary-button,
.inline-edit-form .ghost-button {
    min-width: 0;
}

.table-primary {
    font-weight: 700;
    color: var(--text);
}

.table-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(44, 143, 215, 0.12);
    background: rgba(44, 143, 215, 0.08);
    color: #17507f;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-badge.muted {
    border-color: rgba(115, 136, 162, 0.14);
    background: rgba(115, 136, 162, 0.08);
    color: #556983;
}

.branding-preview {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(115, 136, 162, 0.14);
    background: rgba(248, 250, 252, 0.82);
    width: min(100%, 360px);
}

.branding-preview span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.branding-preview img {
    display: block;
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.branding-preview-favicon img {
    width: 40px;
    height: 40px;
    max-height: 40px;
}

.branding-preview-background img {
    width: 100%;
    max-height: 140px;
    border-radius: 14px;
    object-fit: cover;
}

body[data-page="reports"] .responsive-table td[data-label="Zaman"] {
    min-width: 188px;
}

body[data-page="manage"] .table-action,
body[data-page="alerts"] .table-action,
body[data-page="users"] .table-action {
    box-shadow: none;
}

.responsive-table input[form] {
    width: 100%;
    min-height: var(--control-height);
    border-radius: var(--radius-control);
    border: 1px solid rgba(115, 136, 162, 0.16);
    background: rgba(244, 247, 251, 0.98);
    color: #152235;
    padding: 0 var(--control-padding-x);
    font: inherit;
}

.panel-header h2,
.topbar h1 {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.panel-header p,
.topbar p {
    font-size: 0.9rem;
}

.stat-card strong,
.detail-panel h2,
.login-brand h1 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
}

.ghost-button:hover,
.primary-button:hover,
.menu-button:hover {
    transform: translateY(-1px);
    border-color: rgba(148, 170, 196, 0.16);
}

.panel form.login-form + .table-wrap,
.panel .table-wrap + form.login-form {
    margin-top: 18px;
}

.full-width {
    width: 100%;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #0a1525;
    color: var(--text);
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .sidebar {
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        border-radius: 0 28px 28px 0;
    }

    .content {
        padding: 18px;
    }

    .app-page:not(.page-map) .content {
        padding: 98px 16px 28px;
    }

    .topbar,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-map .topbar {
        top: 18px;
        left: 18px;
        right: 18px;
    }

    .app-page:not(.page-map) .topbar {
        top: 18px;
        left: 50%;
        width: calc(100vw - 36px);
        transform: translateX(-50%);
        grid-template-columns: auto minmax(0, 1fr);
    }

    .app-page:not(.page-map) .topbar > div:first-of-type {
        max-width: none;
    }

    .app-page:not(.page-map) .topbar-meta {
        display: none;
    }

    body[data-page="alerts"] .page-section-filters .login-form,
    body[data-page="reports"] .page-section-filters .login-form {
        grid-template-columns: 1fr;
    }

    #map,
    .map-stage {
        min-height: 100vh;
        height: 100vh;
    }

    .map-drawer {
        left: 12px;
        right: 12px;
        bottom: 78px;
        padding: var(--panel-padding-tight);
    }

    .map-drawer-toggle {
        left: 12px;
        bottom: 12px;
    }

    .detail-panel {
        top: 74px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100% - 148px);
    }

    .report-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: var(--panel-padding-tight);
    }

    .report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 16px;
    }

    .app-page:not(.page-map) .content {
        padding: 92px 14px 24px;
        gap: 14px;
    }

    th, td {
        height: 46px;
        padding: 10px;
    }

    .page-map .topbar {
        top: 16px;
        left: 16px;
        right: 16px;
    }

    .app-page:not(.page-map) .topbar {
        top: 16px;
        left: 50%;
        width: calc(100vw - 32px);
        transform: translateX(-50%);
        gap: 12px;
    }

    .app-page:not(.page-map) .topbar > div:first-of-type {
        padding: 12px 14px 14px;
    }

    .map-drawer {
        max-height: 42vh;
    }

    .map-table {
        max-height: 24vh;
    }

    .map-drawer-header,
    .detail-panel-header,
    .detail-status-row,
    .map-drawer-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-panel {
        top: auto;
        bottom: 76px;
        max-height: 40vh;
    }

    .detail-actions,
    .report-actions,
    .report-form {
        flex-direction: column;
    }

    .report-form label {
        width: 100%;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        padding: 12px;
        border-bottom: 1px solid rgba(148, 170, 196, 0.08);
    }

    .responsive-table tr:last-child {
        border-bottom: 0;
    }

    .responsive-table td {
        height: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        white-space: normal;
        box-shadow: none;
    }

    .responsive-table td + td {
        margin-top: 10px;
    }

    .responsive-table td[data-label] {
        display: grid;
        gap: 4px;
    }

    .responsive-table td[data-label]::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .responsive-table tbody tr:hover,
    .responsive-table tbody tr:hover td,
    #mapVehicleRows tr.is-selected td {
        background: transparent;
        box-shadow: none;
    }

    .responsive-table tbody tr {
        background: rgba(255, 255, 255, 0.02);
        border-radius: 16px;
        box-shadow: inset 0 0 0 1px rgba(148, 170, 196, 0.08);
    }

    .responsive-table tbody tr + tr {
        margin-top: 12px;
    }

    .table-wrap {
        border-radius: 20px;
    }

    .responsive-table td[data-label="İşlem"] form,
    .responsive-table td[data-label="Yeni Atama"] form {
        align-items: stretch !important;
        flex-direction: column;
    }
}
