:root {
    --btb-primary: #FD5803;
    --btb-primary-hover: #E04C00;
    --btb-primary-dark: #BD4202;
    --btb-primary-soft: #FFF3EC;
    --btb-primary-rgb: 253, 88, 3;

    --btb-sidebar-bg: #111318;
    --btb-sidebar-bg-2: #181B22;
    --btb-sidebar-hover: #21252F;
    --btb-sidebar-active: #FD5803;

    --btb-canvas: #F5F6F8;
    --btb-border: #E5E7EB;
    --btb-text: #111318;
    --btb-muted: #64748B;
    --btb-sidebar-width: 268px;
    --btb-topbar-height: 66px;

    /* Bootstrap 5 Primary Theme Overrides */
    --bs-primary: #FD5803;
    --bs-primary-rgb: 253, 88, 3;
    --bs-primary-text-emphasis: #9A3400;
    --bs-primary-bg-subtle: #FFF1E8;
    --bs-primary-border-subtle: #FFC9AD;
    --bs-link-color: #FD5803;
    --bs-link-color-rgb: 253, 88, 3;
    --bs-link-hover-color: #BD4202;
    --bs-link-hover-color-rgb: 189, 66, 2;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--btb-canvas);
    color: var(--btb-text);
    font-size: 0.925rem;
    overflow-x: hidden;
}

/* Bootstrap Component Brand Overrides */
.btn-primary {
    --bs-btn-bg: #FD5803;
    --bs-btn-border-color: #FD5803;
    --bs-btn-hover-bg: #E04C00;
    --bs-btn-hover-border-color: #D44700;
    --bs-btn-active-bg: #BD4202;
    --bs-btn-active-border-color: #B03D02;
    --bs-btn-disabled-bg: #FD5803;
    --bs-btn-disabled-border-color: #FD5803;
    --bs-btn-focus-shadow-rgb: 253, 88, 3;
}

.btn-outline-primary {
    --bs-btn-color: #FD5803;
    --bs-btn-border-color: #FD5803;
    --bs-btn-hover-bg: #FD5803;
    --bs-btn-hover-border-color: #FD5803;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #BD4202;
    --bs-btn-active-border-color: #BD4202;
    --bs-btn-focus-shadow-rgb: 253, 88, 3;
}

.btn-dark {
    --bs-btn-bg: #181B22;
    --bs-btn-border-color: #181B22;
    --bs-btn-hover-bg: #262B36;
    --bs-btn-hover-border-color: #262B36;
}

.form-control:focus,
.form-select:focus {
    border-color: #FFA685;
    box-shadow: 0 0 0 0.22rem rgba(253, 88, 3, 0.18);
}

.form-check-input:checked {
    background-color: #FD5803;
    border-color: #FD5803;
}

.form-check-input:focus {
    border-color: #FFA685;
    box-shadow: 0 0 0 0.2rem rgba(253, 88, 3, 0.2);
}

.page-item.active .page-link {
    background-color: #FD5803;
    border-color: #FD5803;
}

.page-link {
    color: #FD5803;
}

.page-link:hover {
    color: #BD4202;
}

.dropdown-item:active {
    background-color: #FD5803;
}

.table-primary {
    --bs-table-bg: #FFF3EC;
    --bs-table-border-color: #FFD6C0;
}

/* Sidebar */
.btb-wrapper {
    display: flex;
    min-height: 100vh;
}

.btb-sidebar {
    width: var(--btb-sidebar-width);
    background: linear-gradient(180deg, var(--btb-sidebar-bg) 0%, var(--btb-sidebar-bg-2) 100%);
    color: #D1D5DB;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.btb-brand {
    padding: 0.9rem 1.15rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-decoration: none;
    color: #fff;
    position: relative;
    background: rgba(0, 0, 0, 0.22);
}

.btb-brand::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #FD5803 0%, #FF774B 48%, rgba(255, 255, 255, 0.45) 78%, rgba(148, 163, 184, 0.1) 100%);
}

.btb-brand-logo {
    max-width: 196px;
    height: auto;
    max-height: 46px;
    object-fit: contain;
    display: block;
}

.btb-brand-sub {
    font-size: 0.67rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    padding-left: 2px;
}

.btb-brand-sub span {
    color: #FD5803;
}

.btb-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.75rem 1.5rem;
}

.btb-nav-scroll::-webkit-scrollbar {
    width: 5px;
}

.btb-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(253, 88, 3, 0.3);
    border-radius: 10px;
}

.btb-nav-section {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6B7280;
    font-weight: 700;
    padding: 0.85rem 0.75rem 0.35rem;
}

.btb-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: #D1D5DB;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.btb-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.92rem;
    color: #9CA3AF;
    transition: color 0.15s ease;
}

.btb-nav-link:hover {
    background-color: var(--btb-sidebar-hover);
    color: #fff;
}

.btb-nav-link:hover i {
    color: #FD5803;
}

.btb-nav-link.active {
    background: linear-gradient(90deg, #FD5803 0%, #FF6B24 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(253, 88, 3, 0.38);
}

.btb-nav-link.active i {
    color: #fff;
}

/* Main Content */
.btb-main {
    margin-left: var(--btb-sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.btb-topbar {
    height: var(--btb-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--btb-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    gap: 1rem;
}

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

/* Cards & Stats */
.card {
    border: 1px solid var(--btb-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(17, 19, 24, 0.04);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--btb-border);
    padding: 0.95rem 1.25rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.btb-stat-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btb-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(17, 19, 24, 0.07);
    border-color: #FFD2BA;
}

.btb-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.btb-progress-ring {
    height: 10px;
    border-radius: 99px;
    background-color: #E5E7EB;
    overflow: hidden;
}

/* Tables */
.table > :not(caption) > * > * {
    padding: 0.72rem 0.85rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #4B5563;
    background-color: #F9FAFB;
    border-bottom: 1px solid var(--btb-border);
}

/* Auth Page */
.btb-auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 18%, rgba(253, 88, 3, 0.24) 0%, transparent 45%),
        radial-gradient(circle at 85% 82%, rgba(255, 81, 27, 0.14) 0%, transparent 45%),
        linear-gradient(145deg, #0D0F13 0%, #161921 55%, #090A0D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.btb-auth-card {
    width: 100%;
    max-width: 448px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 55px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btb-auth-header {
    background: linear-gradient(135deg, #111318 0%, #1D212B 100%);
    padding: 1.65rem 1.5rem 1.35rem;
    text-align: center;
    position: relative;
}

.btb-auth-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #FD5803 0%, #FF774B 55%, rgba(255, 255, 255, 0.7) 85%, rgba(148, 163, 184, 0.2) 100%);
}

.btb-auth-logo {
    max-width: 230px;
    height: auto;
    margin: 0 auto 0.45rem;
    display: block;
}

/* Timeline / Task Slot Card */
.btb-task-card {
    border-left: 4px solid #FD5803;
    transition: box-shadow 0.15s ease;
}

.btb-task-card.status-completed { border-left-color: #10B981; }
.btb-task-card.status-in_progress { border-left-color: #FD5803; }
.btb-task-card.status-on_hold { border-left-color: #F59E0B; }
.btb-task-card.status-not_started { border-left-color: #64748B; }

.btb-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFD2BA;
}

.btb-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 19, 24, 0.6);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .btb-sidebar {
        transform: translateX(-100%);
    }
    .btb-sidebar.open {
        transform: translateX(0);
    }
    .btb-sidebar-backdrop.open {
        display: block;
    }
    .btb-main {
        margin-left: 0;
    }
    .btb-content {
        padding: 1rem;
    }
}
