/* ============================================================
   RW.Core.WebUI — site.css
   Marka rengi ve genel stiller. Sade tutuldu; Bootstrap 5 üzerine
   sadece markaya özel ince eklemeler yapılmıştır.
   ============================================================ */

:root {
    --brand: #975ba5;          /* ana marka rengi */
    --brand-600: #835091;      /* hover / koyu */
    --brand-700: #6d4279;      /* basılı / daha koyu */
    --brand-50: #f4eef7;       /* açık tint (arka plan) */
    --ink: #2b2533;            /* ana metin */
    --muted: #6b6577;          /* ikincil metin */
    --line: #e7e3ec;           /* kenarlık */
}

body {
    margin: 0;
    color: var(--ink);
    background: #f6f4f8;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* Sayfanın en üstündeki ince marka şeridi */
.brand-strip {
    height: 4px;
    background: var(--brand);
}

/* ---------- Navbar (genel layout) ---------- */
.app-navbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.app-navbar .navbar-brand img {
    height: 30px;
    width: auto;
}

.app-navbar .nav-link {
    color: var(--ink);
    font-weight: 600;
    padding-inline: .9rem;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: var(--brand);
}

/* Kullanıcı avatarı (baş harf) */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ---------- Marka butonu ---------- */
.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

.btn-brand:active {
    background: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
    color: #fff !important;
}

.link-brand {
    color: var(--brand);
    text-decoration: none;
}

.link-brand:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

/* Form alanlarına marka odak rengi */
.form-control:focus,
.form-check-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(151, 91, 165, .20);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

/* ---------- Login ekranı ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, var(--brand-50) 0%, #f6f4f8 100%);
}

.auth-card {
    width: 100%;
    max-width: 410px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(43, 37, 51, .08);
    padding: 32px 30px;
}

.auth-card .logo {
    height: 38px;
    margin-bottom: 6px;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 14px 0 2px;
}

.auth-sub {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 22px;
}

.password-toggle {
    font-size: .8rem;
    cursor: pointer;
    color: var(--brand);
    user-select: none;
}

/* ---------- Kart ---------- */
.card-tile {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

/* ============================================================
   Admin shell — sidebar + topbar
   ============================================================ */
:root {
    --sidebar-w: 256px;
    --topbar-h: 64px;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    z-index: 1040;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
    height: 30px;
    width: auto;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 14px;
}

.sidebar-heading {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px 6px;
}

.sidebar-heading:first-child {
    padding-top: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: .62rem .8rem;
    margin-bottom: 3px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: .94rem;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}

.sidebar-link i {
    font-size: 1.15rem;
    line-height: 1;
    color: var(--muted);
    width: 1.4em;
    text-align: center;
    transition: color .12s ease;
}

.sidebar-link:hover {
    background: var(--brand-50);
    color: var(--brand);
}

.sidebar-link:hover i {
    color: var(--brand);
}

.sidebar-link.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 6px 16px rgba(151, 91, 165, .28);
}

.sidebar-link.active i {
    color: #fff;
}

.sidebar-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(43, 37, 51, .45);
    z-index: 1035;
}

/* ---------- Main alanı ---------- */
.app-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Topbar ---------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.topbar-toggle {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    color: var(--ink);
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}

.topbar-search {
    align-items: center;
    gap: 8px;
    flex: 1 1 320px;
    max-width: 420px;
    background: #f3f1f6;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--muted);
}

.topbar-search:focus-within {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(151, 91, 165, .15);
}

.topbar-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--ink);
    font-size: .92rem;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.topbar-icon-btn:hover {
    background: var(--brand-50);
    color: var(--brand);
    border-color: var(--brand-50);
}

/* Aktif dropdown öğesi (ör. seçili dil) marka renginde */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--brand);
    color: #fff;
}

.topbar-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0556b;
    border: 2px solid #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 5px 12px 5px 6px;
    cursor: pointer;
}

.topbar-user:hover {
    background: var(--brand-50);
    border-color: var(--brand-50);
}

.topbar-user::after {
    color: var(--muted);
}

.topbar-user-meta {
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.topbar-user-meta .name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-meta .role {
    font-size: .72rem;
    color: var(--brand);
    font-weight: 600;
}

/* ---------- İçerik ---------- */
.app-content {
    flex: 1 0 auto;
    padding: 26px 28px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
}

.page-sub {
    color: var(--muted);
    margin-top: 2px;
}

/* ---------- Footer ---------- */
.app-footer {
    flex: none;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 14px 28px;
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Stat kartları ---------- */
.stat-card {
    height: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.stat-card:hover {
    box-shadow: 0 10px 24px rgba(43, 37, 51, .07);
    transform: translateY(-2px);
}

/* Tıklanabilir stat kartları (ilgili filtreli sayfaya götürür) */
a.stat-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.stat-card:hover {
    border-color: var(--brand);
}

/* Son hareketler (dashboard) — tıklanabilir grid satırlar */
.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-row {
    display: grid;
    grid-template-columns: 150px 1.4fr 1fr 140px;
    gap: 12px;
    align-items: center;
    padding: 10px 6px;
    border-top: 1px solid var(--line);
    font-size: .85rem;
    color: var(--ink);
    text-decoration: none;
}

.recent-row:first-child {
    border-top: 0;
}

.recent-row > span {
    /* min-width:0 olmadan grid hücresi en uzun kelimeden küçülemez → ellipsis çalışmaz ve satır taşar. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-head {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

a.recent-row:hover {
    background: var(--brand-50);
}

.recent-bkg {
    font-weight: 600;
    color: var(--brand);
}

.stat-icon {
    flex: none;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.brand { background: var(--brand-50); color: var(--brand); }
.stat-icon.amber { background: #fdf1dd; color: #c6841a; }
.stat-icon.green { background: #e3f6ec; color: #1f9d57; }
.stat-icon.slate  { background: #eef0f3; color: #5b6573; }
.stat-icon.red    { background: #fdecec; color: #c0392b; }
.stat-icon.indigo { background: #e9ebfb; color: #4a52c4; }

/* Stat grubu üstündeki küçük etiket (Yönetim Özeti / Rezervasyon Durumu) */
.dash-group-label {
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin: 18px 0 8px;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-label {
    color: var(--ink);
    font-weight: 600;
    font-size: .9rem;
}

.stat-hint {
    color: var(--muted);
    font-size: .78rem;
    margin-top: 2px;
}

/* ---------- Bölüm başlığı / hızlı işlemler / boş durum ---------- */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--brand);
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: .9rem;
    text-align: center;
    transition: all .14s ease;
}

.quick-action i {
    font-size: 1.5rem;
    color: var(--brand);
}

.quick-action:hover {
    border-color: var(--brand);
    background: var(--brand-50);
    color: var(--brand);
    transform: translateY(-2px);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    padding: 30px 16px;
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--line);
    margin-bottom: 10px;
}

/* ---------- Tablo ---------- */
.data-table {
    margin: 0;
}

.data-table thead th {
    background: #faf8fc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 13px 16px;
    border-top: 1px solid var(--line);
    vertical-align: middle;
    font-size:13px;
}

.data-table tbody tr:hover {
    background: var(--brand-50);
}

/* Uzun metinli hücre (ör. otel adı): tek satırda kalır, taşan kısım üç noktayla kesilir.
   Kesilmeseydi ad sütunu genişleyip diğer sütunları sıkıştırıyor, işlem butonu alt satıra
   kayıp satır yüksekliğini bozuyordu. Tam metin hücrenin title'ında durur. */
.cell-truncate {
    display: block;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* İşlem sütunu asla sarmalanmaz; buton + sil ikonu aynı satırda kalır. */
.data-table td.cell-actions {
    white-space: nowrap;
}

/* ---------- Durum rozeti ---------- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
}

.badge-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge-status.active { background: #e3f6ec; color: #1f9d57; }
.badge-status.passive { background: #f1eef4; color: var(--muted); }

/* Rol yetki ekranı */
.perm-group-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--brand);
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.perm-item {
    margin-bottom: 6px;
}

.perm-item .form-check-label {
    font-size: .9rem;
}

/* Yetkisiz erişim (403) sayfası */
.access-denied-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
}

.access-denied-code {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: .05em;
    margin-bottom: 4px;
}

/* Sayfalama (pagination) marka rengi */
.pagination .page-link {
    color: var(--brand);
}

.pagination .page-item.active .page-link {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 .2rem rgba(151, 91, 165, .20);
}

/* Rol rozeti */
.badge-role {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    background: var(--brand-50);
    color: var(--brand);
}

/* Açık tehlike butonu (sil) */
.btn-light-danger {
    background: #fdeced;
    border: 1px solid transparent;
    color: #d6334a;
    font-weight: 600;
}

.btn-light-danger:hover {
    background: #f8d7da;
    color: #b02a3a;
}

/* ---------- Açık marka butonu (ikincil) ---------- */
.btn-light-brand {
    background: var(--brand-50);
    border: 1px solid transparent;
    color: var(--brand);
    font-weight: 600;
}

.btn-light-brand:hover {
    background: #ebdcf0;
    color: var(--brand-700);
}

/* ---------- Form: label & switch ---------- */
.form-label {
    font-weight: 600;
    font-size: .88rem;
    color: var(--ink);
    margin-bottom: 4px;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.section-title.mt-4 {
    padding-top: 4px;
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 18px;
}

/* ---------- Responsive: sidebar mobilde gizlenir ---------- */
/* DİKKAT: burası statik CSS — Razor DEĞİL. "@@media" yazılırsa kural geçersiz olur ve
   tüm mobil düzen sessizce devre dışı kalır (sidebar açık kalır, içerik ~119px'e sıkışır). */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }
}

/* ---------- Responsive: dar ekranda içerik ve dashboard listesi ---------- */
@media (max-width: 575.98px) {
    /* Kenar boşluklarını küçült — dar ekranda her piksel içeriğe kalsın. */
    .app-content {
        padding: 18px 14px;
    }

    .app-topbar {
        padding: 0 14px;
        gap: 10px;
    }

    .app-footer {
        padding: 14px;
    }

    /* Son hareketler: 4 sabit kolon dar ekrana sığmaz → no/tarih üstte, otel/acente altta. */
    .recent-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, auto);
        gap: 2px 10px;
    }

    .recent-head {
        display: none;
    }
}

/* ============================================================
   Login — iki panelli (split) tasarım
   ============================================================ */
.auth-split {
    min-height: 100vh;
}

/* Sol: marka paneli */
.auth-brandside {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 56px 52px;
    background: linear-gradient(140deg, var(--brand) 0%, var(--brand-700) 100%);
    align-items: center;   /* içeriği yatayda ortala */
    text-align: center;
}

.auth-brandside .auth-illustration {
    position: relative;
    z-index: 1;
    width: 82%;
    max-width: 360px;
    height: auto;
    margin: 0 auto 6px;
}

.auth-brandside .headline {
    position: relative;
    z-index: 1;
    margin: 18px auto 0;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    max-width: 380px;
}

.auth-brandside .headline-sub {
    position: relative;
    z-index: 1;
    margin: 12px auto 0;
    max-width: 380px;
    color: rgba(255, 255, 255, .85);
}

.auth-feature {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;   /* tik + metni ortala */
    gap: 12px;
    margin-top: 16px;
    color: rgba(255, 255, 255, .95);
}

.auth-feature .tick {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
}

/* dekoratif daireler */
.auth-brandside .blob {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.auth-brandside .blob-1 { width: 320px; height: 320px; right: -120px; top: -90px; }
.auth-brandside .blob-2 { width: 200px; height: 200px; right: 40px; bottom: -90px; }

/* Sağ: form paneli */
.auth-formside {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 40px 24px;
}

.auth-form {
    width: 100%;
    max-width: 380px;
}

.auth-form .form-logo {
    height: 68px;
}

/* Login ekranı dil seçici (footer) — dünya ikonlu dropdown */
.auth-lang-btn {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.auth-lang-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.auth-lang-btn .bi-globe2 {
    color: var(--brand);
}

.auth-lang-btn .bi-chevron-down {
    font-size: .75rem;
}

.auth-lang .dropdown-menu {
    min-width: 170px;
}

/* Select2 — Bootstrap 5 + marka (#975ba5) uyumu */
.select2-container .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.125rem 0.25rem;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #975ba5;
    box-shadow: 0 0 0 0.25rem rgba(151, 91, 165, 0.25);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #975ba5;
    border: none;
    color: #fff;
    border-radius: 0.25rem;
    padding: 0.1rem 0.5rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 0.35rem;
    border: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: transparent;
    color: #fff;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #975ba5;
}

.select2-dropdown {
    border-color: #975ba5;
}

/* Filtre barındaki "sayfa başına" seçici: buton satırında sağa yaslı, dar ve sabit genişlikte */
.filter-pagesize {
    width: 110px;
    flex: none;
}

.filter-pagesize .form-label {
    white-space: nowrap;
}

/* Rezervasyon durum rozetleri (state id'ye göre renk) — liste + detay */
.state-badge { padding: .28rem .6rem; border-radius: 8px; font-size: .78rem; font-weight: 600; display: inline-block; line-height: 1; }
.state-badge.state-1 { background: #fff3cd; color: #8a6d00; }  /* Ön Rez = Sarı */
.state-badge.state-2 { background: #d1e7dd; color: #0f5132; }  /* Kesin Rez = Yeşil */
.state-badge.state-3 { background: #f8d7da; color: #842029; }  /* Kesin rezden iptal = Kırmızı */
.state-badge.state-4 { background: #ffe0c2; color: #8a4b00; }  /* Ön rezden iptal = Turuncu */
