:root {
    --bg: #f7f5ef;
    --surface: #ffffff;
    --surface-2: #f1eee6;
    --surface-3: #fbfaf7;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, .10);
    --dark: #0f172a;
    --dark-2: #1e293b;
    --accent: #2563eb;
    --accent-2: #0f766e;
    --warm: #d97706;
    --danger: #b42318;
    --success: #047857;
    --shadow: 0 20px 50px rgba(15, 23, 42, .10);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, .07);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --container: 1180px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 32vw),
        radial-gradient(circle at bottom right, rgba(15,118,110,.08), transparent 30vw),
        var(--bg);
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.primary-action,
.secondary-action,
.danger-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 850;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.primary-action {
    color: #fff;
    background: var(--dark);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}

.secondary-action {
    color: var(--text);
    background: rgba(255,255,255,.86);
    border-color: var(--line);
}

.danger-action {
    color: #fff;
    background: var(--danger);
}

.primary-action:hover,
.secondary-action:hover,
.danger-action:hover { transform: translateY(-1px); }
.secondary-action:hover { border-color: rgba(37,99,235,.24); box-shadow: var(--shadow-soft); }
.full { width: 100%; }

.alert {
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 750;
    border: 1px solid transparent;
}
.alert.error { color: var(--danger); background: #fff1f0; border-color: #fecdca; }
.alert.success { color: var(--success); background: #ecfdf3; border-color: #abefc6; }

.eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--warm);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.muted { color: var(--muted); }

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.side-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid rgba(255,255,255,.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 950;
    letter-spacing: -.05em;
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: rgba(255,255,255,.55); }

.nav-list { display: grid; gap: 6px; }
.nav-link {
    padding: 12px 13px;
    border-radius: 9px;
    color: rgba(255,255,255,.68);
    font-weight: 800;
}
.nav-link.active,
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.side-user {
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    border-radius: 12px;
}
.side-user span,
.side-user small,
.side-user a { display: block; }
.side-user span { font-weight: 850; }
.side-user small { margin-top: 4px; color: rgba(255,255,255,.58); }
.side-user a { margin-top: 12px; color: #bfdbfe; font-weight: 850; }

.app-main {
    min-width: 0;
    padding: 28px;
}

.mobile-nav { display: none; }

.gm-popup {
    min-width: 210px;
    max-width: 280px;
    color: #0f172a;
}
.gm-popup strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}
.gm-popup span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}
.gm-popup p {
    margin: 8px 0;
    color: #334155;
    line-height: 1.45;
}
.gm-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.gm-popup-actions a {
    padding: 7px 9px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 920px) {
    .app-shell { display: block; padding-bottom: 78px; }
    .side-nav { display: none; }
    .app-main { padding: 14px; }
    .mobile-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 50;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 8px;
        background: rgba(15, 23, 42, .94);
        backdrop-filter: blur(18px);
        border-radius: 16px;
        box-shadow: var(--shadow);
    }
    .mobile-nav-link {
        min-height: 44px;
        display: grid;
        place-items: center;
        color: rgba(255,255,255,.68);
        font-size: 12px;
        font-weight: 850;
        border-radius: 10px;
    }
    .mobile-nav-link.active { color: #0f172a; background: #fff; }
}

/* v18 UI kalite paketi: daha net, canlı ve uygulama hissi */
:root {
    --glass: rgba(255, 255, 255, .74);
    --glass-strong: rgba(255, 255, 255, .90);
    --line-strong: rgba(15, 23, 42, .14);
    --focus-ring: 0 0 0 4px rgba(15, 118, 110, .14);
    --crisp-shadow: 0 18px 46px rgba(15, 23, 42, .10), 0 1px 0 rgba(255,255,255,.70) inset;
    --lift-shadow: 0 24px 68px rgba(15, 23, 42, .14), 0 1px 0 rgba(255,255,255,.72) inset;
    --motion-fast: 160ms;
    --motion-med: 260ms;
    --motion-slow: 420ms;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 9% -4%, rgba(37, 99, 235, .13), transparent 28vw),
        radial-gradient(circle at 88% 8%, rgba(15, 118, 110, .16), transparent 27vw),
        radial-gradient(circle at 78% 92%, rgba(245, 158, 11, .13), transparent 27vw),
        linear-gradient(135deg, #fbfaf7 0%, #f5efe4 48%, #eef6f1 100%);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, .026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .026) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.68), transparent 74%);
}

body.motion-off *,
body.motion-off *::before,
body.motion-off *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

.app-main {
    position: relative;
    padding: 22px;
}

body.ui-density-dense .app-main { padding: 16px; }
body.ui-density-comfortable .app-main { padding: 28px; }

body.js-ready .app-main > * {
    animation: geziPageEnter var(--motion-slow) cubic-bezier(.16, 1, .3, 1) both;
}

body.js-ready .app-main > *:nth-child(2) { animation-delay: 45ms; }
body.js-ready .app-main > *:nth-child(3) { animation-delay: 90ms; }
body.js-ready .app-main > *:nth-child(4) { animation-delay: 135ms; }

@keyframes geziPageEnter {
    from { opacity: 0; transform: translateY(12px) scale(.992); filter: blur(3px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.primary-action,
.secondary-action,
.danger-action,
.nav-link,
.mobile-nav-link,
button,
.btn {
    position: relative;
    isolation: isolate;
    border-radius: 14px;
    transform: translateZ(0);
    transition:
        transform var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease,
        background var(--motion-fast) ease,
        border-color var(--motion-fast) ease,
        color var(--motion-fast) ease,
        opacity var(--motion-fast) ease;
}

.primary-action,
.danger-action {
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18), 0 1px 0 rgba(255,255,255,.14) inset;
}

.primary-action:hover,
.secondary-action:hover,
.danger-action:hover,
button:hover,
.btn:hover {
    transform: translateY(-2px) translateZ(0);
}

.primary-action:active,
.secondary-action:active,
.danger-action:active,
button:active,
.btn:active {
    transform: translateY(0) scale(.985) translateZ(0);
}

.gezi-ripple {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: -1;
    border-radius: 999px;
    background: currentColor;
    opacity: .16;
    transform: translate(-50%, -50%) scale(1);
    animation: geziRipple 620ms ease-out forwards;
}

@keyframes geziRipple {
    to { opacity: 0; transform: translate(-50%, -50%) scale(34); }
}

input,
select,
textarea {
    letter-spacing: -.015em;
    transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: var(--focus-ring) !important;
    border-color: rgba(15, 118, 110, .62) !important;
}

.card-hover,
.settings-panel,
.settings-subsection,
.setting-field,
.setting-toggle,
.trip-list-panel,
.trip-detail-panel,
.turkey-map-card,
.turkey-map-panel,
.turkey-map-stats article,
.family-hero,
.dashboard-map-shell,
.dashboard-card,
.calendar-card,
.trip-list-item,
.info-grid article,
.soft-note,
.muted-box,
.timeline-list article,
.compact-list article {
    backface-visibility: hidden;
    transform: translateZ(0);
}

.setting-field,
.setting-toggle,
.trip-list-item,
.info-grid article,
.soft-note,
.muted-box,
.timeline-list article,
.compact-list article,
.dashboard-card,
.calendar-card {
    transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.setting-field:hover,
.setting-toggle:hover,
.info-grid article:hover,
.soft-note:hover,
.muted-box:hover,
.timeline-list article:hover,
.compact-list article:hover,
.dashboard-card:hover,
.calendar-card:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: var(--crisp-shadow) !important;
    border-color: rgba(15, 118, 110, .18) !important;
}

.nav-link,
.mobile-nav-link {
    overflow: hidden;
}

.nav-link.active,
.nav-link:hover {
    background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
    box-shadow: 0 10px 28px rgba(0,0,0,.12) inset;
}

.side-nav {
    background:
        radial-gradient(circle at 24% 0%, rgba(20,184,166,.18), transparent 35%),
        linear-gradient(180deg, #08111f 0%, #0f172a 55%, #0b1220 100%);
}

.brand-mark {
    background: linear-gradient(135deg, #fff, #e0f2fe);
    box-shadow: 0 10px 26px rgba(0,0,0,.20);
}

.mobile-nav {
    border: 1px solid rgba(255,255,255,.12);
}

.gezi-toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}

.gezi-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #0f766e);
    box-shadow: 0 20px 58px rgba(15, 23, 42, .28);
    font-weight: 850;
    transform-origin: right bottom;
    animation: geziToastIn .26s cubic-bezier(.16, 1, .3, 1) both;
}

.gezi-toast::before {
    content: '';
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 5px rgba(52,211,153,.16);
}

.gezi-toast.is-hiding { animation: geziToastOut .2s ease-in forwards; }
@keyframes geziToastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes geziToastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }

body.form-dirty .settings-savebar,
body.form-dirty .form-actions,
body.form-dirty .trip-modal footer {
    box-shadow: 0 18px 52px rgba(15, 118, 110, .18) !important;
}

/* Sistem genelinde daha kısa, daha net header ölçüleri */
.settings-hero,
.trips-hero,
.family-hero,
.turkey-map-hero,
.page-hero,
.list-hero {
    min-height: 86px !important;
    padding: 14px 18px !important;
    border-radius: 22px !important;
}

.settings-hero h1,
.trips-hero h1,
.family-hero h1,
.turkey-map-hero h1,
.page-hero h1,
.list-hero h1 {
    font-size: clamp(26px, 3.1vw, 42px) !important;
    line-height: .98 !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
}

.settings-hero p,
.trips-hero p,
.family-hero p,
.turkey-map-hero p,
.page-hero p,
.list-hero p {
    max-width: 720px !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}

.eyebrow {
    margin-bottom: 5px;
    letter-spacing: .18em;
}

@media (max-width: 920px) {
    .app-main { padding: 12px; }
    .gezi-toast-stack { left: 12px; right: 12px; bottom: 86px; width: auto; }
    .settings-hero,
    .trips-hero,
    .family-hero,
    .turkey-map-hero,
    .page-hero,
    .list-hero { border-radius: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}
