/* ============================================================
   RSB Portal Shell — Global Design System
   Her kulübün renkleri inject_dynamic_colors() üzerinden
   --rsb-primary, --rsb-primary-dark, --rsb-secondary olarak gelir.
   ============================================================ */

:root {
    --rsb-primary:       #1a3a5c;
    --rsb-primary-dark:  #122843;
    --rsb-secondary:     #f5a623;
    --rsb-accent:        #4a9fd4;
    --rsb-text:          #1a1a2e;
    --rsb-text-muted:    #6b7280;
    --rsb-bg:            #f4f6f9;
    --rsb-card-bg:       #ffffff;
    --rsb-border:        #e5e7eb;
    --rsb-radius:        12px;
    --rsb-radius-sm:     8px;
    --rsb-shadow:        0 1px 3px rgba(0,0,0,0.08);
    --rsb-shadow-md:     0 4px 12px rgba(0,0,0,0.10);
}

/* ── Shell ── */
.rsb-portal-shell {
    display: flex;
    align-items: flex-start;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--rsb-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
}
.rsb-portal-shell *, .rsb-portal-shell *::before, .rsb-portal-shell *::after {
    box-sizing: border-box;
}

/* ── Sidebar ── */
.rsb-portal-sidebar {
    flex: 0 0 240px;
    width: 240px;
    min-height: 100vh;
    background: var(--rsb-primary) !important;
    padding: 0 0 80px 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow-y: auto;
    max-height: 100vh;
}

/* Sidebar: Kulüp kimliği */
.rsb-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    text-decoration: none;
}
.rsb-sidebar-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.12);
    padding: 4px;
    flex-shrink: 0;
}
.rsb-sidebar-brand-logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}
.rsb-sidebar-brand-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    opacity: 0.92;
}

/* Sidebar: Kullanıcı bilgisi */
.rsb-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rsb-sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rsb-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--rsb-primary);
    flex-shrink: 0;
}
.rsb-sidebar-username {
    font-size: 12px;
    color: rgba(255,255,255,0.80);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rsb-sidebar-logout {
    font-size: 11px;
    color: rgba(255,255,255,0.50);
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
    white-space: nowrap;
}
.rsb-sidebar-logout:hover {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.80);
}

/* Sidebar: Navigasyon */
.rsb-portal-sidebar__nav {
    padding: 12px 0;
}
.rsb-portal-sidebar__section {
    margin-bottom: 4px;
    padding: 0 8px;
}
aside.rsb-portal-sidebar .rsb-portal-sidebar__link,
aside.rsb-portal-sidebar .rsb-portal-sidebar__link:visited {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 1px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.75) !important;
    text-decoration: none !important;
    border-radius: var(--rsb-radius-sm);
    transition: background 0.15s, color 0.15s;
}

aside.rsb-portal-sidebar .rsb-portal-sidebar__link:hover {
    background: rgba(255,255,255,0.10);
    color: #fff !important;
}

aside.rsb-portal-sidebar .rsb-portal-sidebar__link.is-active {
    background: var(--rsb-secondary) !important;
    color: var(--rsb-primary) !important;
    font-weight: 600;
}

aside.rsb-portal-sidebar .rsb-portal-sidebar__section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.40) !important;
    padding: 10px 8px 4px;
    margin: 0;
}

/* ── Ana içerik ── */
.rsb-portal-main {
    flex: 1;
    min-width: 0;
    padding: 24px;
}
.rsb-portal-main__inner {
    max-width: 900px;
}

/* ── Dashboard kartlar (genel) ── */
.rsb-dashboard-card-v2 {
    background: var(--rsb-card-bg);
    border: 1px solid var(--rsb-border);
    border-radius: var(--rsb-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--rsb-shadow);
}
.rsb-card-title-v2 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--rsb-text-muted);
    margin: 0 0 14px;
}

/* ── Hero ── */
.rsb-dashboard-hero-v2 {
    background: var(--rsb-primary);
    border-radius: var(--rsb-radius);
    padding: 28px 28px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.rsb-dashboard-hero-v2::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.rsb-hero-club-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    opacity: 0.70;
}
.rsb-hero-club-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}
.rsb-hero-club-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.03em;
}
.rsb-hero-greeting {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 4px;
}
.rsb-hero-name {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 6px;
}
.rsb-hero-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 20px;
}
.rsb-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.rsb-hero-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--rsb-secondary);
    color: var(--rsb-primary);
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--rsb-radius-sm);
    text-decoration: none;
    transition: opacity 0.15s;
}
.rsb-hero-btn-primary:hover { opacity: 0.88; color: var(--rsb-primary); }
.rsb-hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--rsb-radius-sm);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.20);
    transition: background 0.15s;
}
.rsb-hero-btn-secondary:hover { background: rgba(255,255,255,0.20); color: #fff; }

/* ── Eksik bilgi uyarısı ── */
.rsb-incomplete-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8ed;
    border: 1px solid #f5c97a;
    border-radius: var(--rsb-radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400e;
}
.rsb-incomplete-banner a {
    font-weight: 700;
    color: #b45309;
    text-decoration: underline;
}

/* ── Haftalık takvim ── */
.rsb-week-card {
    background: var(--rsb-card-bg);
    border: 1px solid var(--rsb-border);
    border-radius: var(--rsb-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--rsb-shadow);
}
.rsb-week-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}
.rsb-week-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--rsb-text-muted);
}
.rsb-week-sub {
    font-size: 12px;
    color: var(--rsb-text-muted);
}
.rsb-week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.rsb-day-cell {
    border: 1px solid var(--rsb-border);
    border-radius: var(--rsb-radius-sm);
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--rsb-text);
}
.rsb-day-cell:hover {
    border-color: var(--rsb-accent);
    box-shadow: 0 0 0 3px rgba(74,159,212,0.12);
}
.rsb-day-cell.is-today {
    border-color: var(--rsb-primary);
    background: #f0f4ff;
}
.rsb-day-cell.is-past {
    opacity: 0.45;
    cursor: default;
}
.rsb-day-cell.has-reservation {
    border-color: var(--rsb-secondary);
    background: #fffbf0;
}
.rsb-day-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rsb-text-muted);
}
.rsb-day-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--rsb-text);
    line-height: 1;
}
.rsb-day-cell.is-today .rsb-day-num {
    color: var(--rsb-primary);
}
.rsb-day-info {
    font-size: 10px;
    color: var(--rsb-text-muted);
    line-height: 1.3;
}
.rsb-day-slots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    font-weight: 700;
    border-radius: 99px;
    padding: 2px 7px;
    margin-top: 2px;
}
.rsb-day-slots.is-full {
    background: #fce4ec;
    color: #c62828;
}
.rsb-week-legend {
    display: flex;
    gap: 14px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.rsb-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--rsb-text-muted);
}
.rsb-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ── Stat kartları ── */
.rsb-dashboard-stats-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.rsb-stat-card-v2 {
    background: var(--rsb-card-bg);
    border: 1px solid var(--rsb-border);
    border-radius: var(--rsb-radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--rsb-shadow);
}
.rsb-stat-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--rsb-text-muted);
    margin-bottom: 6px;
}
.rsb-stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--rsb-primary);
    line-height: 1;
    margin-bottom: 6px;
}
.rsb-stat-link {
    font-size: 11px;
    color: var(--rsb-accent);
    text-decoration: none;
    font-weight: 600;
}
.rsb-stat-card-v2.is-empty .rsb-stat-val {
    font-size: 18px;
    color: var(--rsb-text-muted);
    font-weight: 400;
}
.rsb-stat-cta {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--rsb-primary);
    border-radius: 6px;
    padding: 4px 10px;
    text-decoration: none;
    margin-top: 4px;
    transition: opacity 0.15s;
}
.rsb-stat-cta:hover { opacity: 0.85; color: #fff; }

/* ── Grid (rezervasyonlar + etkinlikler + ağ) ── */
.rsb-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.rsb-dashboard-grid .rsb-dashboard-card-v2 {
    margin-bottom: 0;
}
.rsb-dashboard-grid .rsb-dashboard-card-v2:last-child {
    grid-column: 1 / -1;
}

/* ── Mobil ── */
@media (max-width: 782px) {
    .rsb-portal-shell {
        flex-direction: column;
        padding-bottom: 64px;
    }
    .rsb-portal-sidebar {
        display: none;
    }
    .rsb-portal-main {
        padding: 12px 12px 80px;
        width: 100%;
    }
    .rsb-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .rsb-dashboard-grid .rsb-dashboard-card-v2:last-child {
        grid-column: 1;
    }
    .rsb-dashboard-stats-v2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .rsb-week-days {
        grid-template-columns: repeat(7, minmax(42px, 1fr));
        overflow-x: auto;
    }
    .rsb-dashboard-hero-v2 {
        padding: 20px 16px 18px;
    }
    .rsb-hero-name { font-size: 22px; }

    /* Bottom Navigation Bar */
    .rsb-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 60px;
        background: var(--rsb-primary);
        border-top: 1px solid rgba(255,255,255,0.12);
        z-index: 9999;
        align-items: stretch;
    }
    .rsb-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: rgba(255,255,255,0.55);
        font-size: 9px;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        transition: color 0.15s;
        padding: 6px 2px;
    }
    .rsb-bottom-nav-item.is-active,
    .rsb-bottom-nav-item:hover {
        color: var(--rsb-secondary);
    }
    .rsb-bottom-nav-icon {
        font-size: 18px;
        line-height: 1;
    }
}
@media (min-width: 783px) {
    .rsb-bottom-nav { display: none; }
    .rsb-portal-menu-toggle { display: none; }
}
