/* ============================================================
   TMG Modern UI 2026 ΓÇö Balanced Design System
   Philosophy: Purple is the brand anchor (sidebar, key buttons).
   Everything else is clean white / light gray ΓÇö modern SaaS look.
   ============================================================ */

:root {
    /* Brand */
    --tmg-purple:        #4b1853;
    --tmg-purple-hover:  #5d2066;
    --tmg-purple-light:  #7a3a8a;
    --tmg-gold:          #b27f2c;
    --tmg-gold-light:    #d4a84e;

    /* Surfaces */
    --tmg-bg:            #f4f5f7;
    --tmg-surface:       #ffffff;
    --tmg-surface-2:     #f8f9fa;

    /* Text */
    --tmg-text:          #1a1d29;
    --tmg-text-secondary:#52576e;
    --tmg-text-muted:    #8c91a7;

    /* Borders */
    --tmg-border:        #e4e6ef;
    --tmg-border-light:  #eef0f6;

    /* Radii */
    --tmg-radius-sm:     6px;
    --tmg-radius:        10px;
    --tmg-radius-lg:     14px;

    /* Shadows */
    --tmg-shadow-sm:     0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
    --tmg-shadow:        0 2px 8px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --tmg-shadow-md:     0 4px 16px rgba(0,0,0,.08);

    /* Font */
    --tmg-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ΓöÇΓöÇ Global ΓöÇΓöÇ */
body.theme-tmg,
body.theme-tmg.tmg-2026 {
    font-family: var(--tmg-font) !important;
    background: var(--tmg-bg) !important;
    color: var(--tmg-text);
    -webkit-font-smoothing: antialiased;
}

/* ΓöÇΓöÇ Sidebar ΓÇö purple brand anchor ΓöÇΓöÇ */
body.theme-tmg #leftsidebar {
    background: var(--tmg-purple) !important;
    box-shadow: 2px 0 12px rgba(75,24,83,.15) !important;
    border-right: none !important;
}
body.theme-tmg #leftsidebar .navbar-brand {
    background: rgba(0,0,0,.18);
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 16px 20px;
}
body.theme-tmg #leftsidebar .navbar-brand a span {
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
}
body.theme-tmg #leftsidebar .navbar-brand img {
    filter: brightness(0) invert(1);
}
body.theme-tmg #leftsidebar .btn-menu {
    color: rgba(255,255,255,.65) !important;
}
body.theme-tmg #leftsidebar .user-info {
    border-bottom: 1px solid rgba(255,255,255,.1) !important;
    padding: 14px 16px !important;
}
body.theme-tmg #leftsidebar .user-info .image img {
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,.2);
}
body.theme-tmg #leftsidebar .user-info .detail strong {
    color: #fff !important;
    font-weight: 600;
}
body.theme-tmg #leftsidebar .user-info .detail small a {
    color: var(--tmg-gold-light) !important;
}
body.theme-tmg #leftsidebar .menu .list a {
    color: rgba(255,255,255,.65) !important;
    font-size: 13.5px;
    font-weight: 500;
    padding: 10px 20px !important;
    border-radius: var(--tmg-radius-sm);
    margin: 1px 10px;
    transition: all 120ms ease;
}
body.theme-tmg #leftsidebar .menu .list a:hover,
body.theme-tmg #leftsidebar .menu .list li.active > a {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
}
body.theme-tmg #leftsidebar .menu .list li.active > a {
    border-left: 3px solid var(--tmg-gold-light) !important;
    padding-left: 17px !important;
    color: #fff !important;
}
body.theme-tmg #leftsidebar .menu .list a i.zmdi {
    color: rgba(255,255,255,.5);
    font-size: 18px;
    width: 22px;
}
body.theme-tmg #leftsidebar .menu .list li.active > a i.zmdi {
    color: var(--tmg-gold-light);
}
body.theme-tmg #leftsidebar .menu .list .ml-menu a {
    padding-left: 44px !important;
    font-size: 13px;
}

/* ΓöÇΓöÇ Content area ΓöÇΓöÇ */
body.theme-tmg section.content {
    background: transparent !important;
    padding: 20px 24px !important;
}

/* ΓöÇΓöÇ Cards ΓÇö white with light border ΓöÇΓöÇ */
body.theme-tmg .card {
    background: var(--tmg-surface) !important;
    border: 1px solid var(--tmg-border) !important;
    border-radius: var(--tmg-radius) !important;
    box-shadow: var(--tmg-shadow-sm) !important;
    overflow: hidden;
    transition: box-shadow 150ms ease;
}
body.theme-tmg .card:hover {
    box-shadow: var(--tmg-shadow) !important;
}

/* Card headers ΓÇö light gray, NOT purple ΓöÇΓöÇ */
body.theme-tmg .card .card-header,
body.theme-tmg .card .heading {
    background: var(--tmg-surface-2) !important;
    color: var(--tmg-text) !important;
    border-bottom: 1px solid var(--tmg-border) !important;
    border-radius: var(--tmg-radius) var(--tmg-radius) 0 0 !important;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Explicit purple/gold card headers override */
body.theme-tmg .card .card-header.purple,
body.theme-tmg .card .card-header.bg-purple,
body.theme-tmg .card .heading.purple {
    background: var(--tmg-purple) !important;
    color: #fff !important;
}
body.theme-tmg .card .card-header.gold,
body.theme-tmg .card .card-header.bg-gold,
body.theme-tmg .card .heading.gold {
    background: var(--tmg-gold) !important;
    color: #fff !important;
}
body.theme-tmg .card .card-header.bg-dark {
    background: #2d3043 !important;
    color: #fff !important;
}
body.theme-tmg .card .card-header.bg-success,
body.theme-tmg .card .card-header.success {
    background: #0d6e4f !important;
    color: #fff !important;
}
body.theme-tmg .card .card-header.bg-danger,
body.theme-tmg .card .card-header.danger {
    background: #b91c1c !important;
    color: #fff !important;
}
body.theme-tmg .card .card-header.bg-light {
    background: var(--tmg-surface-2) !important;
    color: var(--tmg-text) !important;
}
body.theme-tmg .card .card-header.bg-white {
    background: #fff !important;
    color: var(--tmg-text) !important;
}

/* Card nav tabs in white/light headers get purple treatment */
body.theme-tmg .card .card-header:not(.purple):not(.bg-purple):not(.bg-dark):not(.gold):not(.bg-gold):not(.bg-success):not(.bg-danger) .nav-tabs .nav-link {
    color: var(--tmg-text-secondary) !important;
    border: none !important;
    border-radius: var(--tmg-radius-sm) var(--tmg-radius-sm) 0 0;
}
body.theme-tmg .card .card-header:not(.purple):not(.bg-purple):not(.bg-dark):not(.gold):not(.bg-gold):not(.bg-success):not(.bg-danger) .nav-tabs .nav-link.active {
    color: var(--tmg-purple) !important;
    background: var(--tmg-surface) !important;
    border-bottom: 2px solid var(--tmg-purple) !important;
}
/* Dark/colored card headers get light tab treatment */
body.theme-tmg .card .card-header.purple .nav-tabs .nav-link,
body.theme-tmg .card .card-header.bg-purple .nav-tabs .nav-link,
body.theme-tmg .card .card-header.bg-dark .nav-tabs .nav-link,
body.theme-tmg .card .card-header.gold .nav-tabs .nav-link {
    color: rgba(255,255,255,.7) !important;
    border: none !important;
    border-radius: var(--tmg-radius-sm) !important;
    padding: 6px 14px !important;
}
body.theme-tmg .card .card-header.purple .nav-tabs .nav-link.active,
body.theme-tmg .card .card-header.bg-purple .nav-tabs .nav-link.active,
body.theme-tmg .card .card-header.bg-dark .nav-tabs .nav-link.active,
body.theme-tmg .card .card-header.gold .nav-tabs .nav-link.active {
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
}

body.theme-tmg .card .body,
body.theme-tmg .card .card-body {
    padding: 20px;
}
body.theme-tmg .card .card-footer {
    background: var(--tmg-surface-2);
    border-top: 1px solid var(--tmg-border);
    border-radius: 0 0 var(--tmg-radius) var(--tmg-radius);
    padding: 12px 20px;
}

/* ΓöÇΓöÇ Buttons ΓöÇΓöÇ */
body.theme-tmg .btn-primary {
    background: var(--tmg-purple) !important;
    border: none !important;
    border-radius: var(--tmg-radius-sm) !important;
    font-weight: 600;
    font-size: 13.5px;
    box-shadow: 0 2px 6px rgba(75,24,83,.2);
    transition: all 120ms ease;
    color: #fff !important;
}
body.theme-tmg .btn-primary:hover,
body.theme-tmg .btn-primary:focus {
    background: var(--tmg-purple-hover) !important;
    box-shadow: 0 3px 10px rgba(75,24,83,.3);
    transform: translateY(-1px);
}
body.theme-tmg .btn-gold-purple,
body.theme-tmg .btn-purple {
    background: var(--tmg-purple) !important;
    border: none !important;
    border-radius: var(--tmg-radius-sm) !important;
    color: #fff !important;
    font-weight: 600;
    transition: all 120ms ease;
}
body.theme-tmg .btn-gold-purple:hover,
body.theme-tmg .btn-purple:hover {
    background: var(--tmg-purple-hover) !important;
    transform: translateY(-1px);
}
body.theme-tmg .btn-outline-purple {
    color: var(--tmg-purple) !important;
    border: 1.5px solid var(--tmg-purple) !important;
    border-radius: var(--tmg-radius-sm) !important;
    background: transparent;
    font-weight: 600;
    transition: all 120ms ease;
}
body.theme-tmg .btn-outline-purple:hover {
    background: var(--tmg-purple) !important;
    color: #fff !important;
}
body.theme-tmg .btn {
    border-radius: var(--tmg-radius-sm) !important;
    font-weight: 500;
    font-size: 13.5px;
    transition: all 120ms ease;
}
body.theme-tmg .btn-info {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #fff !important;
}
body.theme-tmg .btn-secondary {
    background: #64748b !important;
    border-color: #64748b !important;
    color: #fff !important;
}

/* ΓöÇΓöÇ Tables ΓöÇΓöÇ */
body.theme-tmg .table {
    font-size: 13.5px;
}
body.theme-tmg .table thead th {
    background: var(--tmg-surface-2) !important;
    color: var(--tmg-text-secondary) !important;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-top: none !important;
    border-bottom: 2px solid var(--tmg-border) !important;
    padding: 10px 16px;
}
body.theme-tmg .table tbody td {
    padding: 11px 16px;
    vertical-align: middle;
    border-color: var(--tmg-border-light);
    color: var(--tmg-text);
}
body.theme-tmg .table tbody tr:hover {
    background: rgba(75,24,83,.025);
}

/* DataTable pagination */
body.theme-tmg .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.theme-tmg .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--tmg-purple) !important;
    border-color: var(--tmg-purple) !important;
    color: #fff !important;
    border-radius: var(--tmg-radius-sm);
}
body.theme-tmg .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover {
    background: var(--tmg-surface-2) !important;
    border-color: var(--tmg-border) !important;
    color: var(--tmg-purple) !important;
    border-radius: var(--tmg-radius-sm);
}

/* ΓöÇΓöÇ Form controls ΓöÇΓöÇ */
body.theme-tmg .form-control {
    border: 1.5px solid var(--tmg-border);
    border-radius: var(--tmg-radius-sm) !important;
    padding: 8px 12px;
    font-size: 13.5px;
    background: #fff;
    color: var(--tmg-text);
    transition: border-color 120ms ease, box-shadow 120ms ease;
    height: auto;
}
body.theme-tmg .form-control:focus {
    border-color: var(--tmg-purple) !important;
    box-shadow: 0 0 0 3px rgba(75,24,83,.08) !important;
    outline: none;
}
body.theme-tmg .input-group-addon,
body.theme-tmg .input-group-text {
    border-radius: var(--tmg-radius-sm) !important;
    border-color: var(--tmg-border);
}

/* ΓöÇΓöÇ Badges ΓöÇΓöÇ */
body.theme-tmg .badge {
    border-radius: 5px;
    font-weight: 600;
    font-size: 11px;
    padding: 4px 8px;
    letter-spacing: .02em;
}
body.theme-tmg .badge-primary,
body.theme-tmg .badge-info {
    background: var(--tmg-purple) !important;
    color: #fff !important;
}

/* ΓöÇΓöÇ Nav Tabs (standalone, outside cards) ΓöÇΓöÇ */
body.theme-tmg .nav-tabs {
    border-bottom-color: var(--tmg-border);
}
body.theme-tmg .nav-tabs .nav-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tmg-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 16px;
    transition: all 120ms ease;
}
body.theme-tmg .nav-tabs .nav-link:hover:not(.active) {
    color: var(--tmg-purple);
    border-bottom-color: rgba(75,24,83,.2);
    background: transparent;
}
body.theme-tmg .nav-tabs .nav-link.active {
    color: var(--tmg-purple) !important;
    border-bottom: 2px solid var(--tmg-purple) !important;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}

/* ΓöÇΓöÇ Modals ΓöÇΓöÇ */
body.theme-tmg .modal-content {
    border-radius: var(--tmg-radius-lg) !important;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.15) !important;
    overflow: hidden;
}
body.theme-tmg .modal-header {
    background: var(--tmg-surface-2) !important;
    color: var(--tmg-text) !important;
    border-bottom: 1px solid var(--tmg-border) !important;
    padding: 16px 24px;
}
body.theme-tmg .modal-header .modal-title {
    font-weight: 600;
    font-size: 15px;
}
body.theme-tmg .modal-header .close {
    color: var(--tmg-text-muted) !important;
    opacity: 1;
}
body.theme-tmg .modal-body {
    padding: 24px;
}
body.theme-tmg .modal-footer {
    border-top: 1px solid var(--tmg-border);
    background: var(--tmg-surface-2);
    padding: 14px 24px;
}

/* Modal headers that are explicitly purple */
body.theme-tmg .modal-header.card-header.purple,
body.theme-tmg .modal-header.bg-purple {
    background: var(--tmg-purple) !important;
    color: #fff !important;
}
body.theme-tmg .modal-header.bg-dark {
    background: #2d3043 !important;
    color: #fff !important;
}

/* ΓöÇΓöÇ Dropdowns ΓöÇΓöÇ */
body.theme-tmg .dropdown-menu {
    border: 1px solid var(--tmg-border);
    border-radius: var(--tmg-radius) !important;
    box-shadow: var(--tmg-shadow-md);
    padding: 6px;
    min-width: 180px;
    margin-top: 4px;
}
body.theme-tmg .dropdown-menu .dropdown-item {
    border-radius: var(--tmg-radius-sm);
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tmg-text-secondary);
    transition: all 100ms ease;
}
body.theme-tmg .dropdown-menu .dropdown-item:hover {
    background: rgba(75,24,83,.06);
    color: var(--tmg-purple);
}

/* ΓöÇΓöÇ Alerts ΓöÇΓöÇ */
body.theme-tmg .alert {
    border-radius: var(--tmg-radius) !important;
    border-left-width: 4px;
    font-size: 13.5px;
}

/* ΓöÇΓöÇ Progress bars ΓöÇΓöÇ */
body.theme-tmg .progress {
    border-radius: 100px;
    height: 7px;
    background: var(--tmg-border);
}
body.theme-tmg .progress-bar {
    border-radius: 100px;
    background: var(--tmg-purple);
}

/* ΓöÇΓöÇ Breadcrumbs ΓöÇΓöÇ */
body.theme-tmg .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 12px;
    font-size: 13px;
}
body.theme-tmg .breadcrumb-item a {
    color: var(--tmg-purple);
    font-weight: 500;
}
body.theme-tmg .breadcrumb-item.active {
    color: var(--tmg-text-muted);
}

/* ΓöÇΓöÇ Pagination ΓöÇΓöÇ */
body.theme-tmg .pagination .page-item.active .page-link {
    background: var(--tmg-purple) !important;
    border-color: var(--tmg-purple) !important;
    color: #fff !important;
    border-radius: var(--tmg-radius-sm);
}
body.theme-tmg .pagination .page-link {
    border-radius: var(--tmg-radius-sm) !important;
    margin: 0 2px;
    color: var(--tmg-text-secondary);
    border-color: var(--tmg-border);
    font-size: 13px;
}
body.theme-tmg .pagination .page-link:hover {
    color: var(--tmg-purple);
    background: var(--tmg-surface-2);
    border-color: var(--tmg-border);
}

/* ΓöÇΓöÇ Scrollbar ΓöÇΓöÇ */
body.theme-tmg ::-webkit-scrollbar { width: 5px; height: 5px; }
body.theme-tmg ::-webkit-scrollbar-track { background: transparent; }
body.theme-tmg ::-webkit-scrollbar-thumb {
    background: #d1d5e8;
    border-radius: 100px;
}
body.theme-tmg ::-webkit-scrollbar-thumb:hover { background: #b0b5cc; }

/* ΓöÇΓöÇ Links ΓöÇΓöÇ */
body.theme-tmg a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand) {
    color: var(--tmg-purple);
}

/* ΓöÇΓöÇ Selection ΓöÇΓöÇ */
body.theme-tmg ::selection {
    background: rgba(75,24,83,.12);
    color: var(--tmg-text);
}

/* ΓöÇΓöÇ Utility colors ΓöÇΓöÇ */
body.theme-tmg .bg-purple { background: var(--tmg-purple) !important; }
body.theme-tmg .bg-gold   { background: var(--tmg-gold) !important; }
body.theme-tmg .text-purple { color: var(--tmg-purple) !important; }
body.theme-tmg .text-gold   { color: var(--tmg-gold) !important; }
body.theme-tmg .bg-gold-purple {
    background: linear-gradient(134deg, var(--tmg-purple) 0%, var(--tmg-gold) 100%) !important;
}

/* ΓöÇΓöÇ Select2 ΓöÇΓöÇ */
body.theme-tmg .select2-container--default .select2-selection--single {
    border: 1.5px solid var(--tmg-border) !important;
    border-radius: var(--tmg-radius-sm) !important;
    height: 36px;
}
body.theme-tmg .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    color: var(--tmg-text);
    padding: 0 10px;
}
body.theme-tmg .select2-container--focus .select2-selection--single {
    border-color: var(--tmg-purple) !important;
    box-shadow: 0 0 0 3px rgba(75,24,83,.08);
}
body.theme-tmg .select2-dropdown {
    border: 1px solid var(--tmg-border) !important;
    border-radius: var(--tmg-radius) !important;
    box-shadow: var(--tmg-shadow-md);
}
body.theme-tmg .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--tmg-purple) !important;
}

/* ΓöÇΓöÇ SweetAlert ΓöÇΓöÇ */
body.theme-tmg .swal2-confirm { background: var(--tmg-purple) !important; border-radius: var(--tmg-radius-sm) !important; }

/* ΓöÇΓöÇ FullCalendar ΓöÇΓöÇ */
body.theme-tmg .fc-toolbar .fc-button-primary {
    background: var(--tmg-purple) !important;
    border-color: var(--tmg-purple) !important;
    border-radius: var(--tmg-radius-sm) !important;
}

/* ΓöÇΓöÇ Auth layout background ΓöÇΓöÇ */
body.theme-tmg.m-0,
body.theme-tmg .authentication {
    background: var(--tmg-bg) !important;
}

/* ΓöÇΓöÇ Responsive ΓöÇΓöÇ */
@media (max-width: 767px) {
    body.theme-tmg section.content {
        padding: 12px !important;
    }
}
