:root {
    --bg-main: #f5f1e8;
    --bg-soft: #e8efe9;
    --surface: #fffdf8;
    --surface-muted: #f8f5ee;
    --line: #d7ded5;
    --ink: #20323f;
    --ink-muted: #60707d;
    --primary: #1d7a63;
    --primary-strong: #145646;
    --accent: #cc6a3f;
    --accent-soft: #ffe8dd;
    --warning: #e2a21f;
    --danger: #b6423c;
    --ok: #2f7f61;
    --shadow-soft: 0 20px 50px rgba(32, 50, 63, 0.08);
    --shadow-card: 0 12px 30px rgba(32, 50, 63, 0.07);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --sidebar-width: 240px;
    /* Takvim tür renkleri */
    --type-blue: #2563eb;
    --type-red: #dc2626;
    --type-purple: #9333ea;
    --type-orange: #ea580c;
    --type-teal: #0d9488;
    --type-yellow: #ca8a04;
    --type-pink: #e11d48;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', 'Trebuchet MS', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 14%, rgba(29, 122, 99, 0.15) 0, transparent 42%),
        radial-gradient(circle at 86% 4%, rgba(204, 106, 63, 0.14) 0, transparent 36%),
        linear-gradient(160deg, var(--bg-main) 0%, #f7f5ef 42%, var(--bg-soft) 100%);
}

h1, h2, h3, h4, h5, h6,
.display-font,
.brand-text {
    font-family: 'Sora', 'Verdana', sans-serif;
    letter-spacing: -0.02em;
}

.site-shell {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-shell > .main-content {
    flex: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 253, 248, 0.82);
    border-bottom: 1px solid rgba(32, 50, 63, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 0.35rem 0;
    transition: box-shadow 0.3s ease;
}

.topbar:hover {
    box-shadow: 0 4px 24px rgba(32, 50, 63, 0.06);
}

.brand-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
}

.brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    overflow: visible;
}

.brand-mark svg,
.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: left center;
    max-width: 100%;
    max-height: 100%;
}

.topbar .brand-wrap {
    margin-right: auto;
}

.topbar .brand-mark {
    width: 200px;
    height: 72px;
    border-radius: 0;
}

.footer-wrap .brand-mark {
    width: 230px;
    height: 86px;
    border-radius: 0;
}

.brand-text .brand-accent {
    color: #ea580c;
}

.brand-text {
    color: var(--ink);
    font-size: 1.06rem;
    font-weight: 700;
}

.navbar-toggler {
    border: 1px solid rgba(32, 50, 63, 0.12);
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    font-size: 1.25rem;
    color: var(--ink);
    transition: all 0.2s ease;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(29, 122, 99, 0.2);
}

.nav-pills-group {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.navbar .nav-link {
    border-radius: 10px;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.navbar .nav-link .nav-icon {
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.navbar .nav-link:hover {
    color: var(--primary-strong);
    background: rgba(29, 122, 99, 0.08);
}

.navbar .nav-link:hover .nav-icon {
    opacity: 1;
}

.navbar .nav-link.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(29, 122, 99, 0.3);
}

.navbar .nav-link.active .nav-icon {
    opacity: 1;
}

.navbar-actions {
    gap: 0.5rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 12px;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    border: 1px solid rgba(32, 50, 63, 0.08);
    background: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    color: var(--ink);
    transition: all 0.2s ease;
}

.profile-chip:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(29, 122, 99, 0.2);
    box-shadow: 0 2px 12px rgba(29, 122, 99, 0.08);
    color: var(--ink);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.profile-avatar--patient {
    background: linear-gradient(135deg, var(--accent) 0%, #b55a32 100%);
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
}

.profile-role {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-logout {
    border-radius: 10px;
    border: 1px solid rgba(32, 50, 63, 0.1);
    background: rgba(255, 255, 255, 0.5);
    color: var(--ink-muted);
    padding: 0.45rem 0.65rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(182, 66, 60, 0.08);
    border-color: rgba(182, 66, 60, 0.2);
    color: var(--danger);
}

.main-content {
    padding: 2rem 0 2.7rem;
}

/* ── Sidebar Layout ───────────────────────── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.sidebar-brand a {
    display: block;
}

.sidebar-brand img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    color: var(--primary-strong);
    background: rgba(29, 122, 99, 0.08);
}

.sidebar-link.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(29, 122, 99, 0.25);
}

.sidebar-link--sm {
    font-size: 0.8rem;
    padding: 0.45rem 0.85rem;
    color: var(--ink-muted);
    opacity: 0.7;
}

.sidebar-link--sm:hover {
    opacity: 1;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 0.4rem 0.75rem 0.75rem;
    border-top: 1px solid var(--line);
}

/* Profil kartı */
.sidebar-profile-card {
    margin-top: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sidebar-profile-card--patient {
    border-color: var(--line);
}

.sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.15s;
}

a.sidebar-profile-link:hover {
    background: rgba(29, 122, 99, 0.05);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
    flex-shrink: 0;
}

.sidebar-avatar--patient {
    background: linear-gradient(135deg, var(--accent), #b55a32);
}

.sidebar-profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-profile-text strong {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-text small {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: var(--surface-muted);
    border-top: 1px solid var(--line);
}

.sidebar-logout-btn {
    border: none;
    background: none;
    color: var(--danger);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.sidebar-logout-btn:hover {
    background: rgba(182, 66, 60, 0.1);
}

.sidebar--patient .sidebar-link.active {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(29, 122, 99, 0.25);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1039;
}

.panel-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.panel-topbar {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: 1px solid rgba(32, 50, 63, 0.12);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.55rem;
    font-size: 1.3rem;
    color: var(--ink);
    cursor: pointer;
}

.panel-content {
    flex: 1;
    padding: 1.5rem;
}

/* Sidebar responsive: mobil */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar.show + .sidebar-overlay {
        display: block;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .panel-main {
        margin-left: 0;
    }
    .panel-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1020;
        align-items: center;
        padding: 0.5rem 1rem;
        background: rgba(255, 253, 248, 0.92);
        border-bottom: 1px solid rgba(32, 50, 63, 0.06);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        min-height: 48px;
    }
    .panel-content {
        padding: 1rem;
    }
}

.surface-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
    box-shadow: var(--shadow-card);
}

.surface-muted {
    border: 1px solid rgba(96, 112, 125, 0.16);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    background: rgba(29, 122, 99, 0.14);
    color: var(--primary-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.34rem 0.72rem;
}

.muted {
    color: var(--ink-muted) !important;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.6rem 1rem;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-strong);
    border-color: var(--primary-strong);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary-strong);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: var(--primary);
    background-color: rgba(29, 122, 99, 0.1);
    color: var(--primary-strong);
}

.btn-secondary,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: #70828f;
    border-color: #70828f;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #586774;
    border-color: #586774;
    color: #fff;
}

.btn-danger,
.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger,
.btn-danger:hover {
    color: #fff;
    background: var(--danger);
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 1rem;
    box-shadow: var(--shadow-card);
    height: 100%;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.metric-value {
    font-family: 'Sora', sans-serif;
    font-size: 1.42rem;
    line-height: 1.1;
    margin-bottom: 0.2rem;
    color: var(--ink);
}

.metric-help {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ink-muted);
}

.icon-pill {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(29, 122, 99, 0.14);
    color: var(--primary-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.data-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.58rem 0;
    border-bottom: 1px solid rgba(96, 112, 125, 0.16);
    font-size: 0.92rem;
}

.data-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.data-list span:first-child {
    color: var(--ink-muted);
}

.action-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.78rem;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    color: var(--ink);
    transition: all 0.18s ease;
}

.action-link:hover {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

.status-pill,
.badge-scheduled,
.badge-confirmed,
.badge-completed,
.badge-cancelled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.status-scheduled,
.badge-scheduled,
.badge-scheduled.badge {
    background: #e8f1ff;
    color: #264d8f;
    border-color: #bfd2f2;
}

.status-confirmed,
.badge-confirmed,
.badge-confirmed.badge {
    background: #e5f6ee;
    color: #1f6a4d;
    border-color: #b8decf;
}

.status-completed,
.badge-completed,
.badge-completed.badge {
    background: #edf0f2;
    color: #455560;
    border-color: #cfd7dc;
}

.status-cancelled,
.badge-cancelled,
.badge-cancelled.badge {
    background: #ffecea;
    color: #95423f;
    border-color: #f4c4bf;
}

.appointment-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1rem 1.05rem;
    background: #fff;
}

.appointment-card + .appointment-card {
    margin-top: 0.92rem;
}

.upcoming-appointments-section {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 245, 238, 0.84) 100%);
}

.upcoming-appointment-card {
    border: 1px solid rgba(96, 112, 125, 0.24);
    box-shadow: 0 8px 20px rgba(32, 50, 63, 0.05);
}

.upcoming-appointment-grid {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
}

.upcoming-time-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    border: 1px solid rgba(29, 122, 99, 0.2);
    background: linear-gradient(160deg, rgba(29, 122, 99, 0.12), rgba(29, 122, 99, 0.03));
    border-radius: 10px;
    padding: 0.52rem 0.45rem;
    min-height: 76px;
}

.upcoming-day {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--primary-strong);
}

.upcoming-month {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
}

.upcoming-clock {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink);
}

.upcoming-main {
    min-width: 0;
}

.upcoming-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}

.upcoming-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.upcoming-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(96, 112, 125, 0.24);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    line-height: 1.2;
}

.upcoming-note {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upcoming-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.upcoming-actions .status-pill {
    margin-right: 0.2rem;
}

.upcoming-actions form {
    margin: 0;
}

@media (max-width: 991.98px) {
    .upcoming-appointment-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .upcoming-time-badge {
        flex-direction: row;
        justify-content: flex-start;
        min-height: 0;
        gap: 0.5rem;
    }

    .upcoming-head {
        flex-wrap: wrap;
    }

    .upcoming-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .upcoming-note {
        max-width: 100%;
    }
}

.auth-shell {
    min-height: calc(100vh - 20px);
    display: flex;
    align-items: center;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
}

.auth-side {
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(29, 122, 99, 0.2), rgba(20, 86, 70, 0.75)),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.35), transparent 38%);
    color: #fff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 420px;
}

.auth-bullet {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-bottom: 0.65rem;
    font-size: 0.93rem;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid rgba(96, 112, 125, 0.34);
    padding: 0.62rem 0.8rem;
    background: #fff;
    font-weight: 500;
    color: var(--ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.18rem rgba(29, 122, 99, 0.17);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.73rem;
    color: var(--ink-muted);
    border-bottom-width: 1px;
    border-color: rgba(96, 112, 125, 0.3);
    font-weight: 800;
}

.table tbody td {
    font-size: 0.92rem;
    border-color: rgba(96, 112, 125, 0.18);
    vertical-align: middle;
}

.alert {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(32, 50, 63, 0.08);
    font-weight: 600;
}

.section-title {
    margin-bottom: 1rem;
}

.section-title h1,
.section-title h2,
.section-title h3 {
    margin-bottom: 0.3rem;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed rgba(96, 112, 125, 0.38);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
}

.lang-toggle {
    display: inline-flex;
    border-radius: 10px;
    border: 1px solid rgba(96, 112, 125, 0.22);
    background: rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 0.32rem 0.7rem;
    font-family: 'Sora', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1;
}

.lang-btn:hover {
    color: var(--primary-strong);
    background: rgba(29, 122, 99, 0.06);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
    cursor: default;
}

.lang-btn + .lang-btn {
    border-left: 1px solid rgba(96, 112, 125, 0.18);
}

.lang-btn.active + .lang-btn,
.lang-btn + .lang-btn.active {
    border-left-color: transparent;
}

.footer-wrap {
    border-top: 1px solid rgba(32, 50, 63, 0.12);
    background: rgba(255, 253, 248, 0.75);
}

.codezzium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--ink-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.codezzium-badge img {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.codezzium-badge:hover img {
    opacity: 1;
}

.fade-up {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.7s ease forwards;
}

.fade-up.delay-1 { animation-delay: 0.12s; }
.fade-up.delay-2 { animation-delay: 0.24s; }
.fade-up.delay-3 { animation-delay: 0.36s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .topbar {
        position: static;
        padding: 0.5rem 0;
    }

    .nav-pills-group {
        flex-direction: column;
        gap: 0.15rem;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(32, 50, 63, 0.06);
    }

    .navbar .nav-link {
        border-radius: 10px;
        padding: 0.6rem 0.9rem;
    }

    .navbar-actions {
        padding-top: 0.75rem;
        border-top: 1px solid rgba(32, 50, 63, 0.06);
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-side {
        min-height: unset;
    }
}

@media (max-width: 767.98px) {
    .topbar .brand-mark {
        width: 160px;
        height: 58px;
    }

    .footer-wrap .brand-mark {
        width: 184px;
        height: 68px;
    }

    .main-content {
        padding-top: 1.3rem;
    }

    .metric-value {
        font-size: 1.26rem;
    }
}


/* ── Calendar ─────────────────────────────── */

/* ── Calendar grid ───────────────────────── */

.calendar-grid {
    font-size: 0.82rem;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    min-width: 760px;
}

.calendar-grid th,
.calendar-grid td {
    border: 1px solid var(--line);
    vertical-align: top;
}

.calendar-time-col {
    width: 58px;
}

.calendar-time-cell {
    text-align: center;
    background: var(--surface-muted);
    color: var(--ink-muted);
    padding: 0 4px;
    font-size: 0.75rem;
    font-weight: 600;
    height: 56px;
    vertical-align: middle;
    white-space: nowrap;
}

.calendar-day-header {
    background: var(--surface-muted);
    padding: 8px 4px;
    text-align: center;
    white-space: nowrap;
}

.calendar-day-header.today-col {
    background: rgba(29, 122, 99, 0.08);
    border-bottom: 2px solid var(--ok);
}

.calendar-day-header .day-label {
    font-size: 0.7rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-day-header .day-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.calendar-day-header.today-col .day-number {
    color: var(--ok);
}

.calendar-cell {
    min-height: 56px;
    height: 56px;
    padding: 3px;
    transition: background 0.12s;
    position: relative;
}

/* birden fazla randevu varsa hücre büyür */
.calendar-cell.slot-booked {
    height: auto;
    min-height: 56px;
}

.slot-available {
    background: rgba(29, 122, 99, 0.03);
}

.slot-available:hover {
    background: rgba(29, 122, 99, 0.09);
}

.slot-booked {
    background: #fff;
}

.slot-past {
    background: var(--surface-muted);
    opacity: 0.5;
}

.calendar-event {
    display: block;
    padding: 4px 6px 4px 10px;
    border-radius: 5px;
    background: rgba(29, 122, 99, 0.08);
    border-left: 3px solid var(--ok);
    font-size: 0.74rem;
    line-height: 1.3;
    margin-bottom: 3px;
    min-height: 44px;
    box-sizing: border-box;
    color: var(--ink);
    text-decoration: none;
    transition: filter 0.12s;
}

.calendar-event:last-child {
    margin-bottom: 0;
}

.calendar-event:hover {
    filter: brightness(0.94);
    color: var(--ink);
}

.calendar-event .event-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event-type {
    font-size: 0.67rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-slot-free {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    color: var(--ok);
    text-decoration: none;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    border-radius: 2px;
}

.calendar-slot-free i {
    font-size: 1rem;
}

.calendar-cell:hover .calendar-slot-free {
    opacity: 1;
    background: rgba(29, 122, 99, 0.07);
}

.calendar-slot-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/* ── Color swatches ───────────────────────── */

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

.color-swatch-sm {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

/* ── Color preset buttons ─────────────────── */

.color-preset {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.color-preset:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Calendar legend ───────────────────────── */

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-dot--available {
    background: rgba(29, 122, 99, 0.15);
    border-color: var(--ok);
}

.legend-dot--booked {
    background: rgba(182, 66, 60, 0.15);
    border-color: var(--danger);
}

.legend-dot--own {
    background: rgba(204, 106, 63, 0.2);
    border-color: var(--accent);
}

.legend-dot--past {
    background: var(--surface-muted);
    border-color: var(--line);
}

/* ── Session progress ─────────────────────── */

.opacity-60 {
    opacity: 0.6;
}

.progress {
    background: var(--surface-muted);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.3s;
}

/* ── Calendar responsive ──────────────────── */

@media (max-width: 768px) {
    .calendar-grid {
        font-size: 0.7rem;
        min-width: 600px;
    }
    .calendar-cell,
    .calendar-time-cell {
        height: 48px;
        min-height: 48px;
    }
    .calendar-cell.slot-booked {
        height: auto;
    }
    .calendar-event {
        min-height: 38px;
        padding: 3px 5px 3px 8px;
    }
}

/* ── Compact UI Tune ─────────────────────── */

html {
    font-size: 15px;
}

body {
    font-size: 0.94rem;
    line-height: 1.45;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.22;
}

.main-content {
    padding: 1.4rem 0 2rem;
}

.section-title {
    margin-bottom: 0.8rem;
}

.section-title h1 {
    font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.95rem);
}

.section-title h2 {
    font-size: clamp(1.2rem, 1rem + 0.7vw, 1.45rem);
}

.section-title h3 {
    font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.2rem);
}

.section-title p,
.muted {
    line-height: 1.4;
}

.btn {
    border-radius: 10px;
    padding: 0.5rem 0.82rem;
    font-size: 0.84rem;
}

.btn-sm {
    padding: 0.36rem 0.62rem;
    font-size: 0.76rem;
}

.btn-lg {
    padding: 0.62rem 1rem;
    font-size: 0.93rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.form-text {
    font-size: 0.74rem;
}

.form-control,
.form-select {
    border-radius: 9px;
    padding: 0.5rem 0.7rem;
    font-size: 0.84rem;
    min-height: 2.1rem;
}

.input-group .btn {
    padding: 0.48rem 0.72rem;
}

.surface-card,
.metric-card,
.appointment-card {
    border-radius: 14px;
}

.table thead th {
    font-size: 0.68rem;
}

.table tbody td {
    font-size: 0.84rem;
}

.table thead th,
.table tbody td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.data-list li {
    font-size: 0.86rem;
    padding: 0.5rem 0;
}

.empty-state {
    padding: 1.4rem 0.85rem;
}

@media (max-width: 767.98px) {
    html {
        font-size: 14px;
    }

    .main-content {
        padding-top: 1rem;
    }

    .btn {
        padding: 0.45rem 0.72rem;
    }
}

/* ── Panel Tabs ──────────────────────────── */

.panel-tabs {
    display: inline-flex;
    gap: 0.3rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid rgba(29, 122, 99, 0.1);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow:
        0 1px 2px rgba(32, 50, 63, 0.04),
        0 8px 24px rgba(32, 50, 63, 0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.panel-tabs::-webkit-scrollbar {
    display: none;
}

.panel-tabs .nav-item {
    flex-shrink: 0;
}

.panel-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.62rem 1.15rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-muted);
    background: transparent;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    letter-spacing: 0.01em;
}

.panel-tabs .nav-link i {
    font-size: 1.05rem;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-tabs .nav-link:hover {
    color: var(--primary);
    background: rgba(29, 122, 99, 0.06);
}

.panel-tabs .nav-link:hover i {
    opacity: 0.8;
}

.panel-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    box-shadow:
        0 2px 4px rgba(29, 122, 99, 0.15),
        0 8px 20px rgba(29, 122, 99, 0.2);
    transform: translateY(-1px);
}

.panel-tabs .nav-link.active i {
    opacity: 1;
    color: #fff;
}

/* Tab Badge */
.panel-tabs .nav-link .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    background: rgba(29, 122, 99, 0.1);
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-tabs .nav-link.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ── Tab Content Transitions ─────────────── */

.tab-content > .tab-pane {
    display: none;
}

.tab-content > .tab-pane.show.active {
    display: block;
}

.tab-content > .tab-pane.fade {
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content > .tab-pane.fade.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Tab Responsive ──────────────────────── */

@media (max-width: 767.98px) {
    .panel-tabs {
        display: flex;
        border-radius: 14px;
        padding: 0.3rem;
        gap: 0.2rem;
    }

    .panel-tabs .nav-link {
        padding: 0.5rem 0.85rem;
        font-size: 0.76rem;
        border-radius: 10px;
        flex: 1;
        justify-content: center;
    }

    .panel-tabs .nav-link i {
        font-size: 0.95rem;
    }

    .panel-tabs .nav-link .tab-badge {
        min-width: 19px;
        height: 19px;
        font-size: 0.62rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Mobil & Responsive İyileştirmeleri (additive — mevcut kurallar korunur)
   ═══════════════════════════════════════════════════════════════ */

/* iOS safe-area: alt navigation bar / home-indicator bölgesi */
@supports (padding: env(safe-area-inset-bottom)) {
    .panel-main {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .footer-wrap {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}

/* iOS Safari otomatik zoom'u önle: focus'landığında input ≥ 16px render olmalı */
@media (max-width: 767.98px) {
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px;
    }
}

/* Dokunma hedefi — Apple HIG önerisi: min 44px */
@media (max-width: 767.98px) {
    .btn,
    .navbar-toggler,
    .sidebar-toggle,
    .lang-btn,
    .btn-close {
        min-height: 40px;
    }
    .btn-sm {
        min-height: 34px;
    }
    .sidebar-link {
        min-height: 44px;
    }
    .navbar .nav-link {
        min-height: 40px;
    }
    /* Ham link butonu gibi davranmalı */
    .sidebar-logout-btn {
        min-height: 36px;
    }
}

/* Ufak telefon (≤ 480px) ince ayarlar */
@media (max-width: 480px) {
    .panel-content {
        padding: 0.85rem;
    }
    .main-content {
        padding-left: 0.15rem;
        padding-right: 0.15rem;
    }
    .section-title {
        margin-bottom: 0.7rem;
    }
    .section-title h1 {
        font-size: 1.35rem;
    }
    .section-title h2 {
        font-size: 1.15rem;
    }
    .section-title h3 {
        font-size: 1.02rem;
    }
    .surface-card,
    .metric-card,
    .appointment-card {
        border-radius: 12px;
    }
    .metric-card {
        padding: 0.85rem;
    }
    .metric-value {
        font-size: 1.18rem;
    }
    .btn-lg {
        padding: 0.55rem 0.9rem;
        font-size: 0.88rem;
    }
    /* Modal'larda ekran kenarlarına dayanma */
    .modal-dialog {
        margin: 0.5rem;
    }
    /* Kartlar arasında soluk alacak boşluk */
    .row.g-4 {
        --bs-gutter-y: 0.9rem;
        --bs-gutter-x: 0.9rem;
    }
}

/* Çok dar telefonlar (≤ 360px) — iPhone SE dik, eski Android */
@media (max-width: 360px) {
    .section-title h1 {
        font-size: 1.2rem;
    }
    .topbar .brand-mark {
        width: 140px;
        height: 50px;
    }
    .panel-content {
        padding: 0.7rem;
    }
    .surface-card.p-4,
    .surface-card.p-lg-4 {
        padding: 1rem !important;
    }
    /* Buton öbekleri dar alanda sığmıyorsa tam genişlik */
    .d-flex.flex-wrap.gap-2 > .btn {
        flex: 1 1 auto;
    }
}

/* Mobilde yatay scroll engelle (artık overflow toplam içerik > viewport olmasın) */
@media (max-width: 767.98px) {
    html, body {
        overflow-x: hidden;
    }
}

/* Tablo mobilde ellipsis yerine küçük ama okunabilir */
@media (max-width: 575.98px) {
    .table tbody td {
        font-size: 0.78rem;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }
    .table thead th {
        font-size: 0.64rem;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }
    .status-pill,
    .badge-scheduled,
    .badge-confirmed,
    .badge-completed,
    .badge-cancelled {
        font-size: 0.66rem;
        padding: 0.2rem 0.48rem;
    }
}

/* Sidebar mobilde biraz daha dar — ekrana fazla yer açmak için */
@media (max-width: 480px) {
    .sidebar {
        width: 84%;
        max-width: 280px;
    }
}

/* Erişilebilirlik: hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-up {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    .action-link:hover,
    .panel-tabs .nav-link.active {
        transform: none !important;
    }
}

/* Calendar — çok dar ekranda tek el kullanım için font biraz daha küçük */
@media (max-width: 480px) {
    .calendar-grid {
        font-size: 0.66rem;
        min-width: 520px;
    }
    .calendar-time-col {
        width: 44px;
    }
    .calendar-time-cell {
        font-size: 0.68rem;
        height: 44px;
    }
    .calendar-cell {
        min-height: 44px;
        height: 44px;
    }
}

/* Dashboard today-chip — horizontal scroll mobilde daha akıcı */
@media (max-width: 767.98px) {
    .today-strip {
        scroll-padding-left: 0.5rem;
        scrollbar-width: none;
    }
    .today-strip::-webkit-scrollbar {
        display: none;
    }
    .today-chip {
        scroll-snap-align: start;
    }
}

/* ============================================================
   PWA — INSTALL BANNER (akıllı banner, alt köşede sabit)
   ============================================================ */
.install-banner {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: installSlideUp 0.35s ease-out;
}
.install-banner[hidden] {
    display: none !important;
}
@keyframes installSlideUp {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.install-banner-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 122, 99, 0.12);
    border-radius: var(--radius-md);
    font-size: 1.35rem;
    flex-shrink: 0;
}
.install-banner-text {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--ink);
}
.install-banner-text strong {
    display: block;
    font-weight: 700;
    font-family: 'Sora', 'Manrope', sans-serif;
}
.install-banner-text small {
    color: var(--ink-muted);
    font-size: 0.78rem;
}
.install-banner-cta {
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.15s ease;
}
.install-banner-cta:hover {
    color: #fff;
    transform: translateY(-1px);
}
.install-banner-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--ink-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.install-banner-close:hover {
    background: var(--surface-muted);
    color: var(--ink);
}
@media (min-width: 768px) {
    .install-banner { display: none !important; }
}

/* ============================================================
   PWA — INSTALL GUIDE SAYFASI (/uygulamayi-yukle/)
   ============================================================ */
.install-guide-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(29, 122, 99, 0.08) 0%, rgba(204, 106, 63, 0.06) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
}
.install-guide-hero-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}
.install-guide-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    max-width: 720px;
    margin-inline: auto;
}
.install-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.5rem;
}
.install-tab {
    flex: 1;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.install-tab:hover {
    background: rgba(29, 122, 99, 0.08);
    color: var(--primary);
}
.install-tab.is-active {
    background: rgba(29, 122, 99, 0.12);
    color: var(--primary-strong);
}
.install-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0 0 1.25rem 0;
}
.install-steps li {
    counter-increment: step;
    position: relative;
    padding: 0.85rem 0 0.85rem 3.25rem;
    border-bottom: 1px solid var(--line);
    line-height: 1.5;
    color: var(--ink);
}
.install-steps li:last-child {
    border-bottom: none;
}
.install-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(29, 122, 99, 0.25);
}
.install-screenshot {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--line);
}
