:root{
    --brand-red: #d6244f;
    --brand-gray: #abacae;

    --app-bg:#f6f7fb;
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 78px;
    --sidebar-bg:#0b1220;
    --sidebar-text:#cbd5e1;
    --sidebar-text-muted:#94a3b8;
    --sidebar-active:#ffffff;
    --content-bg:#ffffff;
    --card-radius: 16px;
}

body { background: var(--app-bg); }

/* Links */
a { color: var(--brand-red); }
a:hover { color: var(--brand-red); opacity: .9; }

/* Primary buttons */
.btn-primary{
    --bs-btn-bg: var(--brand-red);
    --bs-btn-border-color: var(--brand-red);
    --bs-btn-hover-bg: #bf1f45;
    --bs-btn-hover-border-color: #bf1f45;
    --bs-btn-active-bg: #a71b3c;
    --bs-btn-active-border-color: #a71b3c;
    --bs-btn-focus-shadow-rgb: 214, 36, 79;
}

/* Outline primary */
.btn-outline-primary{
    --bs-btn-color: var(--brand-red);
    --bs-btn-border-color: var(--brand-red);
    --bs-btn-hover-bg: var(--brand-red);
    --bs-btn-hover-border-color: var(--brand-red);
    --bs-btn-focus-shadow-rgb: 214, 36, 79;
    --bs-btn-active-bg: #bf1f45;
    --bs-btn-active-border-color: #bf1f45;
}

/* Inputs focus ring */
.form-control:focus, .form-select:focus{
    border-color: rgba(214, 36, 79, .45);
    box-shadow: 0 0 0 .25rem rgba(214, 36, 79, .15);
}

/* Sidebar: active item uses brand red */
.nav-item-link.active{
    background: rgba(214, 36, 79, .18);
    color: #fff;
}

/* Sidebar hover subtle red tint */
.nav-item-link:hover{
    background: rgba(214, 36, 79, .12);
    color: #fff;
}

/* Muted text helper using your gray */
.text-brand-gray{ color: var(--brand-gray) !important; }

.app-shell { min-height: 100vh; display: flex; }

.app-sidebar{
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: sticky;
    top: 0;
    height: 100vh;
    display:flex;
    flex-direction:column;
    border-right: 1px solid rgba(255,255,255,.06);
    transition: width .2s ease;
}
.app-sidebar.collapsed {
    min-width: var(--sidebar-w-collapsed);
    width: var(--sidebar-w-collapsed);
}

.sidebar-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 16px 16px;
    min-height: 64px;
    gap: 10px;
}

.brand{
    display:flex; align-items:center; gap: 10px;
    white-space:nowrap; overflow:hidden;
}
.brand .logo-box{
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    display:flex; align-items:center; justify-content:center;
    overflow:hidden;
    flex: 0 0 auto;
}
.brand .logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand .brand-text{
    font-weight: 700;
    letter-spacing: .2px;
    color: #fff;
    transition: opacity .15s ease;
}
.app-sidebar.collapsed .brand .brand-text { opacity: 0; width: 0; overflow:hidden; }

.sidebar-toggle{
    color: var(--sidebar-text);
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    width: 36px; height: 36px;
    border-radius: 10px;
    display:flex; align-items:center; justify-content:center;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.10); color: #fff; }

.sidebar-nav{
    padding: 8px;
    display:flex;
    flex-direction:column;
    gap: 4px;
    flex: 1 1 auto;
    overflow:auto;
}

.nav-item-link{
    display:flex;
    align-items:center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration:none;
    color: var(--sidebar-text);
    transition: background .12s ease, color .12s ease;
    white-space:nowrap;
    overflow:hidden;
}
.nav-item-link:hover { background: rgba(255,255,255,.08); color: #fff; }

.nav-item-link .icon{
    width: 28px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 18px;
    flex: 0 0 auto;
}
.nav-item-link .label{ transition: opacity .15s ease; }
.app-sidebar.collapsed .nav-item-link .label{ opacity: 0; width: 0; overflow:hidden; }

.nav-item-link.active{
    background: rgba(255,255,255,.12);
    color: var(--sidebar-active);
}

.sidebar-footer{
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.user-chip{
    display:flex; align-items:center; gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    color: #fff;
    overflow:hidden;
    white-space:nowrap;
}
.user-chip .avatar{
    width: 34px; height: 34px;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    display:flex; align-items:center; justify-content:center;
    flex: 0 0 auto;
}
.user-chip .meta{ display:flex; flex-direction:column; line-height: 1.1; }
.user-chip .meta small{ color: var(--sidebar-text-muted); }
.app-sidebar.collapsed .user-chip .meta{ display:none; }

.app-content{
    flex: 1 1 auto;
    padding: 24px;
    min-width: 0;
}

.page-card{
    background: var(--content-bg);
    border-radius: var(--card-radius);
    border: 1px solid rgba(15,23,42,.06);
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

.auth-shell{
    min-height: 100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 24px;
}

.auth-card{
    width: 100%;
    max-width: 460px;
    border-radius: var(--card-radius);
    border: 0;
    box-shadow: 0 16px 50px rgba(15, 23, 42, .12);

    position: relative;
    overflow: hidden;
}

.auth-card::before{
    content:"";
    position:absolute;
    left:0; top:0; bottom:0;
    width: 6px;
    background: var(--brand-red);
}

.auth-logo{
    width: 56px; height: 56px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    overflow:hidden;
    display:flex; align-items:center; justify-content:center;
}
.auth-logo img{ width:100%; height:100%; object-fit:contain; padding:8px; }

.app-content .page-card{
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}