:root {
    --rh-primary: #E85D04;
    --rh-primary-dark: #D00000;
    --rh-primary-rgb: 232, 93, 4;
    --rh-sidebar-width: 260px;
    --rh-radius: 12px;
    --rh-bg: #F5F6F8;
}

* { box-sizing: border-box; }

body.rh-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--rh-bg);
    color: #1a1a1a;
}

.rh-sidebar {
    width: var(--rh-sidebar-width);
    min-width: var(--rh-sidebar-width);
    flex-shrink: 0;
    transition: width 0.2s ease, min-width 0.2s ease, transform 0.2s ease;
    z-index: 1040;
}

.rh-main-column {
    transition: margin 0.2s ease;
    min-width: 0;
}

.rh-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rh-nav-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

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

/* Collapsed — icon rail */
.rh-sidebar-collapsed .rh-sidebar {
    width: 72px;
    min-width: 72px;
}

.rh-sidebar-collapsed .rh-sidebar-label,
.rh-sidebar-collapsed .rh-sidebar-section,
.rh-sidebar-collapsed .rh-sidebar-brand-text,
.rh-sidebar-collapsed .rh-sidebar-help {
    display: none !important;
}

.rh-sidebar-collapsed .rh-sidebar-brand {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.rh-sidebar-collapsed .rh-nav-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.rh-sidebar-collapsed .rh-nav-link .rh-nav-icon {
    margin: 0 !important;
}

/* Prominent header menu toggle */
.rh-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.4rem 0.85rem;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1a;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rh-sidebar-toggle:hover,
.rh-sidebar-toggle:focus-visible {
    border-color: var(--rh-primary);
    color: var(--rh-primary);
    box-shadow: 0 0 0 3px rgba(var(--rh-primary-rgb), 0.15);
    outline: none;
}

.rh-sidebar-toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Edge collapse control on sidebar (desktop) */
.rh-sidebar-edge-toggle {
    position: absolute;
    top: 1.35rem;
    right: -13px;
    width: 26px;
    height: 26px;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    background: #fff;
    color: #444;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1050;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.12);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.2s ease;
}

.rh-sidebar-edge-toggle:hover,
.rh-sidebar-edge-toggle:focus-visible {
    border-color: var(--rh-primary);
    color: var(--rh-primary);
    outline: none;
}

.rh-sidebar-collapsed .rh-sidebar-edge-toggle {
    right: -13px;
}

.rh-sidebar-collapsed .rh-sidebar-edge-toggle i {
    transform: rotate(180deg);
}

/* Mobile — off-canvas */
@media (max-width: 991.98px) {
    .rh-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
    }

    .rh-sidebar-open .rh-sidebar {
        transform: translateX(0);
    }

    .rh-sidebar-open .rh-sidebar-backdrop {
        display: block;
    }
}

.rh-main {
    background: var(--rh-bg);
}

.rh-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--rh-primary), var(--rh-primary-dark));
}

.rh-nav-link {
    color: #555;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.55rem 0.85rem;
}

.rh-nav-link:hover {
    background: #f0f0f0;
    color: #111;
}

.rh-nav-link.active {
    background: #1a1a1a !important;
    color: #fff !important;
}

.rh-stat-card,
.rh-chart-card,
.card {
    border: none;
    border-radius: var(--rh-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.rh-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.rh-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
}

.rh-icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rh-notify-badge {
    font-size: 0.55rem;
    padding: 0.2em 0.45em;
}

.rh-help-card {
    background: #fafafa;
    border-radius: var(--rh-radius);
}

.rh-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(var(--rh-primary-rgb), 0.1);
    color: var(--rh-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rh-auth-wrapper {
    background: var(--rh-bg);
}

.rh-auth-card {
    border-radius: var(--rh-radius);
}

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

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

.text-primary { color: var(--rh-primary) !important; }
.bg-primary { background-color: var(--rh-primary) !important; }

.form-control:focus {
    border-color: var(--rh-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--rh-primary-rgb), 0.15);
}

.rh-topbar h1 {
    font-size: 1.1rem;
}

.rh-project-tabs .nav-link { color: #666; border: none; }
.rh-project-tabs .nav-link.active { color: #1a1a1a; font-weight: 600; border-bottom: 2px solid var(--rh-primary); background: transparent; }

.rh-notify-menu { max-height: 400px; overflow: hidden; }
.rh-notify-list { max-height: 280px; overflow-y: auto; }
.rh-notify-item:hover { background: #f8f9fa; }

/* Project pipeline (dashboard) */
.rh-pipeline-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef0f3;
}
.rh-pipeline-segment {
    display: block;
    min-width: 4px;
    transition: width 0.3s ease;
}
.rh-pipeline-awaiting_approval,
.rh-pipeline-proposal_sent { background: #f59e0b; }
.rh-pipeline-payment_pending { background: #ef4444; }
.rh-pipeline-in_progress,
.rh-pipeline-review { background: var(--rh-primary); }
.rh-pipeline-approved,
.rh-pipeline-delivered { background: #22c55e; }
.rh-pipeline-draft { background: #94a3b8; }
.rh-pipeline-completed { background: #16a34a; }
.rh-pipeline-cancelled { background: #9ca3af; }
.rh-project-list .list-group-item:last-child { border-bottom: 0 !important; }

/* Document viewer */
.rh-document-viewer { min-height: 480px; }
.rh-document-frame {
    width: 100%;
    min-height: 70vh;
    border: 0;
    display: block;
    background: #f8f9fa;
}
.rh-document-image {
    max-height: 75vh;
    object-fit: contain;
}

.rh-notes-list .rh-note-item:last-child {
    margin-bottom: 0 !important;
}
.rh-note-content {
    white-space: pre-wrap;
    word-break: break-word;
}
