/* ============================================
   TECHONE CRM - GLOBAL UI ENHANCEMENTS
   Cards, buttons, tables, nav, empty states
   ============================================ */

/* ---- Transitions (respect reduced motion) ---- */
@media (prefers-reduced-motion: no-preference) {
    .card,
    .small-box,
    .info-box,
    .nav-sidebar .nav-link,
    .btn:not(.dropdown-toggle),
    .table tbody tr {
        transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.15s ease, border-color 0.15s ease;
    }
}

/* ---- Cards: hover lift + shadow ---- */
.card {
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
@media (prefers-reduced-motion: no-preference) {
    .card:hover {
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
    }
}
.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-weight: 600;
    padding: 0.9rem 1.15rem;
}
.card-title {
    font-weight: 600;
    color: #333;
    margin: 0;
    float: none; /* pair with flex card-headers; AdminLTE float pushes tools left */
}
.card-header .card-tools {
    float: none;
    margin-left: auto;
}

/* AdminLTE outline tabs + Bootstrap 5: keep underline tabs, not pill buttons */
.card-outline-tabs .card-header.p-0 .nav-tabs {
    border-bottom: 1px solid #dee2e6;
}
.card-outline-tabs .card-header .nav-tabs .nav-link {
    border: 1px solid transparent;
    color: #6c757d;
    background: transparent;
    margin-bottom: -1px;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    border-radius: 0.35rem 0.35rem 0 0;
}
.card-outline-tabs .card-header .nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: #495057;
}
.card-outline-tabs .card-header .nav-tabs .nav-link.active {
    color: #495057 !important;
    background-color: #fff !important;
    border-color: #dee2e6 #dee2e6 #fff !important;
}

/* Only force block titles in page headers (do not break AdminLTE card-title float) */
.content-header h1 {
    display: block;
    float: none;
    line-height: 1.3;
}
.card-body {
    padding: 1.15rem;
}
.card-body.p-0 {
    padding: 0 !important;
}
.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.85rem 1.15rem;
}

/* Consistent spacing for card body content */
.card-body > *:first-child {
    margin-top: 0;
}

.card-body > *:last-child {
    margin-bottom: 0;
}

/* Form groups - consistent spacing */
.form-group,
.mb-3 {
    margin-bottom: 1rem;
}

.form-group:last-child,
.mb-3:last-child {
    margin-bottom: 0;
}

/* Row spacing in forms */
.row + .row {
    margin-top: 0.75rem;
}

/* Alert spacing */
.alert {
    margin-bottom: 1rem;
}

.alert:last-child {
    margin-bottom: 0;
}

/* Table spacing */
.table {
    margin-bottom: 0;
}

.card-body .table-responsive {
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.card-body .table-responsive .table {
    margin-bottom: 0;
}

/* Button toolbar spacing */
.btn-toolbar {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-tools .btn {
    margin: 0;
}

/* Gap utilities for flex layouts */
.d-flex.gap-1,
.flex-wrap.gap-1 {
    gap: 0.25rem;
}

.d-flex.gap-2,
.flex-wrap.gap-2 {
    gap: 0.5rem;
}

.d-flex.gap-3,
.flex-wrap.gap-3 {
    gap: 1rem;
}

/* Gap utilities - general */
.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

/* Clean button spacing in flex containers */
.d-flex .btn + .btn,
.flex-wrap .btn + .btn {
    margin-left: 0;
}

.d-flex .btn,
.flex-wrap .btn {
    margin: 0;
}

/* List group spacing */
.list-group {
    margin-bottom: 0;
}

.list-group-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.list-group-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* ---- Small boxes (dashboard stats): hover ---- */
.small-box {
    border-radius: 0.5rem;
    overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
    .small-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    }
    .small-box:hover .icon {
        transform: scale(1.05);
    }
    .small-box .icon {
        transition: transform 0.2s ease;
    }
}
.small-box-footer {
    transition: background-color 0.15s ease;
}
.small-box-footer:hover {
    background-color: rgba(0, 0, 0, 0.15) !important;
}

/* ---- Info boxes: hover ---- */
.info-box {
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
@media (prefers-reduced-motion: no-preference) {
    .info-box:hover {
        box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
    }
}
.info-box-icon {
    border-radius: 0.5rem 0 0 0.5rem;
}

/* Dashboard: Pipeline & Won Deals values always visible (client dashboard) */
.dashboard-pipeline-box .info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.dashboard-pipeline-box .info-box-text,
.dashboard-pipeline-box .info-box-number,
.dashboard-pipeline-box .info-box-content small {
    display: block;
}
.dashboard-pipeline-box .info-box-text {
    color: rgba(255, 255, 255, 0.95);
}
.dashboard-pipeline-box .info-box-number {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.dashboard-pipeline-box .info-box-content small {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.25rem;
}
/* If gradient is too light, ensure number still visible */
.dashboard-pipeline-box.bg-gradient-info .info-box-number,
.dashboard-pipeline-box.bg-gradient-success .info-box-number {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ---- Tables: row hover ---- */
.table-hover tbody tr:hover,
.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.04);
}
.table thead th {
    font-weight: 600;
    color: #495057;
    border-bottom-width: 2px;
}
.table-striped tbody tr:nth-of-type(odd):hover {
    background-color: rgba(0, 123, 255, 0.06);
}

/* ---- Buttons: subtle feedback ---- */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}
.btn:active:not(.dropdown-toggle) {
    transform: scale(0.98);
}
.btn-sm {
    font-weight: 500;
}

/* ============================================
   SIDEBAR - Modern Design Improvements
   ============================================ */

/* Sidebar Background - Dark gradient */
body:not(.super-admin-shell) .main-sidebar {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%) !important;
}

.main-sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
}

/* Brand Link Area */
.main-sidebar .brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.75rem 0.65rem !important;
    transition: background-color 0.2s ease !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.main-sidebar .brand-link:has(.toc-brand-logo__text) {
    justify-content: flex-start !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}
.main-sidebar .brand-link:hover {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

/* Sidebar Container */
.main-sidebar .sidebar {
    padding-bottom: 2rem !important;
}

/* Custom Scrollbar for Sidebar */
.main-sidebar .sidebar::-webkit-scrollbar {
    width: 6px !important;
}
.main-sidebar .sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1) !important;
}
.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 3px !important;
}
.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Navigation Headers */
.nav-sidebar .nav-header {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 1rem 1rem 0.5rem 1rem !important;
    margin-top: 0.5rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Navigation Items - Better Spacing */
.nav-sidebar .nav-item {
    margin-bottom: 3px !important;
}

/* Navigation Links - Modern Design */
body:not(.super-admin-shell) .nav-sidebar .nav-item > .nav-link,
.nav-sidebar .nav-link {
    border-radius: 0.5rem !important;
    margin: 0 0.5rem !important;
    padding: 0.7rem 1rem !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: visible !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Navigation Link Hover - Subtle Glow */
body:not(.super-admin-shell) .nav-sidebar .nav-item > .nav-link:hover,
.nav-sidebar .nav-link:hover {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.25) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
    transform: translateX(3px) !important;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.15) !important;
    color: #fff !important;
}

/* Active Link - Brand Color Gradient */
body:not(.super-admin-shell) .nav-sidebar .nav-item > .nav-link.active,
.nav-sidebar .nav-link.active {
    background: linear-gradient(135deg, #0d9488 0%, #0e7490 100%) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 12px rgba(13, 148, 136, 0.4) !important;
    transform: translateX(3px) !important;
}

.nav-sidebar .nav-link.active .nav-icon {
    color: #fff !important;
    transform: scale(1.15) !important;
}

/* Navigation Icons - Better Alignment */
.nav-sidebar .nav-icon {
    width: 1.5rem !important;
    text-align: center !important;
    margin-right: 0.75rem !important;
    font-size: 1.1rem !important;
    transition: all 0.2s ease !important;
}

/* Navigation Text */
.nav-sidebar .nav-link p {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
}

/* Treeview Parent Items */
.nav-sidebar .nav-item.has-treeview > .nav-link {
    padding-right: 2.5rem !important;
}

/* Treeview Arrow - Better Positioning */
.nav-sidebar .nav-item.has-treeview > .nav-link .right {
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: transform 0.3s ease !important;
    font-size: 0.85rem !important;
}

.nav-sidebar .nav-item.has-treeview.menu-open > .nav-link .right {
    transform: translateY(-50%) rotate(-90deg) !important;
}

/* Treeview Submenu — keep in document flow so open menus push siblings down.
   Do NOT force display with !important; AdminLTE Treeview handles show/hide. */
.nav-sidebar .nav-treeview {
    position: static !important;
    height: auto !important;
    padding: 0.5rem 0 !important;
    background: rgba(0, 0, 0, 0.2) !important;
    margin: 0.25rem 0.5rem 0.5rem 0.5rem !important;
    border-radius: 0.5rem !important;
    list-style: none !important;
}

.nav-sidebar .nav-item.has-treeview {
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
}

.nav-sidebar .nav-item.has-treeview.menu-open > .nav-treeview {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
}

/* Submenu Items */
.nav-sidebar .nav-treeview > .nav-item {
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link {
    display: flex !important;
    align-items: center !important;
    padding-left: 2.25rem !important;
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
    margin: 0 0.5rem !important;
    font-size: 0.88rem !important;
    background: transparent !important;
    transform: none !important;
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link .nav-icon {
    font-size: 0.6rem !important;
    opacity: 0.7 !important;
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link:hover {
    background: rgba(13, 148, 136, 0.15) !important;
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link:hover .nav-icon {
    opacity: 1 !important;
}

/* Submenu Active State */
.nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.35) 0%, rgba(14, 116, 144, 0.35) 100%) !important;
    border-left: 3px solid #0d9488 !important;
    padding-left: calc(2.25rem - 3px) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

/* Badges in Sidebar */
.nav-sidebar .badge {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
    font-weight: 600 !important;
    margin-left: 0.5rem !important;
}

/* Mobile Responsiveness - Complete Sidebar Hide */
@media (max-width: 991.98px) {
    /* Prevent body horizontal scroll */
    html {
        overflow-x: hidden !important;
    }
    
    body {
        overflow-x: hidden !important;
        position: relative !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    .wrapper {
        overflow-x: hidden !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Completely hide sidebar off-screen - far left */
    .main-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -320px !important;
        margin-left: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        box-shadow: none !important;
        transition: left 0.3s ease !important;
        z-index: 1050 !important;
        transform: translateX(0) !important;
        display: block !important;
        will-change: left !important;
    }
    
    /* Show sidebar when menu is opened */
    body.sidebar-open .main-sidebar {
        left: 0 !important;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Ensure proper rendering after open */
    body.sidebar-open .main-sidebar.sidebar-visible {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force proper layout on mobile */
    .main-sidebar .sidebar {
        display: block !important;
        width: 100% !important;
    }
    
    .main-sidebar .nav-sidebar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .main-sidebar .nav-sidebar .nav-item {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        position: relative !important;
    }
    
    .main-sidebar .nav-sidebar .nav-item.has-treeview > .nav-treeview {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        float: none !important;
    }
    
    .main-sidebar .nav-sidebar .nav-link {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        white-space: normal !important;
    }
    
    .main-sidebar .nav-sidebar .nav-link p {
        display: inline-block !important;
        flex: 1 !important;
        margin: 0 !important;
    }

    .main-sidebar .nav-sidebar .nav-treeview > .nav-item > .nav-link {
        display: flex !important;
        align-items: center !important;
        transform: none !important;
    }
    
    /* Content wrapper takes full width on mobile */
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative !important;
    }
    
    /* Add overlay when sidebar is open */
    body.sidebar-open::before {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 1040 !important;
        pointer-events: auto !important;
    }
    
    /* Navbar stays at top */
    .main-header {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        z-index: 1030 !important;
    }
    
    /* Hide any sidebar mini mode on mobile */
    body.sidebar-mini .main-sidebar,
    body.sidebar-collapse .main-sidebar,
    body.sidebar-mini.sidebar-collapse .main-sidebar {
        left: -320px !important;
        margin-left: 0 !important;
    }
    
    body.sidebar-mini.sidebar-open .main-sidebar {
        left: 0 !important;
    }
    
    /* Better touch targets */
    body:not(.super-admin-shell) .nav-sidebar .nav-item > .nav-link,
    .nav-sidebar .nav-link {
        padding: 0.8rem 1rem !important;
        font-size: 1rem !important;
    }
    
    .nav-sidebar .nav-treeview > .nav-item > .nav-link {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
        font-size: 0.92rem !important;
    }
}

/* Tablet View Optimization */
@media (min-width: 768px) and (max-width: 991.98px) {
    .main-sidebar .brand-link {
        padding: 1rem 0.75rem !important;
    }
    
    body:not(.super-admin-shell) .nav-sidebar .nav-item > .nav-link,
    .nav-sidebar .nav-link {
        margin: 0 0.35rem !important;
        padding: 0.65rem 0.85rem !important;
        font-size: 0.92rem !important;
    }
}

/* Small Mobile Optimization */
@media (max-width: 575.98px) {
    .main-sidebar {
        width: 100% !important;
        max-width: 280px !important;
    }
    
    .nav-sidebar .nav-header {
        font-size: 0.7rem !important;
        padding-left: 0.85rem !important;
    }
}

/* ---- Top navbar ---- */
.main-header .navbar-nav .nav-link {
    border-radius: 0.375rem;
}
.main-header .navbar-nav .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ============================================
   TOP NAVBAR - Modern Improvements
   ============================================ */

.main-header.navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
}

.main-header .navbar-nav .nav-item {
    margin: 0 0.15rem;
}

.main-header .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.main-header .navbar-nav .nav-link:hover {
    background-color: rgba(13, 148, 136, 0.08);
    transform: translateY(-1px);
}

.main-header .navbar-nav .nav-link i {
    font-size: 1.1rem;
}

/* Notification Bell - Enhanced */
#navbar-notifications-bell {
    position: relative;
}

#navbar-notifications-bell .badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.65rem;
    padding: 0.2rem 0.35rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Dropdown Menus - Modern Style */
.dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-header {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem 0.25rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background-color: rgba(0, 123, 255, 0.08);
    transform: translateX(2px);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: #0d6efd;
    color: white;
    font-weight: 500;
}

.dropdown-item.active:hover,
.dropdown-item:active:hover {
    background-color: #0b5ed7;
    color: white;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0, 0, 0, 0.08);
}

.dropdown-toggle {
    transition: all 0.15s ease;
}

.dropdown-toggle:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15) !important;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
    transition: transform 0.15s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Pushmenu Button - Better Style */
[data-widget="pushmenu"] {
    transition: all 0.2s ease;
}

[data-widget="pushmenu"]:hover {
    background-color: rgba(13, 148, 136, 0.1);
}

/* Content Wrapper - Better Spacing */
.content-wrapper {
    background-color: #f8f9fa;
    min-height: calc(100vh - 3.5rem);
}

.content-header {
    padding: 1.5rem 1rem 1rem;
}

.content-header h1 {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.75rem;
    margin-bottom: 0;
}

.content {
    padding: 1.25rem 1rem 1.5rem;
}

/* Full-bleed editors (workflow, inbox): slightly tighter — still room for flash notices */
.content.content-no-page-title {
    padding-top: 1rem;
}
.content.content-no-page-title > .container-fluid > .card:first-child {
    margin-top: 0 !important;
}

/* Breadcrumbs - Modern Style */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(0, 0, 0, 0.4);
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
}

/* Mobile Navbar Improvements */
@media (max-width: 767.98px) {
    .main-header.navbar {
        padding: 0.4rem 0.75rem;
    }
    
    .main-header .navbar-nav .nav-link {
        padding: 0.4rem 0.6rem;
    }
    
    .content-header {
        padding: 1rem 0.75rem 0.75rem;
    }
    
    .content-header h1 {
        font-size: 1.4rem;
    }
    
    .content {
        padding: 1rem 0.75rem 1rem;
    }
}

/* ---- Alerts: clearer hierarchy ---- */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid transparent;
}
.alert-success { border-left-color: #28a745; }
.alert-danger { border-left-color: #dc3545; }
.alert-warning { border-left-color: #ffc107; }
.alert-info { border-left-color: #17a2b8; }

/* ---- Empty states ---- */
.card-body .text-muted.text-center,
.card-body p.text-muted.text-center {
    padding: 2rem 1rem;
    font-size: 0.95rem;
}
.card-body .list-unstyled:empty::before,
.table tbody tr td.text-center.text-muted {
    color: #6c757d;
}

/* ---- Form controls: focus ring and hover ---- */
.form-control:focus,
.form-select:focus,
select.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    outline: none;
}

.form-control:hover,
.form-select:hover,
select.form-control:hover {
    border-color: #cbd5e1;
}

.form-control,
.form-select,
select.form-control {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* ---- Content area ---- */
.content-header h1 {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.5rem;
}
.content {
    padding-top: 1.25rem;
}

/* Ensure consistent top spacing on all pages */
.content-wrapper > .content > .container-fluid > .row:first-child,
.content-wrapper > .content > .container-fluid > .card:first-child,
.content-wrapper > .content > .card:first-child,
.content-wrapper > .content > .row:first-child {
    margin-top: 1rem;
}

.main-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    border-radius: 0.375rem;
}

/* ---- Dropdowns ---- */
.dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 2px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 123, 255, 0.08);
}

.dropdown-item:active,
.dropdown-item.active {
    background-color: #0d6efd;
    color: white;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 0.5rem 0.75rem 0.25rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0, 0, 0, 0.08);
}

.dropdown-toggle {
    transition: all 0.15s ease;
}

.dropdown-toggle:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15) !important;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
    transition: transform 0.15s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* ---- List groups ---- */
.list-group-item {
    transition: background-color 0.15s ease;
}
.list-group-item-action:hover {
    background-color: rgba(0, 123, 255, 0.04);
}

/* ---- Pagination ---- */
.page-link {
    border-radius: 0.375rem !important;
    font-weight: 500;
}
.page-item.active .page-link {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ---- Modal ---- */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15);
}

/* ---- Password show/hide toggle (admin, super admin, login, register) ---- */
.password-toggle-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.password-toggle-wrap .form-control {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
    color: #0d9488;
    background: rgba(13, 148, 136, 0.08);
    outline: none;
}

.password-toggle-btn--input-group {
    position: static;
    transform: none;
    flex-shrink: 0;
    width: auto;
    min-width: 2.5rem;
    height: calc(1.5em + 0.75rem + 2px);
    border: 1px solid #ced4da;
    border-left: 0;
    border-radius: 0 0.375rem 0.375rem 0;
    background: #fff;
}

.input-group .password-toggle-btn--input-group:hover,
.input-group .password-toggle-btn--input-group:focus {
    background: #f8fafc;
}

.guest-page .password-toggle-btn {
    color: #94a3b8;
}

.guest-page .password-toggle-btn:hover,
.guest-page .password-toggle-btn:focus {
    color: #0d9488;
    background: rgba(13, 148, 136, 0.1);
}

/* ============================================
   PAGE LOADER - Modern particle wave loader
   ============================================ */

#techone-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.45) 0%, rgba(14, 116, 144, 0.45) 50%, rgba(99, 102, 241, 0.45) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

#techone-page-loader::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: loaderPulse 4s ease-in-out infinite;
}

#techone-page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

.loader-spinner {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    position: relative;
}

/* Particle dots animation */
.loader-spinner::before,
.loader-spinner::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 1),
        0 0 60px rgba(255, 255, 255, 0.7),
        0 0 90px rgba(13, 148, 136, 0.5);
}

.loader-spinner::before {
    animation: particleOrbit1 2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.loader-spinner::after {
    animation: particleOrbit2 2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

/* Center pulsing core */
.loader-spinner {
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 40%, rgba(13, 148, 136, 0.3) 70%, transparent 80%);
    border-radius: 50%;
    animation: coreGlow 2s ease-in-out infinite;
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.8),
        0 0 80px rgba(13, 148, 136, 0.6);
}

.loader-text {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 
        0 0 20px rgba(13, 148, 136, 1),
        0 0 40px rgba(13, 148, 136, 0.8),
        0 2px 10px rgba(0, 0, 0, 0.8),
        0 4px 20px rgba(0, 0, 0, 0.6);
    animation: textGlow 2s ease-in-out infinite;
}

/* Wave dots under text */
.loader-content::after {
    content: '';
    display: block;
    width: 150px;
    height: 30px;
    margin: 15px auto 0;
    background: 
        radial-gradient(circle, #fff 4px, transparent 4px),
        radial-gradient(circle, #fff 4px, transparent 4px),
        radial-gradient(circle, #fff 4px, transparent 4px),
        radial-gradient(circle, #fff 4px, transparent 4px);
    background-size: 20px 20px;
    background-position: 
        0px 15px,
        30px 15px,
        60px 15px,
        90px 15px;
    background-repeat: no-repeat;
    animation: waveDots 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

@keyframes particleOrbit1 {
    0%, 100% {
        transform: translate(-50px, 0) scale(1);
        opacity: 1;
    }
    25% {
        transform: translate(0, -50px) scale(1.2);
        opacity: 0.9;
    }
    50% {
        transform: translate(50px, 0) scale(1);
        opacity: 1;
    }
    75% {
        transform: translate(0, 50px) scale(0.8);
        opacity: 0.7;
    }
}

@keyframes particleOrbit2 {
    0%, 100% {
        transform: translate(50px, 0) scale(1);
        opacity: 1;
    }
    25% {
        transform: translate(0, 50px) scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50px, 0) scale(1);
        opacity: 1;
    }
    75% {
        transform: translate(0, -50px) scale(1.2);
        opacity: 0.9;
    }
}

@keyframes coreGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes loaderPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.6;
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(13, 148, 136, 1),
            0 0 40px rgba(13, 148, 136, 0.8),
            0 2px 10px rgba(0, 0, 0, 0.8),
            0 4px 20px rgba(0, 0, 0, 0.6);
    }
    50% {
        text-shadow: 
            0 0 30px rgba(13, 148, 136, 1),
            0 0 60px rgba(13, 148, 136, 1),
            0 0 90px rgba(255, 255, 255, 0.6),
            0 2px 15px rgba(0, 0, 0, 0.8),
            0 4px 30px rgba(0, 0, 0, 0.6);
    }
}

@keyframes waveDots {
    0% {
        background-position: 
            0px 15px,
            30px 15px,
            60px 15px,
            90px 15px;
    }
    25% {
        background-position: 
            0px 10px,
            30px 15px,
            60px 15px,
            90px 15px;
    }
    50% {
        background-position: 
            0px 15px,
            30px 10px,
            60px 15px,
            90px 15px;
    }
    75% {
        background-position: 
            0px 15px,
            30px 15px,
            60px 10px,
            90px 15px;
    }
    100% {
        background-position: 
            0px 15px,
            30px 15px,
            60px 15px,
            90px 10px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #techone-page-loader {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    #techone-page-loader::before {
        animation: none;
    }
    .loader-content {
        animation: none;
    }
    .loader-spinner::before,
    .loader-spinner::after {
        animation: particleOrbit1 3s linear infinite;
    }
    .loader-spinner {
        animation: none;
        opacity: 1;
    }
    .loader-text {
        animation: none;
        text-shadow: 
            0 0 20px rgba(13, 148, 136, 1),
            0 0 40px rgba(13, 148, 136, 0.8),
            0 2px 10px rgba(0, 0, 0, 0.8),
            0 4px 20px rgba(0, 0, 0, 0.6);
    }
    .loader-content::after {
        animation: waveDots 2s ease-in-out infinite;
    }
}

@media (max-width: 768px) {
    .loader-spinner {
        width: 80px;
        height: 80px;
    }
    .loader-spinner::before,
    .loader-spinner::after {
        width: 14px;
        height: 14px;
    }
    .loader-text {
        font-size: 16px;
        text-shadow: 
            0 0 15px rgba(13, 148, 136, 1),
            0 0 30px rgba(13, 148, 136, 0.8),
            0 2px 8px rgba(0, 0, 0, 0.8),
            0 4px 16px rgba(0, 0, 0, 0.6);
    }
}

/* ==========================================
   PROFESSIONAL UI - GLOBAL STYLING
   Clean links, no underlines, polished
   ========================================== */

/* Remove underlines from all links */
a {
    text-decoration: none !important;
}

a:hover,
a:focus {
    text-decoration: none !important;
}

/* Alert links remain underlined for visibility */
.alert a,
.alert-info a,
.alert-warning a,
.alert-success a,
.alert-danger a {
    text-decoration: underline !important;
    text-underline-offset: 2px;
    font-weight: 600;
}

.alert a:hover {
    text-decoration-thickness: 2px !important;
}

/* Button focus states - professional glow */
.btn:focus,
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.btn-success:focus,
.btn-success:focus-visible {
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15) !important;
}

.btn-danger:focus,
.btn-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.btn-warning:focus,
.btn-warning:focus-visible {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
}

.btn-info:focus,
.btn-info:focus-visible {
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Form control focus - clean glow */
.form-control:focus,
.form-select:focus,
select.form-control:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
}

/* Disabled buttons - consistent opacity */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Flex gap utilities */
.d-flex.gap-1 {
    gap: 0.25rem;
}

.d-flex.gap-2 {
    gap: 0.5rem;
}

.d-flex.gap-3 {
    gap: 1rem;
}

/* Icon spacing in buttons */
.btn i:first-child {
    margin-right: 0.35rem;
}

.btn i:last-child:not(:first-child) {
    margin-left: 0.35rem;
}

/* Dropdown menus - professional shadow */
.dropdown-menu {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
    border-radius: 0.5rem;
}

.dropdown-item {
    transition: background-color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f8fafc;
}

/* Modal styling */
.modal-content {
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

.modal-header {
    border-bottom-color: #e2e8f0;
}

.modal-footer {
    border-top-color: #e2e8f0;
}

/* List group items */
.list-group-item {
    border-color: #e2e8f0;
    transition: background-color 0.15s ease;
}

.list-group-item:hover {
    background-color: #f8fafc;
}

/* Professional scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Table links - clean */
.table a:not(.btn) {
    color: #0f172a;
    font-weight: 500;
    transition: color 0.15s ease;
}

.table a:not(.btn):hover {
    color: #2563eb;
}

/* Badge consistency */
.badge {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

/* Progress bars */
.progress {
    border-radius: 999px;
    background-color: #f1f5f9;
}

.progress-bar {
    border-radius: 999px;
}

/* Clean breadcrumbs */
.breadcrumb {
    background: transparent;
}

/* Tooltip styling */
.tooltip-inner {
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
}

/* Card link hover */
a.card,
.card.clickable {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.card:hover,
.card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Tasks / filter bars: keep selects in a tidy grid (not full-width stacked) */
.toc-filter-bar > [class*="col-"] {
    min-width: 0;
}
.toc-filter-bar .form-control,
.toc-filter-bar select.form-control {
    width: 100%;
    max-width: 100%;
}
.toc-toolbar-actions .form-control,
.toc-toolbar-actions .form-control-sm {
    width: auto !important;
    max-width: 12rem;
    flex: 0 0 auto;
}
.toc-toolbar-actions .btn {
    flex: 0 0 auto !important;
    white-space: nowrap;
}

/* Google Business actions stay right, never stretch */
.gbp-module-card > .card-header:first-child .card-tools {
    display: inline-flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    width: auto !important;
    margin-left: auto !important;
    float: none !important;
    flex: 0 0 auto !important;
}
.gbp-module-card > .card-header:first-child .card-tools .btn {
    flex: 0 0 auto !important;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .gbp-module-card > .card-header:first-child .card-tools {
        width: 100% !important;
    }
    .gbp-module-card > .card-header:first-child .card-tools .btn {
        flex: 1 1 auto !important;
    }
}
