/* =============================================================
   Rentpro Backoffice — Admin Theme (Bootstrap 5.3 dark base)
   ============================================================= */

:root {
    --rp-sidebar-width:      240px;
    --rp-sidebar-collapsed:  64px;
    --rp-sidebar-bg:         #141518;
    --rp-sidebar-border:     #2a2d32;
    --rp-topbar-height:      56px;
    --rp-topbar-bg:          #1a1d21;
    --rp-content-bg:         #212529;
    --rp-card-bg:            #272b30;
    --rp-card-border:        #33383e;
    --rp-accent:             #0d6efd;
    --rp-accent-hover:       #0b5ed7;
    --rp-text-muted:         #868e96;
    --rp-nav-active-bg:      rgba(13, 110, 253, 0.15);
    --rp-nav-active-text:    #5badff;
    --rp-nav-hover-bg:       rgba(255,255,255,.05);
    --rp-transition:         0.2s ease;
}

/* ── Base ──────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    background-color: var(--rp-content-bg);
    color: #dee2e6;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
}

a { color: var(--rp-accent); text-decoration: none; }
a:hover { color: var(--rp-accent-hover); }

/* ── Layout wrapper ────────────────────────────────────────── */

.rp-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */

.rp-sidebar {
    width: var(--rp-sidebar-width);
    min-height: 100vh;
    background: var(--rp-sidebar-bg);
    border-right: 1px solid var(--rp-sidebar-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width var(--rp-transition);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-x: hidden;
}

.rp-sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: var(--rp-topbar-height);
    border-bottom: 1px solid var(--rp-sidebar-border);
    gap: .6rem;
    white-space: nowrap;
    overflow: hidden;
}

.rp-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--rp-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: .85rem;
    flex-shrink: 0;
}

.rp-logo-text {
    font-weight: 700;
    font-size: 1rem;
    color: #f8f9fa;
    letter-spacing: -.3px;
}

.rp-logo-sub {
    font-size: .65rem;
    color: var(--rp-text-muted);
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* Navigation */

.rp-nav {
    flex: 1;
    padding: .75rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.rp-nav-section {
    padding: .5rem 1rem .25rem;
    font-size: .7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--rp-text-muted);
    white-space: nowrap;
}

.rp-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1rem;
    color: #adb5bd;
    border-radius: 0;
    transition: background var(--rp-transition), color var(--rp-transition);
    white-space: nowrap;
    position: relative;
    font-size: 1rem;
}

.rp-nav-link:hover {
    background: var(--rp-nav-hover-bg);
    color: #f8f9fa;
}

.rp-nav-link.active {
    background: var(--rp-nav-active-bg);
    color: var(--rp-nav-active-text);
    font-weight: 500;
}

.rp-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--rp-accent);
    border-radius: 0 2px 2px 0;
}

.rp-nav-link i {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.rp-nav-badge {
    margin-left: auto;
    font-size: .65rem;
    background: var(--rp-accent);
    color: #fff;
    padding: .1rem .45rem;
    border-radius: 20px;
}

.rp-placeholder-badge {
    margin-left: auto;
    font-size: .6rem;
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    padding: .1rem .4rem;
    border-radius: 20px;
}

/* Sidebar footer */

.rp-sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid var(--rp-sidebar-border);
}

/* ── Main content area ─────────────────────────────────────── */

.rp-main {
    flex: 1;
    margin-left: var(--rp-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--rp-transition);
}

/* ── Topbar ────────────────────────────────────────────────── */

.rp-topbar {
    height: var(--rp-topbar-height);
    background: var(--rp-topbar-bg);
    border-bottom: 1px solid var(--rp-sidebar-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.rp-topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f8f9fa;
    margin: 0;
}

.rp-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.rp-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--rp-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .8rem;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.rp-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rp-user-footer-link {
    min-width: 0;
}

.rp-user-footer-link:hover .rp-user-avatar {
    outline: 2px solid var(--rp-accent);
}

/* ── Page content ──────────────────────────────────────────── */

.rp-content {
    padding: 1.75rem 1.5rem;
    flex: 1;
}

/* ── Cards / Widgets ───────────────────────────────────────── */

.rp-card {
    background: var(--rp-card-bg);
    border: 1px solid var(--rp-card-border);
    border-radius: 10px;
    padding: 1.25rem;
}

.rp-card-title {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--rp-text-muted);
    margin-bottom: .5rem;
}

.rp-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f8f9fa;
    line-height: 1;
}

.rp-stat-label {
    font-size: .8rem;
    color: var(--rp-text-muted);
    margin-top: .25rem;
}

.rp-widget-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ── Tables ────────────────────────────────────────────────── */

.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,.03);
    --bs-table-hover-bg: rgba(255,255,255,.05);
    --bs-table-border-color: var(--rp-card-border);
    color: #dee2e6;
}

/* ── Alerts / Flash messages ───────────────────────────────── */

.rp-flash {
    margin-bottom: 1rem;
}

/* ── Placeholder modules ───────────────────────────────────── */

.rp-placeholder-module {
    text-align: center;
    padding: 4rem 2rem;
}

.rp-placeholder-icon {
    font-size: 4rem;
    color: var(--rp-text-muted);
    margin-bottom: 1.5rem;
    opacity: .4;
}

/* ── Login page ────────────────────────────────────────────── */

.rp-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rp-sidebar-bg);
    padding: 1rem;
}

.rp-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--rp-card-bg);
    border: 1px solid var(--rp-card-border);
    border-radius: 14px;
    padding: 2.5rem;
}

.rp-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

/* ── Badge overrides ───────────────────────────────────────── */

.badge-role {
    font-size: .7rem;
    font-weight: 500;
    padding: .25rem .5rem;
}

/* ── Responsive: collapse sidebar on mobile ────────────────── */

@media (max-width: 991.98px) {
    .rp-sidebar {
        transform: translateX(-100%);
    }

    .rp-sidebar.show {
        transform: translateX(0);
    }

    .rp-main {
        margin-left: 0;
    }

    .rp-sidebar-overlay {
        display: block !important;
    }
}

.rp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
}

/* ── Profile page ──────────────────────────────────────────── */

.rp-profile-photo-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--rp-accent);
    display: block;
    margin: 0 auto;
}

.rp-profile-initials-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--rp-accent);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.rp-drop-zone {
    border: 2px dashed var(--rp-card-border);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--rp-transition), background var(--rp-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rp-drop-zone:hover,
.rp-drop-zone--over {
    border-color: var(--rp-accent);
    background: rgba(13, 110, 253, .06);
}

/* ── Utility ───────────────────────────────────────────────── */

.text-muted-sm {
    font-size: .875rem;
    color: var(--rp-text-muted);
}

.divider {
    border-top: 1px solid var(--rp-card-border);
    margin: 1rem 0;
}
