/* Sidebar brand: dark bar with circular logo + text */
.tfsl-sidebar-brand {
    padding: 0.9rem 1.25rem;
    background: #252b33;          /* dark like JUI */
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.tfsl-brand-logo img {
    width: 44px;
    height: 44px;
    border-radius: 50%;           /* makes the logo a circle */
    object-fit: contain;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.tfsl-brand-title {
    margin-left: 0.6rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffff;
}

/* User panel below the brand: teal bar with avatar + Welcome + ID */
.tfsl-sidebar-user {
    padding: 0.85rem 1.25rem;
    background: #008973;          /* teal similar to the example */
    display: flex;
    align-items: center;
    color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.tfsl-user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;           /* round user photo */
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.7);
    margin-right: 0.75rem;
}

.tfsl-user-text {
    line-height: 1.1;
}

.tfsl-user-welcome {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
}

.tfsl-user-name {
    font-size: 0.9rem;
    font-weight: 600;
}
html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: var(--tfsl-topbar-bg);
}

/* Colors similar to the portal theme */
:root {
    --tfsl-sidebar-bg: #004d40;
    --tfsl-sidebar-accent: #00b894;
    --tfsl-topbar-bg: #263238;
    --tfsl-content-bg: #f5f7fb;
    --tfsl-primary-btn: #0056b3;
}

.tfsl-wrapper {
    min-height: 100vh;
    background: var(--tfsl-content-bg);
    display: flex;
}

/* SIDEBAR */
.tfsl-sidebar {
    width: 230px;
    background: var(--tfsl-sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, width 0.2s ease;
}

.tfsl-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.tfsl-org-name {
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #e0f2f1;
}

.tfsl-menu {
    padding: 0.75rem 0;
    flex-grow: 1;
}

.tfsl-menu-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #a7ffeb;
    padding: 0.75rem 1.25rem 0.25rem;
    opacity: 0.8;
}

.tfsl-menu li a {
    display: flex;
    align-items: center;
    padding: 0.50rem 1.10rem;
    font-size: 0.85rem;
    color: #e0f2f1;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tfsl-menu-text {
    white-space: nowrap;
}

.tfsl-menu > li > a .tfsl-menu-text {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.tfsl-submenu .tfsl-menu-text {
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.tfsl-menu li a i {
    margin-right: 0.5rem;
}

.tfsl-menu li a:hover,
.tfsl-menu li.active > a {
    background: rgba(0, 0, 0, 0.15);
    border-left: 3px solid var(--tfsl-sidebar-accent);
    color: #ffffff;
}

.tfsl-menu-dropdown.open > a {
    background: rgba(0, 0, 0, 0.15);
    border-left: 3px solid var(--tfsl-sidebar-accent);
}

/* TOP BAR */
.tfsl-topbar {
    height: 56px;
    background: var(--tfsl-topbar-bg);
    color: #fff;
}

@media (max-width: 991px) {
    .tfsl-wrapper {
        flex-direction: column;
    }
    .tfsl-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1040;
    }
    .tfsl-sidebar.is-open {
        transform: translateX(0);
    }
    .tfsl-sidebar.collapsed {
        width: 230px;
    }
    .tfsl-sidebar.collapsed .tfsl-menu-text,
    .tfsl-sidebar.collapsed .tfsl-menu-title,
    .tfsl-sidebar.collapsed .tfsl-brand-title,
    .tfsl-sidebar.collapsed .tfsl-user-text {
        display: inline;
    }
    .tfsl-sidebar.collapsed .tfsl-menu li a {
        justify-content: flex-start;
        padding: 0.55rem 1.1rem;
    }
    .tfsl-sidebar.collapsed .tfsl-menu li a i {
        margin-right: 0.5rem;
    }
    .tfsl-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        flex-wrap: wrap;
        height: auto;
        gap: 0.5rem;
    }
    .tfsl-topbar-title {
        display: none;
    }
    .tfsl-content {
        padding: 1rem !important;
    }
    .tfsl-topbar > .d-flex {
        flex: 1 1 100%;
        justify-content: space-between;
    }
    .tfsl-topbar .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}

.tfsl-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1035;
}

.tfsl-mobile-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.tfsl-topbar-title {
    font-weight: 500;
    font-size: 1rem;
}

/* CONTENT + FOOTER */
.tfsl-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.tfsl-content {
    flex: 1 0 auto;
}

.tfsl-footer {
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* LOGIN PAGE */
.tfsl-login-body {
    background: #f0f2f5;
}

.tfsl-login-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    max-width: 820px;
    width: 100%;
}

.tfsl-login-left {
    background: #004d40;
    color: #fff;
    width: 40%;
    min-height: 340px;
}

.tfsl-login-right {
    width: 60%;
    background: #ffffff;
}

.tfsl-login-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.tfsl-btn-primary {
    background: var(--tfsl-primary-btn);
    border-color: var(--tfsl-primary-btn);
}

.tfsl-btn-primary:hover {
    filter: brightness(0.9);
}

/* Collapsible sidebar */
.tfsl-sidebar {
    width: 230px;
    background: var(--tfsl-sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
}


/* COLLAPSED SIDEBAR - icon-only like FP portal */
.tfsl-sidebar.collapsed {
    width: 70px;
}

/* brand + user strip when collapsed */
.tfsl-sidebar.collapsed .tfsl-sidebar-brand {
    justify-content: center;
    padding: 1rem 0.75rem;
}

.tfsl-sidebar.collapsed .tfsl-sidebar-user {
    display: none;
}

.tfsl-sidebar.collapsed .tfsl-user-text {
    display: none;
}

/* hide all text and section titles */
.tfsl-sidebar.collapsed .tfsl-org-name,
.tfsl-sidebar.collapsed .tfsl-menu-text,
.tfsl-sidebar.collapsed .tfsl-menu-title,
.tfsl-sidebar.collapsed .tfsl-brand-title {
    display: none;
}

/* hide the dropdown arrows when collapsed */
.tfsl-sidebar.collapsed .tfsl-menu-caret {
    display: none;
}

/* smaller logo when collapsed */
.tfsl-sidebar.collapsed .tfsl-logo {
    width: 40px;
    height: 40px;
}

/* menu links: center the icon in the narrow bar */
.tfsl-sidebar.collapsed .tfsl-menu li a {
    justify-content: center;
    padding: 0.7rem 0;
    border-left: 0;
}

/* icon centred (no right margin) */
.tfsl-sidebar.collapsed .tfsl-menu li a i {
    margin-right: 0;
}

.tfsl-sidebar.collapsed .tfsl-menu li a:hover,
.tfsl-sidebar.collapsed .tfsl-menu li.active > a {
    background: rgba(255, 255, 255, 0.12);
}

/* keep all submenus hidden when collapsed */
.tfsl-sidebar.collapsed .tfsl-submenu {
    display: none !important;
}

/* Dropdown menus inside sidebar */
.tfsl-menu-dropdown > a {
    display: flex;
    align-items: center;
}

.tfsl-menu-caret {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform 0.15s ease;
}

.tfsl-menu-dropdown.open > a .tfsl-menu-caret {
    transform: rotate(180deg);
}

/* Top-level groups bold + uppercase */
.tfsl-menu-dropdown > a .tfsl-menu-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Submenu with vertical guide line */
.tfsl-submenu {
    display: none;
    margin-left: 1rem;
    padding-left: 0.6rem;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    position: relative;
}

.tfsl-menu-dropdown.open > .tfsl-submenu {
    display: block;
}

.tfsl-submenu li {
    position: relative;
}

.tfsl-submenu li::before {
    content: "";
    position: absolute;
    left: -0.6rem;
    top: 50%;
    width: 12px;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%);
}

.tfsl-submenu li a {
    font-size: 0.8rem;
    padding: 0.30rem 0.75rem;
    color: #e5e7eb;
    gap: 0.4rem;
}

/* Submenu text normal weight */
.tfsl-submenu li a .tfsl-menu-text {
    font-weight: 400;
    text-transform: none;
}

/* Portal cards */
.tfsl-card {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.tfsl-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tfsl-dashboard-chart {
    width: 100% !important;
    max-height: 220px;
}

.tfsl-card-header h6 {
    font-weight: 600;
}

.tfsl-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--tfsl-sidebar-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
}

.tfsl-people-card {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    height: 100%;
}

.tfsl-people-card--stacked {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.tfsl-people-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--tfsl-sidebar-accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.tfsl-people-avatar--large {
    width: 64px;
    height: 64px;
    font-size: 1.1rem;
}

.tfsl-people-photo {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* Filter/search bar above tables */
.tfsl-filter-bar {
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
}

/* Data tables */
.tfsl-table thead th {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4b5563;
}

.tfsl-table tbody tr:hover {
    background: #f1f5f9;
}

.tfsl-pill-tabs {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tfsl-pill-tabs .nav-link {
    white-space: nowrap;
}

.tfsl-action-cell .btn {
    white-space: nowrap;
}

@media (max-width: 767px) {
    .tfsl-pill-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }
    .tfsl-pill-tabs::-webkit-scrollbar {
        height: 6px;
    }
    .tfsl-pill-tabs::-webkit-scrollbar-thumb {
        background: rgba(15, 23, 42, 0.25);
        border-radius: 999px;
    }
    .tfsl-action-cell .btn {
        width: 100%;
    }
}

/* Slightly tighter text */
.tfsl-table td {
    font-size: 0.85rem;
}

.tfsl-table-toolbar {
    width: 100%;
}

.tfsl-table-search {
    max-width: 260px;
}

.tfsl-table-length {
    width: 90px;
}

@media (max-width: 991px) {
    .tfsl-table,
    .tfsl-data-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575px) {
    .tfsl-content {
        padding: 0.75rem !important;
    }
    .tfsl-topbar .small {
        display: none;
    }
    .tfsl-topbar .btn,
    .tfsl-topbar .dropdown {
        width: 100%;
    }
    .tfsl-topbar > .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .tfsl-card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .tfsl-card-header.d-flex .btn {
        width: 100%;
    }
    .tfsl-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .tfsl-table-toolbar .btn {
        width: 100%;
    }
    .tfsl-table-search,
    .tfsl-table-length {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 575px) {
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100% - 1rem);
    }
}

/* Small button improvements */
.btn-sm {
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.25rem 0.7rem;
}

.btn-primary {
    background-color: var(--tfsl-primary-btn);
    border-color: var(--tfsl-primary-btn);
}

.btn-primary:hover {
    filter: brightness(0.95);
}

/* Icon-only action buttons in table */
.tfsl-table .btn-sm i {
    margin-right: 0;
}

.tfsl-menu-dropdown.open > .tfsl-submenu {
    display: block;
}

/* Make submenu text a bit smaller */
.tfsl-submenu li a {
    font-size: 0.8rem;
}

/* When sidebar collapsed, always hide submenus */
.tfsl-sidebar.collapsed .tfsl-submenu {
    display: none !important;
}

/* Coming soon placeholder */
.tfsl-coming-soon {
    background: #f9fbfd;
    border: 1px dashed #d0d7de;
    border-radius: 12px;
    padding: 1.75rem;
}

.tfsl-coming-soon img {
    max-width: 520px;
    width: 100%;
    height: auto;
}

/* Data table header style like FP portal */
.tfsl-data-table thead th {
    background: #404854;
    color: #f5f7fb;
    border-color: #555c68;
}

.tfsl-data-table tbody td {
    vertical-align: middle;
}

/* Table grid lines like sample */
.tfsl-data-table thead th,
.tfsl-data-table tbody td {
    border: 1px solid #d1d5db;
}

/* Modal height helpers to ensure long forms can scroll */
.modal-dialog.modal-lg,
.modal-dialog.modal-xl {
    max-width: 1080px;
}

.modal-dialog-scrollable .modal-content,
.modal-content {
    max-height: 90vh;
}

.modal-dialog-scrollable .modal-body {
    max-height: calc(90vh - 130px);
    overflow-y: auto;
}

.modal-body {
    overflow-y: auto;
}

/* Quill editor tweaks */
.ql-toolbar.ql-snow {
    border-radius: 12px 12px 0 0;
    border-color: #e6e9f2;
}

.tfsl-editor-body.ql-container {
    border-radius: 0 0 12px 12px;
    border-color: #e6e9f2;
    min-height: 240px;
}

/* Evidence previews */
.tfsl-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.tfsl-evidence-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
}

.tfsl-evidence-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tfsl-evidence-icon {
    height: 120px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 26px;
}

.tfsl-evidence-meta {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 6px;
    word-break: break-word;
}

.tfsl-editor-body .ql-editor {
    min-height: 220px;
}

.tfsl-menu-order {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tfsl-order-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: grab;
}

.tfsl-order-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
}

.tfsl-order-handle {
    color: #64748b;
}
