﻿* =========================
   Base + Global
   ========================= */
body {
    font-family: "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 0.9375rem; /* ~15px, slightly compact */
}

.card {
    border-radius: 0.75rem;
}

.navbar-brand {
    letter-spacing: .2px;
}

.table {
    font-size: .95rem;
}

    .table td, .table th {
        vertical-align: middle;
    }

.btn {
    border-radius: .5rem;
}

/* Page background */
.sb-body {
    background: #f3f5f7;
}

/* =========================
   Top header (light theme)
   ========================= */
#sb-topbar {
    height: 56px;
    background: #ffffff !important;
    color: #0f172a !important;
    position: sticky;
    top: 0;
    z-index: 1040;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

    #sb-topbar .sb-logo {
        height: 28px;
    }

    #sb-topbar .sb-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #00d26a;
        display: inline-block;
    }

    #sb-topbar .sb-topbar-brand {
        color: #0f172a !important;
    }

        #sb-topbar .sb-topbar-brand:hover {
            color: #0b1220 !important;
        }

    #sb-topbar i.bi {
        color: #0f172a;
    }

/* =========================
   Two-column shell + Sidebar (light)
   ========================= */
.sb-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 56px);
}

#sb-sidebar {
    background: #eef2f7 !important; /* light slate */
    color: #334155 !important;
    padding: 12px 0;
    border-right: 1px solid #dde3ea;
}

    #sb-sidebar a {
        color: #334155 !important;
        text-decoration: none;
        display: block;
        padding: 10px 18px;
        border-radius: 8px;
    }

    #sb-sidebar .active > a {
        background: #cfe1ff !important;
        color: #0f172a !important;
        box-shadow: inset 2px 0 0 #1d4ed8;
    }

    #sb-sidebar a:hover {
        background: #e3e9f0 !important;
        color: #0f172a !important;
    }

/* Nested menu */
.sb-menu .has-sub > a::after {
    content: "▾";
    float: right;
    opacity: .6;
}

.sb-menu .has-sub ul {
    display: none;
    padding-left: .25rem;
    margin: .25rem 0 .5rem 0;
}

.sb-menu .has-sub.open ul,
.sb-menu .has-sub.active ul {
    display: block;
}

.sb-menu .has-sub ul a {
    padding-left: 40px;
    font-size: .95rem;
    opacity: .9;
}

/* Collapsed sidebar */
.sb-collapsed .sb-wrapper {
    grid-template-columns: 64px 1fr;
}

.sb-collapsed #sb-sidebar a {
    text-align: center;
}

.sb-collapsed #sb-sidebar .has-sub ul {
    display: none !important;
}

.sb-collapsed #sb-sidebar i {
    margin-right: 0 !important;
}

/* Content area */
#sb-content {
    background: transparent;
}

.sb-breadcrumb {
    color: #475569;
    font-size: .95rem;
}

    .sb-breadcrumb a {
        color: #334155;
        text-decoration: none;
    }

        .sb-breadcrumb a:hover {
            text-decoration: underline;
        }

/* =========================
   Role access table bits
   ========================= */
.form-switch .form-check-input {
    cursor: pointer;
}

.badge-na {
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    padding: .35rem .55rem;
    border-radius: .375rem;
}

/* Bullets for submenu items (Organization > sub-links) */
.sb-sub li {
    position: relative;
    padding-left: 1.25rem;
}

    .sb-sub li::before {
        content: "•";
        position: absolute;
        left: .25rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.1rem;
        line-height: 1;
        color: #6c757d;
    }

    .sb-sub li a {
        display: inline-block;
        padding: .4rem 0;
        color: inherit;
        text-decoration: none;
    }

        .sb-sub li a:hover {
            color: #0d6efd;
        }

/* =========================
   Auth (login) styles
   ========================= */

.auth-body {
    background: #f8fafc; /* switch to #fff if you want pure white */
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

.auth-panel {
    /* gentle entrance */
    animation: authFloat .35s ease-out both;
    backdrop-filter: saturate(1.05);
}

@keyframes authFloat {
    from {
        transform: translateY(6px);
        opacity: .0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========= Brand ========== */
/* ===== Smart Care Survey — Option C (Right-aligned, larger, gradient on both words) ===== */
:root {
    --ink: #0f172a;
    --muted: #6b7280;
    --g1: #c026d3;
    --g2: #6366f1;
}

.scs.brand-c {
    user-select: none;
    margin-bottom: 1rem;
}

.brand-c--right {
    text-align: right;
    padding: .25rem .25rem 0;
}

/* Title row */
.c-row {
    display: flex;
    justify-content: flex-end; /* push words to the right */
    gap: .35rem;
    line-height: 1;
}

/* Make BOTH Smart & Care use the gradient “Care” style */
.c-word {
    font-weight: 900;
    font-size: 30px;
    letter-spacing: .1px;
    background: linear-gradient(90deg, var(--g1), var(--g2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Right-aligned gradient underline */
.c-underline {
    height: 4px; /* a touch thicker */
    width: 110px; /* a bit wider */
    border-radius: 2px;
    background: linear-gradient(90deg, var(--g1), var(--g2));
    margin: .45rem 2px .25rem auto; /* auto left margin ⇒ sticks to right */
}

/* Larger “Survey” */
.c-sub {
    color: var(--muted);
    font-weight: 600;
    font-size: 20px; /* a little bigger */
    letter-spacing: .2px;
}

/* Responsive tweaks */
@media (max-width: 575.98px) {
    .c-word {
        font-size: 30px;
    }

    .c-underline {
        width: 96px;
    }

    .c-sub {
        font-size: 18px;
    }
}


/* ========= Form controls ========= */
.auth-form .form-label {
    margin-left: 2px;
}

.auth-input {
    height: 48px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: .98rem;
    transition: box-shadow .15s, border-color .15s;
}

    .auth-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 .2rem rgba(96,165,250,.18);
    }

.auth-btn {
    height: 44px;
    border-radius: 10px;
    padding-inline: 1.1rem;
    font-weight: 700;
}

/* compact checkbox alignment */
.auth-form .form-check {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.auth-form .form-check-input {
    margin-left: 0 !important;
    float: none;
    width: 1.1rem;
    height: 1.1rem;
}

.auth-form .form-check-label {
    margin-left: .25rem;
}

/* ========= Responsive ========= */
@media (max-width: 575.98px) {
    .brand-smart {
        font-size: 32px;
    }

    .brand-care {
        font-size: 20px;
    }

    .brand-sub {
        font-size: 16px;
    }
}

/* ==== Fade placeholders (Email / Password) ==== */
.auth-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}
/* modern browsers */
.auth-input::-webkit-input-placeholder {
    color: #9ca3af;
}
/* Chrome/Safari */
.auth-input::-moz-placeholder {
    color: #9ca3af;
}
/* Firefox */
.auth-input:-ms-input-placeholder {
    color: #9ca3af;
}
/* IE/Edge legacy */
.auth-input:-moz-placeholder {
    color: #9ca3af;
}

/* ==== Fade the field labels "E-mail" / "Password" ==== */
.auth-form .form-label {
    color: #6b7280; /* slate-500 */
    font-weight: 600;
}

/* Keep typed text readable */
.auth-input {
    color: #0f172a;
}
/* slate-900 */

/* ==== Footer: smaller & more faded ==== */
.auth-panel footer {
    font-size: .8rem;
    color: #94a3b8 !important; /* slate-400 */
    letter-spacing: .2px;
}

/* =========================
   DataTables: unified light header + compact controls
   ========================= */
/* Light header variables shared app-wide */
:root {
    --dt-head-bg: #eaf2ff; /* light primary */
    --dt-head-bc: #d6e6ff;
    --dt-head-fg: #1f2a44;
}

/* Header look for all DataTables */
table.dataTable thead th {
    background: var(--dt-head-bg);
    color: var(--dt-head-fg);
    border-color: var(--dt-head-bc) !important;
    vertical-align: middle;
}

/* Row hover + selection */
table.dataTable.table-hover > tbody > tr:hover > * {
    background-color: #f1f6ff !important;
}

table.dataTable tbody tr.selected > * {
    background-color: #e7f1ff !important;
}

/* Place “Show entries”, export, and search on one compact row.
   (The rest is driven by the DataTables `dom` option in JS.) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dt-buttons {
    display: inline-block;
    margin-right: .5rem;
}

.dataTables_wrapper .dataTables_filter {
    display: inline-block;
    float: right;
}

    .dataTables_wrapper .dataTables_filter input {
        width: 220px;
        max-width: 100%;
    }

.dataTables_length select {
    display: inline-block;
    width: auto;
}

/* Export buttons (keep a single bulletproof block) */
.dt-buttons .btn,
.dt-buttons .dt-button {
    background: #fff !important;
    color: #212529 !important;
    border-color: #ced4da !important;
    border-radius: .5rem;
    padding: .25rem .6rem;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease, border-color .12s ease;
}

    .dt-buttons .btn:hover,
    .dt-buttons .dt-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 .25rem .6rem rgba(0,0,0,.08);
    }

/* Excel */
.dt-buttons .buttons-excel.btn,
.dt-buttons .buttons-excel.dt-button {
    border-color: #198754 !important;
    color: #198754 !important;
}

    .dt-buttons .buttons-excel.btn:hover,
    .dt-buttons .buttons-excel.dt-button:hover,
    .dt-buttons .btn.buttons-excel:hover {
        background: #198754 !important;
        color: #fff !important;
        border-color: #198754 !important;
        box-shadow: 0 0 0 .25rem rgba(25,135,84,.2) !important;
    }

/* PDF */
.dt-buttons .buttons-pdf.btn,
.dt-buttons .buttons-pdf.dt-button {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

    .dt-buttons .buttons-pdf.btn:hover,
    .dt-buttons .buttons-pdf.dt-button:hover,
    .dt-buttons .btn.buttons-pdf:hover {
        background: #dc3545 !important;
        color: #fff !important;
        border-color: #dc3545 !important;
        box-shadow: 0 0 0 .25rem rgba(220,53,69,.2) !important;
    }

/* Print */
.dt-buttons .buttons-print.btn,
.dt-buttons .buttons-print.dt-button {
    border-color: #6c757d !important;
    color: #6c757d !important;
}

    .dt-buttons .buttons-print.btn:hover,
    .dt-buttons .buttons-print.dt-button:hover,
    .dt-buttons .btn.buttons-print:hover {
        background: #6c757d !important;
        color: #fff !important;
        border-color: #6c757d !important;
        box-shadow: 0 0 0 .25rem rgba(108,117,125,.2) !important;
    }

/* Small icon button helper (e.g., clipboard) */
.btn-icon {
    padding: .25rem .4rem;
    border-radius: .5rem;
}

    .btn-icon:hover {
        background: rgba(0,0,0,.05);
    }


/* =========================
   Responsive tweaks
   ========================= */
@media (max-width: 576px) {
    .logo-smartcare .smart {
        font-size: 26px;
    }

    .logo-smartcare .care-text {
        font-size: 20px;
    }
}

.validation-summary-valid, .field-validation-valid {
    display: none;
}

/* Hard, app-wide page gutter inside the main content area */
#page-shell {
    padding-left: 16px !important;
    padding-right: 16px !important;
}

    /* Stop Bootstrap .row negative margins from eating that gutter */
    #page-shell .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

/* Let the content column shrink inside the grid so inner scroll works */
.sb-wrapper #sb-content {
    min-width: 0; /* CRITICAL for horizontal scroll in children */
    min-height: 0; /* lets inner areas manage their own vertical scroll */
}

/* Extra safety for tab containers (Bootstrap sometimes sets overflow hidden) */
.tab-content, .tab-pane {
    min-width: 0;
    min-height: 0;
}

/* The scrollbox around the User-wise table */
.user-table-wrapper,
#userTableBox {
    max-width: 100%;
    overflow: auto; /* both X & Y */
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
    padding-right: 12px; /* small gap so last column isn’t glued */
}

/* Make the table wider than its box when needed so a horizontal bar appears */
.table-report-users {
    width: max-content !important;
    min-width: 100%;
}

    /* Keep those long headers compact */
    .table-report-users .th-inner {
        height: 70px;
        overflow: hidden;
    }

    .table-report-users .th-main {
        font-size: .75rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
    }

/* Optional: shrink columns a bit on laptop widths */
@media (max-width: 1440px) {
    .table-report-users .col-param,
    .table-report-users .col-qhead {
        width: 180px;
    }

    .table-report-users thead th,
    .table-report-users tbody td {
        padding: .3rem .45rem;
    }
}

/* Make sure the report container itself can shrink */
.report-shell {
    min-width: 0;
}

/* In case any flex wrappers are added around the table later */
.user-table-wrapper {
    min-width: 0;
}

/* ===== Mobile sidebar behavior ===== */
@media (max-width: 768px) {
    /* Main shell becomes single column */
    .sb-wrapper {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 56px);
    }

    /* Sidebar becomes an off-canvas drawer */
    #sb-sidebar {
        position: fixed;
        top: 56px; /* just below #sb-topbar */
        left: 0;
        width: 260px;
        height: calc(100vh - 56px);
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .2s ease-in-out;
        box-shadow: 0 0 20px rgba(15, 23, 42, 0.25);
        overflow-y: auto;
    }

    /* When body has this class, show the sidebar */
    body.sb-sidebar-open #sb-sidebar {
        transform: translateX(0);
    }

    /* Content should span full width */
    #sb-content {
        grid-column: 1 / -1;
    }
}



