/*
 * ================================================
 * CTPL Admin Theme — Deep Navy Blue + White
 * Clean, classic sports corporate look (FIFA/UEFA style)
 * Primary: Navy Blue (#132c5e)  Accent: Vivid Blue (#0056b3)
 * ================================================
 */

/* ─── 1. Base Variables ─── */

:root {
    --ctpl-navy: #132c5e;          /* Deep navy for sidebar/header */
    --ctpl-navy-dark: #0a1733;     /* Darker navy for active states/panels */
    --ctpl-blue: #0056b3;          /* Primary button color */
    --ctpl-blue-light: #2e8bdc;    /* Hover states, accents */
    --ctpl-bg-light: #f4f6f9;      /* Main content area background */
    --ctpl-text-dark: #343a40;     /* Main text color */
    --ctpl-text-muted: #6c757d;    /* Muted text color */
    --ctpl-border: #e9ecef;        /* Soft border color */

    --app-sidebar-bg: var(--ctpl-navy) !important;
    --bs-primary: var(--ctpl-blue) !important;
    --bs-primary-rgb: 0, 86, 179 !important;
    --bs-info: var(--ctpl-blue-light) !important;
}

/* ─── 2. Light Mode Body ─── */

body, body.app, .page-layout {
    background-color: var(--ctpl-bg-light) !important;
}

.app-wrapper {
    background-color: var(--ctpl-bg-light) !important;
}

/* ─── 3. Header ─── */

.app-header {
    background-color: var(--ctpl-navy) !important;
    border-bottom: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.app-header-inner {
    background-image: none !important;
    background-color: var(--ctpl-navy) !important;
}

.app-header h4,
.app-header .fw-bold,
.app-header .text-white {
    color: #ffffff !important;
}

.app-toggler {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.app-toggler svg path {
    stroke: #ffffff !important;
}

/* ─── 4. Sidebar — Left Icon Strip ─── */

.app-navbar-tabs {
    background-color: var(--ctpl-navy-dark) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.app-navbar-tabs .nav-item .menu-link {
    color: #ffffff !important;
    opacity: 0.7;
}

.app-navbar-tabs .nav-item .menu-link > i {
    color: #ffffff !important;
}

.app-navbar-tabs .nav-item .menu-link > svg,
.app-navbar-tabs .nav-item .menu-link > svg path {
    stroke: #ffffff !important;
}

.app-navbar-tabs .nav-item .menu-link.active,
.app-navbar-tabs .nav-item .menu-link:hover,
.app-navbar-tabs .nav-item .menu-link:focus {
    background-color: var(--ctpl-blue) !important;
    color: #ffffff !important;
    opacity: 1;
}

.app-navbar-tabs .nav-item .menu-link.active i,
.app-navbar-tabs .nav-item .menu-link:hover i,
.app-navbar-tabs .nav-item .menu-link:focus i {
    color: #ffffff !important;
}

.app-navbar-tabs .nav-item .menu-link.active > svg path,
.app-navbar-tabs .nav-item .menu-link:hover > svg path {
    stroke: #ffffff !important;
}

.app-navbar-tabs .nav-item-hr {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* ─── 5. Sidebar — Right Menu Panel ─── */

.app-menubar-tabs .app-tab-content {
    background-image: none !important;
    background-color: var(--ctpl-navy) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.app-menubar-tabs .app-navbar-brand,
.app-navbar-brand {
    background-color: var(--ctpl-navy-dark) !important;
    border-right-color: rgba(255, 255, 255, 0.05) !important;
}

/* Menu section headings */
.app-menubar-tabs .side-menubar .menu-heading {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Menu links — default */
.app-menubar-tabs .side-menubar .menu-item .menu-link {
    color: #ffffff !important;
    opacity: 0.8;
    transition: all 0.2s ease !important;
}

.app-menubar-tabs .side-menubar .menu-item .menu-link > i {
    color: #ffffff !important;
}

/* Menu links — hover */
.app-menubar-tabs .side-menubar .menu-item .menu-link:hover {
    color: #ffffff !important;
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
}

/* Menu links — active */
.app-menubar-tabs .side-menubar .menu-item .menu-link.active,
.app-menubar-tabs .side-menubar .menu-item.active > .menu-link,
.app-menubar-tabs .side-menubar .menu-item.open > .menu-link {
    color: #ffffff !important;
    opacity: 1;
    background-color: var(--ctpl-blue) !important;
    border-radius: 6px;
    font-weight: 500;
}

/* ─── 6. Primary Buttons ─── */

.btn-primary {
    background-color: var(--ctpl-blue) !important;
    border: 1px solid var(--ctpl-blue) !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 4px rgba(0, 86, 179, 0.2) !important;
    transition: all 0.2s ease !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #004494 !important;
    border-color: #004494 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.3) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--ctpl-blue) !important;
    color: var(--ctpl-blue) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--ctpl-blue) !important;
    color: #ffffff !important;
}

/* ─── 7. Cards ─── */

.card {
    background-color: #ffffff !important;
    border: 1px solid var(--ctpl-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    border-radius: 8px !important;
}

.card:not(.h-100) {
    height: auto !important;
}

.card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--ctpl-border) !important;
}

/* ─── 8. Tables ─── */

.table thead th {
    background-color: var(--ctpl-bg-light) !important;
    color: var(--ctpl-text-dark) !important;
    font-weight: 600 !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--ctpl-border) !important;
}

.table tbody td {
    color: var(--ctpl-text-dark) !important;
    border-color: var(--ctpl-border) !important;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(0, 86, 179, 0.03) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #fafbfc !important;
}

/* DataTables */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: var(--ctpl-text-dark) !important;
    border-radius: 4px !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--ctpl-text-muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: var(--ctpl-blue) !important;
    border-color: var(--ctpl-blue) !important;
    color: #ffffff !important;
    border-radius: 4px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: var(--ctpl-bg-light) !important;
    border-color: #ced4da !important;
    color: var(--ctpl-text-dark) !important;
}

/* ─── 9. Forms ─── */

.form-control,
.form-select {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: var(--ctpl-text-dark) !important;
    border-radius: 6px !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25) !important;
}

.form-label {
    color: var(--ctpl-text-dark) !important;
    font-weight: 500;
}

/* ─── 10. Breadcrumbs ─── */

.breadcrumb-item a {
    color: var(--ctpl-blue) !important;
}

.breadcrumb-item.active {
    color: var(--ctpl-text-muted) !important;
}

/* ─── 11. Page Headings ─── */

h1, h2, h3, h4, h5,
.h1, .h2, .h3, .h4, .h5 {
    color: var(--ctpl-navy) !important;
    font-weight: 600;
}

h6, .h6, p.text-muted, .text-muted {
    color: var(--ctpl-text-muted) !important;
}

/* ─── 12. Badges ─── */

.badge.bg-primary {
    background-color: var(--ctpl-blue) !important;
    color: #ffffff !important;
}

.badge.bg-info {
    background-color: var(--ctpl-blue-light) !important;
    color: #ffffff !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

/* ─── 13. Dropdowns ─── */

.dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
}

.dropdown-item {
    color: var(--ctpl-text-dark) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--ctpl-bg-light) !important;
    color: var(--ctpl-navy) !important;
}

/* ─── 14. Pagination ─── */

.page-link {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: var(--ctpl-blue) !important;
}

.page-item.active .page-link {
    background-color: var(--ctpl-blue) !important;
    border-color: var(--ctpl-blue) !important;
    color: #ffffff !important;
}

.page-link:hover {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #004494 !important;
}

/* ─── 15. Links (content area only) ─── */

.app-wrapper a {
    color: var(--ctpl-blue) !important;
}

.app-wrapper a:hover {
    color: #004494 !important;
    text-decoration: underline;
}

/* Restore colors for elements inside content area that shouldn't be primary color */
.app-wrapper .nav-link,
.app-wrapper .dropdown-item,
.app-wrapper .page-link,
.app-wrapper .table a {
    color: inherit !important;
    text-decoration: none;
}

.app-wrapper .btn,
.app-wrapper .badge {
    text-decoration: none !important;
}

/* Fix color override for button links inside content area */
.app-wrapper a.btn {
    text-decoration: none !important;
}

.app-wrapper a.btn-primary {
    color: #ffffff !important;
}

.app-wrapper a.btn-light {
    color: #475569 !important;
}

.app-wrapper a.btn-outline-primary {
    color: var(--ctpl-blue) !important;
}

.app-wrapper a.btn-outline-primary:hover {
    color: #ffffff !important;
}

.app-wrapper a.btn-success {
    color: #ffffff !important;
}

.app-wrapper a.btn-success.btn-icon {
    color: #16a34a !important;
}

.app-wrapper a.btn-danger {
    color: #ffffff !important;
}

.app-wrapper a.btn-success.btn-icon:hover {
    color: #ffffff !important;
}

/* Styled Light/Cancel button */
.btn-light {
    background-color: #f1f5f9 !important; /* Slate-100 */
    border: 1px solid #cbd5e1 !important; /* Slate-300 */
    color: #475569 !important; /* Slate-600 */
}

.btn-light:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

/* ─── 16. Force white text in ALL dark areas (header + sidebar) ─── */

.app-header,
.app-header *,
.app-header-inner,
.app-header-inner * {
    color: #ffffff !important;
}

.app-header small,
.app-header .text-body {
    color: rgba(255, 255, 255, 0.7) !important;
}

.app-header .dropdown-menu,
.app-header .dropdown-menu * {
    color: var(--ctpl-text-dark) !important;
}

.app-header .dropdown-menu .text-danger,
.app-header .dropdown-menu .text-danger * {
    color: #dc3545 !important;
}

/* Sidebar icon strip — white icons */
.app-navbar-tabs,
.app-navbar-tabs * {
    color: #ffffff !important;
}

/* Sidebar menu panel — white text */
.app-menubar-tabs .app-tab-content,
.app-menubar-tabs .app-tab-content *,
.app-menubar-tabs .side-menubar,
.app-menubar-tabs .side-menubar * {
    color: #ffffff !important;
}

/* ─── 17. Alerts ─── */

.alert-success {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.alert-danger {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

.alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffeeba !important;
    color: #856404 !important;
}

/* ─── 18. Scrollbar ─── */

.app-menubar-tabs ::-webkit-scrollbar,
.app-navbar-tabs ::-webkit-scrollbar {
    width: 6px;
}

.app-menubar-tabs ::-webkit-scrollbar-track,
.app-navbar-tabs ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.app-menubar-tabs ::-webkit-scrollbar-thumb,
.app-navbar-tabs ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.app-menubar-tabs ::-webkit-scrollbar-thumb:hover,
.app-navbar-tabs ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ─── 19. Selection ─── */

::selection {
    background-color: var(--ctpl-blue);
    color: #ffffff;
}

/* ─── 20. SweetAlert2 Confirm Button ─── */

.swal2-confirm.swal2-styled {
    background-color: var(--ctpl-blue) !important;
    border: none !important;
    color: #ffffff !important;
}

/* ================================================
 * 21. Premium Login Page Customizations (SaaS)
 * ================================================
 */

/* Force absolute zero margins and paddings on viewport elements specifically for the login/auth page */
.auth-page, .auth-page html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
}

.auth-page .page-layout {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.auth-page .auth-frame-wrapper {
    background-color: #f8fafc !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
}

/* Left side cover frame styling */
.auth-frame {
    position: relative;
    overflow: hidden;
}

.auth-frame::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(19, 44, 94, 0.4) 0%, rgba(0, 86, 179, 0.2) 100%);
    pointer-events: none;
}

/* Right-side form container - force 100% height and use flexbox to center vertical content */
.auth-frame-wrapper .col-xl-4, 
.auth-frame-wrapper .col-lg-5, 
.auth-frame-wrapper .col-md-6,
.auth-frame-wrapper .col-12 {
    background: #ffffff !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.03) !important;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-height: 100vh !important;
    height: 100% !important;
}

/* Logo scaling & centering */
.auth-frame-wrapper .app-logo {
    max-height: 220px !important;
    height: auto !important;
    width: auto !important;
    margin: 0 auto 1.5rem auto !important;
    display: block;
    object-fit: contain !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-frame-wrapper .app-logo:hover {
    transform: scale(1.03);
}

/* Heading with elegant typography & premium gradient */
.auth-frame-wrapper h5 {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    letter-spacing: -0.6px !important;
    background: linear-gradient(135deg, #132c5e 0%, #0056b3 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    margin-bottom: 8px !important;
    text-align: center !important;
}

/* Subtitle typography */
.auth-frame-wrapper p.mb-4 {
    font-family: 'Instrument Sans', sans-serif !important;
    font-size: 14.5px !important;
    color: #64748b !important; /* Elegant slate-500 */
    line-height: 1.5 !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
}

/* Input labels */
.auth-frame-wrapper .form-label {
    font-size: 12.5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.7px !important;
    color: #475569 !important; /* slate-600 */
    font-weight: 600 !important;
    margin-bottom: 6px !important;
}

/* Form fields - elegant focus and borders */
.auth-frame-wrapper .form-control {
    padding: 12px 16px !important;
    font-size: 14.5px !important;
    border: 1px solid #cbd5e1 !important; /* slate-300 */
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    color: #0f172a !important; /* slate-900 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.auth-frame-wrapper .form-control:focus {
    background-color: #ffffff !important;
    border-color: #0056b3 !important;
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.12) !important;
}

/* Password Toggle Eyeball alignment */
.auth-frame-wrapper .password-wrapper {
    position: relative;
}

.auth-frame-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
}

.auth-frame-wrapper .toggle-password:hover {
    color: #0056b3;
}

/* Premium Primary Action Button */
.auth-frame-wrapper .btn-primary {
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #0056b3 0%, #132c5e 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.auth-frame-wrapper .btn-primary:hover {
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 18px rgba(0, 86, 179, 0.3) !important;
    background: linear-gradient(135deg, #004494 0%, #0a1733 100%) !important;
}

.auth-frame-wrapper .btn-primary:active {
    transform: translateY(0) !important;
}

/* ================================================
 * 22. Premium User & Role Management Table UI (SaaS)
 * ================================================
 */

/* Main wrapper spacing & background cleanup */
.page-content {
    background-color: #f8fafc !important; /* Soft slate gray backdrop */
    min-height: calc(100vh - 60px) !important;
}

/* Premium Card container */
.card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important; /* Slate-200 */
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
    overflow: hidden !important;
}

/* Tables styling overhauls */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

.table thead th {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    color: #475569 !important; /* Slate-600 */
    font-weight: 600 !important;
    font-size: 12.5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    padding: 14px 20px !important;
    vertical-align: middle !important;
    border-top: none !important;
}

/* Row separation and hover dynamics */
.table tbody tr {
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.table tbody tr:hover {
    background-color: #f1f5f9 !important; /* Slate-100 hover */
}

.table tbody td {
    padding: 16px 20px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    color: #1e293b !important; /* Slate-800 */
    font-size: 14.5px !important;
}

/* Hide raw sorting text arrow overrides for custom DataTables graphics */
.dataTable thead th::after, 
.dataTable thead th::before {
    display: none !important;
}

/* Beautiful Action Button overrides */
.btn-icon {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important; /* Perfect circles */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
}

.btn-success.btn-icon {
    background-color: rgba(22, 163, 74, 0.08) !important; /* Soft Emerald-100 */
    color: #16a34a !important; /* Emerald-600 */
    border: 1px solid rgba(22, 163, 74, 0.15) !important;
    box-shadow: none !important;
}

.btn-success.btn-icon:hover {
    background-color: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25) !important;
    transform: translateY(-1.5px) !important;
}

/* Universal badge styles */
.badge {
    padding: 6px 12px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    border-radius: 30px !important;
    text-transform: capitalize !important;
    letter-spacing: 0.2px !important;
    display: inline-flex !important;
    align-items: center;
}

/* Specific customized user roles */
.badge-role-super-admin {
    background-color: rgba(0, 86, 179, 0.08) !important; /* Soft CTPL navy-blue */
    color: var(--ctpl-blue) !important;
    border: 1px solid rgba(0, 86, 179, 0.15) !important;
}

.badge-role-team-owner {
    background-color: rgba(13, 148, 136, 0.08) !important; /* Soft Teal-100 */
    color: #0d9488 !important; /* Teal-600 */
    border: 1px solid rgba(13, 148, 136, 0.15) !important;
}

/* Status pills */
.badge.bg-success {
    background-color: rgba(22, 163, 74, 0.08) !important; /* Soft Green-100 */
    color: #16a34a !important; /* Green-600 */
    border: 1px solid rgba(22, 163, 74, 0.15) !important;
}

.badge.bg-danger {
    background-color: rgba(220, 38, 38, 0.08) !important; /* Soft Red-100 */
    color: #dc2626 !important; /* Red-600 */
    border: 1px solid rgba(220, 38, 38, 0.15) !important;
}

/* DataTables elements alignment & borders */
.dataTables_wrapper {
    padding: 20px !important;
}

.dataTables_length, .dataTables_filter {
    margin-bottom: 1.25rem !important;
}

.dataTables_length label, .dataTables_filter label {
    font-size: 13.5px !important;
    color: #475569 !important; /* Slate-600 */
    font-weight: 500 !important;
}

.dataTables_length select {
    padding: 6px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background-color: #f8fafc !important;
    margin: 0 6px !important;
    outline: none !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
}

.dataTables_filter input {
    padding: 8px 16px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    margin-left: 8px !important;
    outline: none !important;
    width: 220px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dataTables_filter input:focus {
    background-color: #ffffff !important;
    border-color: var(--ctpl-blue) !important;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1) !important;
}

/* Modern Datatable Info & Pagination controls */
.dataTables_info {
    font-size: 13.5px !important;
    color: #64748b !important; /* Slate-500 */
    padding-top: 20px !important;
}

.dataTables_paginate {
    padding-top: 16px !important;
}

.dataTables_paginate .paginate_button {
    padding: 6px 14px !important;
    margin: 0 3px !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--ctpl-blue) !important;
    border-color: var(--ctpl-blue) !important;
    color: #ffffff !important;
}

.dataTables_paginate .paginate_button:hover:not(.current) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Add User Button styling */
.btn-primary {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    background-color: var(--ctpl-blue) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 86, 179, 0.15) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-primary:hover {
    background-color: #004494 !important;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.25) !important;
    transform: translateY(-1px) !important;
}

/* ================================================
 * 23. Mobile Responsiveness Overrides
 * ================================================
 */

@media (max-width: 991.98px) {
    /* Position sidebar offscreen by default and transition it smoothly */
    .app-menubar-tabs {
        position: fixed !important;
        left: -320px !important;
        width: 320px !important;
        z-index: 1050 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 5px 0 25px rgba(10, 23, 51, 0.15) !important;
    }

    /* Keep individual parts of sidebar aligned relative to the sliding container */
    .app-menubar-tabs .app-navbar-brand {
        width: 80px !important;
        min-width: 80px !important;
    }

    .app-menubar-tabs .app-navbar-tabs {
        width: 80px !important;
    }

    .app-menubar-tabs .app-tab-content {
        left: -240px !important; /* Start offscreen relative to the parent */
        width: 240px !important;
        position: absolute !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        height: 100% !important;
    }

    /* Slide sidebar in when body has sidebar-open class */
    body.sidebar-open .app-menubar-tabs {
        left: 0 !important;
    }

    body.sidebar-open .app-menubar-tabs .app-tab-content {
        left: 80px !important; /* Slide the panel right next to the icon strip */
    }

    /* Force the main wrapper to take full width and clear header */
    .app-wrapper {
        margin-left: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-top: 80px !important; /* Clean clearance of the header */
    }

    /* Position the header correctly at full-width */
    .app-header {
        padding-left: 0 !important;
        width: 100% !important;
        left: 0 !important;
        z-index: 1000 !important;
    }

    /* Sidebar overlay backdrop styling */
    .sidebar-overlay {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(10, 23, 51, 0.5) !important; /* Brand dark navy overlay */
        z-index: 1040 !important; /* Just below sidebar */
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Horizontal scroll for overflowed tables inside cards */
    .card-body:has(.table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Condense Datatables padding to conserve screen space */
    .dataTables_wrapper {
        padding: 12px 8px !important;
    }

    .dataTables_filter input {
        width: 140px !important;
        margin-left: 4px !important;
    }

    /* Flex-wrap top-level header action panels on mobile */
    .page-content .container-fluid > .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .page-content .container-fluid > .d-flex.justify-content-between.align-items-center > div,
    .page-content .container-fluid > .d-flex.justify-content-between.align-items-center > a,
    .page-content .container-fluid > .d-flex.justify-content-between.align-items-center > .d-flex {
        width: 100% !important;
    }

    .page-content .container-fluid > .d-flex.justify-content-between.align-items-center .btn {
        width: 100% !important;
        text-align: center;
        justify-content: center;
    }
}

/* ================================================
 * 24. Mobile Login Page Layout Correction
 * ================================================
 */

@media (max-width: 991.98px) {
    /* Allow scrolling on mobile devices to prevent content truncation */
    .auth-page, .auth-page html, .auth-page .page-layout, .auth-page .auth-frame-wrapper {
        height: auto !important;
        min-height: 100vh !important;
        overflow: auto !important;
    }
    
    /* Remove borders, adjust paddings & sizes on mobile viewports */
    .auth-frame-wrapper .col-xl-4, 
    .auth-frame-wrapper .col-lg-5, 
    .auth-frame-wrapper .col-md-6,
    .auth-frame-wrapper .col-12 {
        min-height: 100vh !important;
        height: auto !important;
        border-left: none !important;
        box-shadow: none !important;
        padding: 40px 24px !important;
    }
    
    /* Shrink logo on smaller mobile heights */
    .auth-frame-wrapper .app-logo {
        max-height: 150px !important;
        margin-bottom: 1.25rem !important;
    }
}
