/*
 * Ruthusakhi admin — visual polish layer on top of Velzon.
 * Typography, coloured sidebar, readable banners, calmer tables/forms, smooth page transitions.
 */

:root {
    --rs-red: #b00000;
    --rs-red-soft: #fdecec;
    --rs-text: #1f2430;
    --rs-muted: #6b7385;
    --rs-line: #eceef3;
    --rs-radius: 14px;
    --vz-font-family-primary: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --vz-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html {
    scrollbar-gutter: stable;           /* stops the page jumping sideways when a scrollbar appears */
    background: #f5f6fa;
}

body,
.btn,
.form-control,
.form-select,
.table,
.dropdown-menu,
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

body {
    color: var(--rs-text);
    font-size: 0.9rem;
    letter-spacing: 0.005em;
    background: #f5f6fa;
}

h1, .h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }
h2, .h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
h3, .h3 { font-size: 1.15rem; font-weight: 600; }
h4, .h4 { font-size: 1.05rem; font-weight: 600; }
h5, .h5 { font-size: 0.98rem; font-weight: 600; }

/* ------------------------------------------------------------------ page transition */
/* subtle slide-in only (no opacity change, so content never flashes or looks faded) */
.page-content > .container-fluid {
    animation: rs-page-in .22s ease-out;
}

@keyframes rs-page-in {
    from { transform: translateY(5px); }
    to   { transform: none; }
}

/* thin progress bar shown while a page loads (driven by js/ruthusakhi-ui.js) */
#rs-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 2000;
    background: linear-gradient(90deg, #b00000, #ff5a5f);
    box-shadow: 0 0 8px rgba(176, 0, 0, .45);
    transition: width .4s ease, opacity .3s ease;
    opacity: 0;
    pointer-events: none;
}

#rs-progress.run { opacity: 1; width: 78%; }
#rs-progress.done { opacity: 0; width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .page-content > .container-fluid { animation: none; }
    #rs-progress { transition: none; }
}

/* ------------------------------------------------------------------ topbar */
#page-topbar {
    box-shadow: 0 1px 0 var(--rs-line);
}

#page-topbar .navbar-header .fw-semibold {
    font-weight: 600 !important;
    letter-spacing: -0.005em;
}

/* ------------------------------------------------------------------ sidebar */
.app-menu {
    box-shadow: 1px 0 0 var(--rs-line);
}

.app-menu .navbar-brand-box {
    background: linear-gradient(135deg, #b00000 0%, #8c0000 100%);
}

.navbar-menu .navbar-nav .menu-title {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9aa1b2;
    padding: 18px 12px 6px;
    margin: 0;
}

.navbar-menu .navbar-nav .menu-title span {
    color: inherit;
}

.navbar-menu .navbar-nav .nav-link.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 6px;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #3b4152;
    position: relative;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.navbar-menu .navbar-nav .nav-link.menu-link:hover {
    background: #f6f7fb;
    color: var(--rs-text);
    transform: translateX(2px);
}

.navbar-menu .navbar-nav .nav-link.menu-link.active {
    background: var(--rs-red-soft);
    color: var(--rs-red);
    font-weight: 600;
}

.navbar-menu .navbar-nav .nav-link.menu-link.active::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--rs-red);
}

/* coloured icon chips */
.menu-ic {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.menu-ic i {
    font-size: 17px;
    line-height: 1;
    margin: 0;
    color: inherit;
    min-width: 0;
}

.nav-link:hover .menu-ic { transform: scale(1.06); }

.menu-label { white-space: nowrap; }

.ic-red    { background: #fde8e8; color: #e53339; }
.ic-blue   { background: #e6eefd; color: #2f6fed; }
.ic-purple { background: #f0e9fb; color: #8e5ce0; }
.ic-green  { background: #e3f6ec; color: #2fae6e; }
.ic-orange { background: #fdeee0; color: #ef7d2e; }
.ic-teal   { background: #ddf3f5; color: #0e9aa7; }
.ic-pink   { background: #fce6f0; color: #e0478b; }
.ic-amber  { background: #fdf3d6; color: #d99a06; }
.ic-indigo { background: #e8eafb; color: #4f5bd5; }
.ic-slate  { background: #e9edf2; color: #5b6b7f; }

/* active item: chip turns solid */
.nav-link.active .ic-red    { background: #e53339; color: #fff; }
.nav-link.active .ic-blue   { background: #2f6fed; color: #fff; }
.nav-link.active .ic-purple { background: #8e5ce0; color: #fff; }
.nav-link.active .ic-green  { background: #2fae6e; color: #fff; }
.nav-link.active .ic-orange { background: #ef7d2e; color: #fff; }
.nav-link.active .ic-teal   { background: #0e9aa7; color: #fff; }
.nav-link.active .ic-pink   { background: #e0478b; color: #fff; }
.nav-link.active .ic-amber  { background: #d99a06; color: #fff; }
.nav-link.active .ic-indigo { background: #4f5bd5; color: #fff; }
.nav-link.active .ic-slate  { background: #5b6b7f; color: #fff; }

/* collapsed sidebar: the template hides every span inside a link, so re-show the icon chip only */
[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link.menu-link {
    justify-content: center;
    padding: 7px 0;
    margin: 3px 8px;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link.menu-link .menu-ic {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link.menu-link .menu-label { display: none !important; }

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .nav-link.menu-link.active::before { left: -8px; }

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-title {
    padding: 8px 0 2px;
    text-align: center;
}

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-title span { display: none !important; }

[data-sidebar-size="sm"] .navbar-menu .navbar-nav .menu-title::after {
    content: '';
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: #e3e6ee;
}

/* the menu must scroll when it is taller than the screen */
.app-menu #scrollbar {
    height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d9dce5 transparent;
    padding-bottom: 24px;
}

.app-menu #scrollbar::-webkit-scrollbar { width: 6px; }
.app-menu #scrollbar::-webkit-scrollbar-thumb { background: #d9dce5; border-radius: 6px; }
.app-menu #scrollbar::-webkit-scrollbar-thumb:hover { background: #bfc4d1; }

/* ------------------------------------------------------------------ breadcrumbs */
.breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 14px;
}

.breadcrumb-item a { color: var(--rs-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--rs-red); }
.breadcrumb-item.active { color: var(--rs-text); font-weight: 500; }

/* ------------------------------------------------------------------ cards */
.card {
    border: 1px solid var(--rs-line);
    border-radius: var(--rs-radius);
    box-shadow: 0 1px 2px rgba(31, 36, 48, .04), 0 6px 18px rgba(31, 36, 48, .04);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--rs-line);
    padding: 16px 20px;
}

.card-header .card-title { font-size: 1rem; font-weight: 600; }
.card-body { padding: 20px; }

.page-content > .container-fluid > h1,
.page-content > .container-fluid > div > h1 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

/* ------------------------------------------------------------------ dashboard */
.dashboard-banner {
    background: linear-gradient(120deg, #b00000 0%, #d32f2f 100%) !important;
    box-shadow: 0 10px 28px rgba(176, 0, 0, .22);
    position: relative;
    overflow: hidden;
}

.dashboard-banner::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.dashboard-banner h1,
.dashboard-banner p,
.login-brand-title,
.login-brand-text {
    color: #fff !important;
}

.dashboard-banner h1 { font-size: 1.7rem; }

.stat-card { transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31, 36, 48, .1); }

.stat-card .avatar-sm { width: 48px; height: 48px; border-radius: 14px !important; }
.stat-card h4 { font-size: 1.7rem; font-weight: 700; }
.stat-card .text-uppercase { font-size: 0.72rem; letter-spacing: 0.07em; color: var(--rs-muted) !important; }

.col-xl-4:nth-child(1) .stat-card .avatar-title,
.col-xl-4:nth-child(1) .stat-card .avatar-sm { background: #e6eefd !important; color: #2f6fed !important; }
.col-xl-4:nth-child(2) .stat-card .avatar-title,
.col-xl-4:nth-child(2) .stat-card .avatar-sm { background: #e3f6ec !important; color: #2fae6e !important; }
.col-xl-4:nth-child(3) .stat-card .avatar-title,
.col-xl-4:nth-child(3) .stat-card .avatar-sm { background: #fce6f0 !important; color: #e0478b !important; }

/* ------------------------------------------------------------------ tables / grid view */
.table-responsive { border-radius: 10px; }

.table > :not(caption) > * > * { padding: 0.85rem 0.85rem; border-color: var(--rs-line); }

.table thead th,
.grid-view thead th {
    background: #f8f9fc;
    color: var(--rs-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--rs-line);
    white-space: nowrap;
}

.table thead th a { color: inherit !important; text-decoration: none; }
.table thead th a:hover { color: var(--rs-red) !important; }
.table thead th a.asc::after  { content: ' \2191'; }
.table thead th a.desc::after { content: ' \2193'; }

.table-hover > tbody > tr { transition: background-color .15s ease; }
.table-hover > tbody > tr:hover > * { background-color: #fbf6f6; }

.summary { color: var(--rs-muted); font-size: 0.8rem; margin-bottom: 10px; }

.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.4em 0.75em;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

/* action icons in grid rows */
.table td a.text-reset,
.table td a.text-danger {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color .15s ease, color .15s ease;
}

.table td a.text-reset:hover { background: #eef1f6; color: var(--rs-red) !important; }
.table td a.text-danger:hover { background: #fde8e8; }

.pagination { gap: 4px; margin-top: 12px; }
.pagination .page-link { border-radius: 8px !important; border: 1px solid var(--rs-line); color: var(--rs-text); font-size: 0.82rem; }
.pagination .active .page-link { background: var(--rs-red); border-color: var(--rs-red); color: #fff; }

/* ------------------------------------------------------------------ forms / buttons */
.form-label,
.control-label { font-weight: 500; font-size: 0.83rem; color: #3b4152; }

.form-control,
.form-select {
    border: 1px solid #dfe3ec;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    font-size: 0.9rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #d46a6a;
    box-shadow: 0 0 0 4px rgba(176, 0, 0, .09);
}

.form-text, .hint-block { color: var(--rs-muted); font-size: 0.78rem; }

.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 4px 12px rgba(176, 0, 0, .22); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(176, 0, 0, .3); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

.btn-soft-primary { background: #fdecec; color: #b00000; border-color: transparent; }
.btn-soft-primary:hover { background: #b00000; color: #fff; }
.btn-soft-danger { background: #fde8e8; color: #d32f2f; border-color: transparent; }
.btn-soft-danger:hover { background: #d32f2f; color: #fff; }

.alert { border-radius: 12px; border: 0; }

.dropdown-menu { border: 1px solid var(--rs-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(31, 36, 48, .12); }

/* ------------------------------------------------------------------ detail view */
.detail-view th { width: 220px; color: var(--rs-muted); font-weight: 500; }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--rs-line); background: #fff; font-size: 0.8rem; }

/* ------------------------------------------------------------------ login */
.auth-page-wrapper { background: linear-gradient(135deg, #f7e4e4 0%, #efd0d0 100%); }
.auth-page-wrapper .bg-overlay { background: transparent !important; }

.login-split-card { border-radius: 22px !important; box-shadow: 0 24px 60px rgba(120, 0, 0, .22) !important; }

.login-brand-panel {
    background: linear-gradient(145deg, #b00000 0%, #7a0000 100%) !important;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before,
.login-brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}

.login-brand-panel::before { width: 260px; height: 260px; right: -90px; top: -70px; }
.login-brand-panel::after  { width: 180px; height: 180px; left: -60px; bottom: 60px; }

.login-brand-title { font-size: 1.9rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.login-brand-text { font-size: 0.95rem; opacity: .85; line-height: 1.6; }

.login-split-card h1.h3 { font-size: 1.5rem; font-weight: 700; color: var(--rs-text); }
.login-split-card .text-body-secondary { color: var(--rs-muted) !important; }

.login-btn {
    background: linear-gradient(135deg, #c40000, #a00000) !important;
    border: 0 !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px rgba(176, 0, 0, .28);
}

.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(176, 0, 0, .35); }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 767.98px) {
    .page-content { padding-left: 4px; padding-right: 4px; }
    .card-body { padding: 14px; }
    .dashboard-banner h1 { font-size: 1.35rem; }
}
