﻿:root {
    /* Triniteq brand */
    --tq-orange: #E68A48;
    --tq-coral: #DD5B61;
    --tq-grey: #55565B;
    /* Light theme */
    --bg: #F6F7FB; /* page background */
    --surface: #FFFFFF; /* white surfaces */
    --surface-2: #FBFBFD; /* subtle alt */
    --text: #1F2937; /* near-black */
    --muted: #6B7280; /* slate */
    --border: rgba(17, 24, 39, .10);
    --shadow: 0 10px 30px rgba(17, 24, 39, .08);
    --accent: var(--tq-orange);
    --accent-2: var(--tq-coral);
}

html, body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* Links */
a {
    color: var(--text);
}

    a:hover {
        color: #111827;
    }

/* App shell */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

/* Sidebar */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px;
}

/* NEW: allow footer to stick to bottom */
.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 14px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 25px rgba(221, 91, 97, .18);
}

.brand-title {
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* Sidebar nav */
.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted);
    margin: 14px 10px 8px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 6px 6px;
    border-radius: 12px;
    color: rgba(31, 41, 55, .92);
    text-decoration: none;
    border: 1px solid transparent;
    font-weight: 600;
}

    .side-nav a:hover {
        background: rgba(17, 24, 39, .03);
        border-color: var(--border);
    }

    .side-nav a.active {
        background: linear-gradient(180deg, rgba(230, 138, 72, .10), rgba(221, 91, 97, .08));
        border-color: rgba(230, 138, 72, .25);
    }

/* Main area */
.main {
    padding: 22px 28px;
}

/* FLAT page header (no floating card) */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin: 0 0 18px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
}

/* Title styles */
.page-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.page-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-left: 10px;
    font-weight: 600;
}

/* Content area should be flat (no big card) */
.content-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
}

/* Global: make content area full width */
.page-container-fluid {
    width: 100%;
    max-width: none;
    padding: 16px 24px;
}

/* Optional: if your existing .page-container has a max-width, remove it */
.page-container {
    width: 100%;
    max-width: none !important;
}

/* Tables: cleaner look */
.table thead th {
    font-weight: 600;
}

.card.shadow-sm {
    border: 1px solid rgba(0,0,0,.06);
}

/* Accounts table polish */
.tq-table-card {
    overflow: hidden; /* ensures header/edges look crisp */
}

.tq-table thead th {
    font-weight: 800;
    font-size: 12px;
    text-transform: none;
    white-space: nowrap;
}

.tq-table tbody td {
    border-top-color: rgba(17, 24, 39, .08);
}

.tq-table tbody tr:hover {
    background: rgba(17, 24, 39, .02);
}

/* Make DataTables controls match your rounded UI */
.dt-length select,
.dt-search input {
    border-radius: 12px;
}

/* Slightly soften pagination buttons */
.dt-paging button {
    border-radius: 10px !important;
}

/* Ledger linked payment rows */
.ledger-child td {
    padding-left: 26px;
    color: rgba(31, 41, 55, .85);
}

    .ledger-child td:nth-child(2) .fw-semibold {
        font-weight: 600 !important;
    }

    .ledger-child td:nth-child(3)::before {
        content: "↳ ";
        color: rgba(107, 114, 128, .9);
    }



/* Buttons */
.btn-tq {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #FFFFFF !important;
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
}

    .btn-tq:hover {
        filter: brightness(1.02);
    }

/* Bootstrap outline-light assumes dark BG; adapt it */
.btn-outline-light {
    border-color: rgba(17, 24, 39, .20) !important;
    color: rgba(17, 24, 39, .85) !important;
}

    .btn-outline-light:hover {
        background: rgba(17, 24, 39, .04) !important;
        border-color: rgba(17, 24, 39, .28) !important;
        color: rgba(17, 24, 39, 1) !important;
    }

/* Forms */
.form-control {
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, .14);
    padding: 10px 12px;
}

    .form-control:focus {
        border-color: rgba(230, 138, 72, .55);
        box-shadow: 0 0 0 .2rem rgba(230, 138, 72, .18);
    }

/* Login wrapper */
.auth-wrap {
    max-width: 720px;
}

/* Sidebar footer (pinned to bottom) */
.sidebar-footer {
    margin-top: auto; /* IMPORTANT: pushes footer to bottom */
    padding: 14px 10px 6px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}

    .sidebar-footer a {
        color: var(--muted);
        text-decoration: none;
    }

        .sidebar-footer a:hover {
            color: #111827;
            text-decoration: underline;
        }

.sidebar-footer-text {
    line-height: 1.55;
}

.sidebar-footer-copy {
    margin-top: 10px;
    font-size: 11px;
    color: rgba(107, 114, 128, .90);
}

/* Responsive */
@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    /* On mobile, don't force sticky-bottom footer inside a short sidebar */
    .sidebar-inner {
        height: auto;
    }

    .sidebar-footer {
        margin-top: 18px;
    }

    .main {
        padding: 16px;
    }
}

/* ===========================
   Dashboard tiles (grid menu)
   =========================== */

.tq-tile {
    display: block;
    text-decoration: none;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
    color: var(--text);
    min-height: 96px;
}

    .tq-tile:hover {
        transform: translateY(-1px);
        border-color: rgba(230, 138, 72, .28);
        box-shadow: 0 14px 34px rgba(17, 24, 39, .10);
        color: var(--text);
    }

.tq-tile-title {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 6px;
}

.tq-tile-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.tq-tile-disabled {
    opacity: .65;
    cursor: not-allowed;
    box-shadow: none;
    background: var(--surface-2);
}

    .tq-tile-disabled:hover {
        transform: none;
        border-color: var(--border);
        box-shadow: none;
    }

/* Dashboard centering */
.tq-dashboard {
    margin-left: auto;
    margin-right: auto;
}

/* Replace bootstrap row grid with a clean centered grid */
.tq-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 992px) {
    .tq-tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .tq-tile-grid {
        grid-template-columns: 1fr;
    }
}

/* Tile icon layout */
.tq-tile-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tq-tile-icon {
    font-size: 18px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(230, 138, 72, .16), rgba(221, 91, 97, .14));
    color: rgba(31, 41, 55, .92);
    border: 1px solid rgba(230, 138, 72, .18);
}

/* Disabled tiles: soften icon too */
.tq-tile-disabled .tq-tile-icon {
    background: rgba(17, 24, 39, .04);
    border-color: rgba(17, 24, 39, .08);
    color: rgba(31, 41, 55, .55);
}

/* ===========================
   TQ Context Modal (Light theme)
   =========================== */

.tq-context-modal .modal-dialog {
    max-width: 880px;
}

.tq-context-modal .modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 22px 55px rgba(17, 24, 39, .18);
    overflow: hidden;
}

/* Header / footer */
.tq-context-modal .modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
    background: var(--surface);
}

.tq-context-modal .modal-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.tq-context-modal .modal-title {
    font-weight: 900;
    margin: 0;
    letter-spacing: .2px;
}

.tq-context-modal .tq-modal-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.tq-context-modal .modal-body {
    padding: 14px 18px 18px;
    background: var(--surface);
}

.tq-context-modal .tq-modal-section-title {
    font-weight: 900;
    margin: 10px 0 10px;
}

/* Backdrop: a touch stronger + cleaner */
.modal-backdrop.show {
    opacity: .55 !important;
}

/* Org list box */
.tq-context-modal .tq-org-list {
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface-2);
}

/* IMPORTANT: override bootstrap list-group-item defaults */
.tq-context-modal .list-group-item,
.tq-context-modal .tq-org-row {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

    .tq-context-modal .list-group-item:last-child,
    .tq-context-modal .tq-org-row:last-child {
        border-bottom: 0 !important;
    }

.tq-context-modal .tq-org-name {
    font-weight: 900;
    line-height: 1.15;
}

.tq-context-modal .tq-org-role {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* Make select button consistent */
.tq-context-modal .tq-select-btn {
    border-radius: 12px;
    padding: 9px 16px;
    font-weight: 800;
}

/* Fix the bootstrap close button colour for light modal */
.tq-context-modal .btn-close {
    filter: none;
    opacity: .7;
}

    .tq-context-modal .btn-close:hover {
        opacity: .95;
    }

/* Mobile tweaks */
@media (max-width: 768px) {
    .tq-context-modal .modal-dialog {
        max-width: calc(100% - 18px);
        margin: 9px auto;
    }

    .tq-context-modal .modal-header,
    .tq-context-modal .modal-body,
    .tq-context-modal .modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tq-context-modal .tq-org-row {
        align-items: flex-start;
    }
}

/* Sidebar nav badge */
.tq-nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 25px rgba(221, 91, 97, .18);
}

/* Ensure nav items can push badge to the right nicely */
.side-nav a {
    justify-content: space-between;
}

    .side-nav a > span {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

