/* ============================================
   E-Filing Dashboard Styles
   Comprehensive dashboard UI/UX overhaul
   ============================================ */

/* --- Global: Prevent horizontal scroll --- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.page-wrapper {
    overflow-x: hidden;
    max-width: 100%;
}

/* Let the header-top bar wrap nicely on smaller screens */
.header-top .container {
    max-width: 100%;
}

/* The fixed header must not push content right */
header.header.fixed {
    width: 100%;
    overflow: visible;
}

/* --- Welcome Banner --- */
.dashboard-welcome {
    background: linear-gradient(135deg, #293503 0%, #3d4f0a 100%);
    color: #fff;
    border-radius: 10px;
    padding: 22px 28px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(41, 53, 3, 0.2);
}

.dashboard-welcome .welcome-text h2 {
    color: #fff !important;
    font-size: 20px;
    margin: 0 0 4px 0 !important;
    font-weight: 600;
    text-transform: none !important;
}

.dashboard-welcome .welcome-text p {
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    font-size: 13px;
}

.dashboard-welcome .welcome-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   SIDEBAR WIDGETS — Payable / Paid / Balance
   ============================================ */
.stat-widget {
    border-radius: 10px;
    padding: 0;
    margin-bottom: 18px;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
}

.stat-widget:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-widget .stat-header {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-widget .stat-header i {
    font-size: 16px;
}

.stat-widget .stat-body {
    padding: 6px 18px 12px;
    background: #fff;
}

.stat-widget .stat-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stat-widget .stat-body ul li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.stat-widget .stat-body ul li:hover {
    background: #fafaf8;
    margin: 0 -18px;
    padding-left: 18px;
    padding-right: 18px;
}

.stat-widget .stat-body ul li:last-child {
    border-bottom: 0;
}

.stat-widget .stat-body ul li .stat-label {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-widget .stat-body ul li .stat-label i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    opacity: 0.7;
}

.stat-widget .stat-body ul li .stat-value {
    font-size: 16px;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Matters widget - Blue theme */
.stat-widget.widget-matters .stat-header {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
}

.stat-widget.widget-matters .stat-value {
    color: #1565c0;
}

/* Payments widget - Green theme */
.stat-widget.widget-payments .stat-header {
    background: linear-gradient(135deg, #2e7d32, #388e3c);
    color: #fff;
}

.stat-widget.widget-payments .stat-value {
    color: #2e7d32;
}

/* ============================================
   oWidget (legacy sidebar widgets from API)
   ============================================ */
.oWidget.jsJobApplications {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.oWidget.jsJobApplications > header {
    padding: 14px 18px;
    margin: 0;
}

.oWidget.jsJobApplications > header .oH3 {
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 !important;
    font-weight: 700;
}

.oWidget.jsJobApplications .oBd {
    padding: 6px 18px 12px;
    background: #fff;
}

.oWidget.jsJobApplications .oPlainList {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.oWidget.jsJobApplications .oPlainList li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0ed;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oWidget.jsJobApplications .oPlainList li:last-child {
    border-bottom: 0;
}

.oWidget.jsJobApplications .oTxtLarge,
.oWidget.jsJobApplications .jsInvitations,
.oWidget.jsJobApplications .jsApplications {
    font-weight: 600;
    text-decoration: none !important;
}

/* ============================================
   NAV TABS (API-injected tabs)
   ============================================ */
#jsCenterColumn .nav-tabs,
#dashboardLoaded .nav-tabs,
.tab-content .nav-tabs {
    border-bottom: 2px solid #e8e8e5;
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

#jsCenterColumn .nav-tabs > li,
#dashboardLoaded .nav-tabs > li {
    margin-bottom: -2px;
}

#jsCenterColumn .nav-tabs > li > a,
#dashboardLoaded .nav-tabs > li > a {
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    padding: 12px 18px;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    background: transparent !important;
}

#jsCenterColumn .nav-tabs > li > a:hover,
#dashboardLoaded .nav-tabs > li > a:hover {
    color: #293503;
    background: #fafaf8 !important;
    border-bottom-color: #CFB53B !important;
}

#jsCenterColumn .nav-tabs > li.active > a,
#jsCenterColumn .nav-tabs > li.active > a:focus,
#jsCenterColumn .nav-tabs > li.active > a:hover,
#dashboardLoaded .nav-tabs > li.active > a,
#dashboardLoaded .nav-tabs > li.active > a:focus,
#dashboardLoaded .nav-tabs > li.active > a:hover {
    color: #293503 !important;
    border-bottom: 3px solid #293503 !important;
    background: transparent !important;
}

#jsCenterColumn .nav-tabs > li > a h3,
#dashboardLoaded .nav-tabs > li > a h3 {
    font-size: 13px !important;
    color: inherit !important;
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   TAB CONTENT AREA
   ============================================ */
#jsCenterColumn .tab-content,
#dashboardLoaded .tab-content {
    padding-top: 15px;
}

#jsCenterColumn .tab-pane .well-lg,
#dashboardLoaded .tab-pane .well-lg,
#jsCenterColumn .tab-pane .ibox,
#dashboardLoaded .tab-pane .ibox {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* ============================================
   CASE ARTICLE CARDS (API-injected)
   ============================================ */
#jsCenterColumn article.oJobTile,
#dashboardLoaded article.oJobTile,
article.oMed.oJobTile {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    position: relative;
}

#jsCenterColumn article.oJobTile:hover,
#dashboardLoaded article.oJobTile:hover,
article.oMed.oJobTile:hover {
    border-color: #CFB53B;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

/* Case title */
article.oJobTile .oRowTitle.oH3 {
    font-size: 14px !important;
    font-weight: 600;
    margin-bottom: 8px !important;
    margin-top: 0 !important;
    line-height: 1.4;
}

article.oJobTile .oRowTitle.oH3 a,
article.oJobTile .oRowTitle a.oVisitedLink {
    color: #293503 !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

article.oJobTile .oRowTitle.oH3 a:hover,
article.oJobTile .oRowTitle a.oVisitedLink:hover {
    color: #CFB53B !important;
}

/* Support info row (fees, balance, dates) */
article.oJobTile .oSupportInfo {
    font-size: 12.5px;
    color: #777;
    padding: 4px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

article.oJobTile .oSupportInfo strong.jsType {
    color: #555;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

article.oJobTile .oSupportInfo span.jsBudget {
    color: #2e7d32;
    font-weight: 700;
    font-size: 13px;
}

/* Description */
article.oJobTile .oDescription {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 6px 0;
}

/* Action buttons (Edit, Pay, View) */
article.oJobTile .oRight {
    position: absolute;
    top: 14px;
    right: 14px;
}

article.oJobTile .oRight .btn-edit,
article.oJobTile .oRight .btn-default,
article.oJobTile .oRight .btn-sm {
    border-radius: 6px !important;
    padding: 5px 10px;
    font-size: 12px;
    margin-left: 4px;
    border: 1px solid #ddd;
    transition: all 0.15s ease;
}

article.oJobTile .oRight .btn-edit:hover,
article.oJobTile .oRight .btn-default:hover,
article.oJobTile .oRight .btn-sm:hover {
    background: #293503;
    color: #fff;
    border-color: #293503;
}

/* Skills/Parties tags */
article.oJobTile .oSkills .oTagSmall,
article.oJobTile .oSkills .oSkill {
    display: inline-block;
    background: #f0f0ed;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin: 2px 3px 2px 0;
    border: 1px solid #e0e0dc;
}

/* Section header inside tabs */
#jsCenterColumn .oRowTitle.oH2High,
#dashboardLoaded .oRowTitle.oH2High {
    font-size: 15px !important;
    color: #333 !important;
    font-weight: 600;
    text-transform: none !important;
}

/* ============================================
   TABLES (API-injected case / payment tables)
   ============================================ */
#jsCenterColumn .table,
#dashboardLoaded .table,
.jambo_table,
table.table-colored {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e5;
    width: 100%;
    margin-bottom: 20px;
    font-size: 13px;
}

#jsCenterColumn .table thead th,
#jsCenterColumn .table thead td,
#dashboardLoaded .table thead th,
#dashboardLoaded .table thead td,
.jambo_table thead th,
table.table-colored thead td,
table.table-colored thead th {
    background: #293503 !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 14px;
    border: none !important;
    white-space: nowrap;
}

#jsCenterColumn .table thead th:first-child,
.jambo_table thead th:first-child,
table.table-colored thead td:first-child {
    border-radius: 8px 0 0 0;
}

#jsCenterColumn .table thead th:last-child,
.jambo_table thead th:last-child,
table.table-colored thead td:last-child {
    border-radius: 0 8px 0 0;
}

#jsCenterColumn .table tbody tr,
#dashboardLoaded .table tbody tr,
.jambo_table tbody tr,
table.table-colored tbody tr {
    transition: background 0.15s ease;
}

#jsCenterColumn .table tbody tr:hover,
#dashboardLoaded .table tbody tr:hover,
.jambo_table tbody tr:hover,
table.table-colored tbody tr:hover {
    background-color: #fdfdf5 !important;
}

#jsCenterColumn .table tbody td,
#dashboardLoaded .table tbody td,
.jambo_table tbody td,
table.table-colored tbody td {
    padding: 11px 14px;
    border-top: 1px solid #f0f0ed;
    color: #444;
    vertical-align: middle;
}

#jsCenterColumn .table tbody tr:nth-child(even),
#dashboardLoaded .table tbody tr:nth-child(even),
.jambo_table tbody tr.even,
table.table-colored tbody tr:nth-child(even) {
    background-color: #fafaf8;
}

#jsCenterColumn .table tfoot td,
#dashboardLoaded .table tfoot td,
table.table-colored tfoot td {
    background: #f5f5f0;
    font-weight: 700;
    padding: 11px 14px;
    border-top: 2px solid #e0e0dc;
    color: #293503;
}

/* Table action buttons */
#jsCenterColumn .table .btn-xs,
#dashboardLoaded .table .btn-xs,
.jambo_table .btn-xs,
table.table-colored .btn-xs {
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
}

/* Payment status labels */
.label-danger {
    background-color: #c62828 !important;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}

.label-success {
    background-color: #2e7d32 !important;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}

.label-default {
    background-color: #757575 !important;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
}

/* Table responsive wrapper */
#jsCenterColumn .table-responsive,
#dashboardLoaded .table-responsive {
    border: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   ACTION BAR (File New Case / Search row)
   Targets the .well-lg action bar from dashboard_state.php
   ============================================ */
#dashboardLoaded .row[style*="background:#F0F0ED"],
#dashboardLoaded .row[style*="background: #F0F0ED"] {
    background: #f8f8f6 !important;
    border-radius: 8px;
    border: 1px solid #e8e8e5;
    padding: 12px 15px !important;
    margin-bottom: 16px !important;
}

#dashboardLoaded .btn-primary {
    background: #293503 !important;
    border-color: #293503 !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    padding: 7px 14px;
    transition: all 0.2s ease;
}

#dashboardLoaded .btn-primary:hover {
    background: #3d4f0a !important;
    border-color: #3d4f0a !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(41,53,3,0.2);
}

/* ============================================
   SMALL-BOX REPORT CARDS (Probation/Reports)
   Targets .small-box from dashboard_state.php
   ============================================ */
#dashboardLoaded .small-box {
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#dashboardLoaded .small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

#dashboardLoaded .small-box h3 {
    color: #fff !important;
}

#dashboardLoaded .small-box p {
    letter-spacing: 0.3px;
}

#dashboardLoaded .small-box .small-box-footer {
    background: #293503 !important;
    border-radius: 0 0 10px 10px;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 0;
}

/* DataTables overrides for #cases table */
#dashboardLoaded .dataTables_wrapper .dataTables_length select,
#dashboardLoaded .dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d2d2cd;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
}

#dashboardLoaded .dataTables_wrapper .dataTables_info {
    font-size: 12px;
    color: #888;
    padding: 8px 0;
}

#dashboardLoaded .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    border: 1px solid #e8e8e5 !important;
    margin: 0 2px;
    font-size: 12px;
    padding: 5px 12px !important;
}

#dashboardLoaded .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #293503 !important;
    color: #fff !important;
    border-color: #293503 !important;
}

#dashboardLoaded .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f0f0ed !important;
    color: #293503 !important;
    border-color: #d2d2cd !important;
}

/* btn-link inside tables */
#dashboardLoaded .btn-link {
    color: #293503 !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

#dashboardLoaded .btn-link:hover {
    color: #CFB53B !important;
    text-decoration: underline;
}

/* ============================================
   STATISTICS TILES (dashboard_user.php)
   ============================================ */
.tile_count {
    margin-bottom: 20px;
}

.tile_stats_count {
    background: #fff;
    border-radius: 8px !important;
    border: 1px solid #e8e8e5 !important;
    padding: 16px !important;
    margin: 0 8px 12px 0;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tile_stats_count:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.tile_stats_count::before {
    display: none !important;
}

.tile_stats_count .count_top {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
}

.tile_stats_count .count {
    font-size: 28px !important;
    font-weight: 700;
    line-height: 1.3;
    margin: 6px 0;
}

.tile_stats_count .count.red {
    color: #c62828 !important;
}

.tile_stats_count .count.green {
    color: #2e7d32 !important;
}

.alert2.alert-success {
    background: #293503;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    border: none;
    margin-bottom: 12px !important;
}

/* ============================================
   DASHBOARD STAT PANELS (Admin - efiling/dashboard.php)
   ============================================ */
.dashboard-stat-panel {
    border-radius: 10px;
    border: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-stat-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.dashboard-stat-panel .panel-heading {
    padding: 22px 15px 18px;
}

.dashboard-stat-panel .panel-heading i.fa {
    opacity: 0.7;
    margin-bottom: 6px;
}

.dashboard-stat-panel .panel-heading h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.9;
    margin-bottom: 10px !important;
    color: #fff !important;
}

.dashboard-stat-panel .badge {
    font-size: 22px;
    padding: 8px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.2) !important;
    font-variant-numeric: tabular-nums;
}

.dashboard-stat-panel .panel-footer {
    padding: 10px 15px;
    font-size: 13px;
    transition: background 0.2s ease;
    color: #fff;
}

.dashboard-stat-panel .panel-footer a,
.dashboard-stat-panel .panel-footer span {
    color: #fff !important;
}

.dashboard-stat-panel .panel-footer:hover {
    filter: brightness(1.1);
}

/* Pending Cases - Amber */
.panel-stat-pending { background: linear-gradient(135deg, #f57c00, #e65100) !important; color: #fff; }
.panel-stat-pending .panel-footer { background-color: rgba(0,0,0,0.12) !important; border-top: 1px solid rgba(255,255,255,0.15); }

/* All Cases - Blue */
.panel-stat-all { background: linear-gradient(135deg, #1565c0, #0d47a1) !important; color: #fff; }
.panel-stat-all .panel-footer { background-color: rgba(0,0,0,0.12) !important; border-top: 1px solid rgba(255,255,255,0.15); }

/* Payment - Green */
.panel-stat-payment { background: linear-gradient(135deg, #2e7d32, #1b5e20) !important; color: #fff; }
.panel-stat-payment .panel-footer { background-color: rgba(0,0,0,0.12) !important; border-top: 1px solid rgba(255,255,255,0.15); }

/* Balance - Red */
.panel-stat-balance { background: linear-gradient(135deg, #c62828, #b71c1c) !important; color: #fff; }
.panel-stat-balance .panel-footer { background-color: rgba(0,0,0,0.12) !important; border-top: 1px solid rgba(255,255,255,0.15); }

/* ============================================
   MAIL / MESSAGE LIST
   ============================================ */
.mail_list_column {
    border-right: 1px solid #e8e8e5 !important;
    max-height: 500px;
    overflow-y: auto;
}

.mail_list_column::-webkit-scrollbar {
    width: 5px;
}

.mail_list_column::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.mail_list {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0ed;
    transition: background 0.15s ease;
    cursor: pointer;
}

.mail_list:hover {
    background: #fdfdf5 !important;
}

.mail_list.unread {
    background-color: #e8f4fd !important;
    border-left: 3px solid #1565c0;
}

.mail_list .right h3 {
    font-size: 13px !important;
    color: #333 !important;
    font-weight: 600;
    margin-bottom: 3px !important;
}

.mail_list .right h5 {
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
}

.mail_list .right p {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton-container { padding: 20px 0; }

.skeleton-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.skeleton-block {
    background: linear-gradient(90deg, #f0f0ed 25%, #e8e8e5 50%, #f0f0ed 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-banner { height: 80px; width: 100%; margin-bottom: 15px; }
.skeleton-card { height: 90px; flex: 1; }
.skeleton-table-header { height: 42px; width: 100%; margin-bottom: 8px; }
.skeleton-table-row { height: 36px; width: 100%; margin-bottom: 6px; opacity: 0.7; }
.skeleton-sidebar-widget { height: 120px; width: 100%; margin-bottom: 15px; }

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   PRELOADER / PLACEHOLDER — Modern Overlay
   Replaces the old yellow "Please Wait..." bar
   with a centered overlay + spinner
   ============================================ */
.placeholder.oLoading,
.placeholder.oIndicatorMsg,
div > .placeholder.oLoading.oIndicatorMsg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 99999 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #293503 !important;
    letter-spacing: 0.3px;
    animation: none !important;
    text-align: center;
    cursor: wait;
}

.placeholder.oLoading.hide,
.placeholder.oIndicatorMsg.hide,
div > .placeholder.oLoading.oIndicatorMsg.hide {
    display: none !important;
}

/* Spinner created via ::before pseudo-element */
.placeholder.oLoading::before,
.placeholder.oIndicatorMsg::before,
div > .placeholder.oLoading.oIndicatorMsg::before {
    content: '';
    display: block;
    width: 44px;
    height: 44px;
    border: 4px solid #e8e8e5;
    border-top-color: #293503;
    border-radius: 50%;
    animation: preloader-spin 0.75s linear infinite;
}

@keyframes preloader-spin {
    to { transform: rotate(360deg); }
}

/* Sub-text hint */
.placeholder.oLoading::after,
.placeholder.oIndicatorMsg::after,
div > .placeholder.oLoading.oIndicatorMsg::after {
    content: 'Please wait…';
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin-top: -4px;
}

/* ============================================
   ERROR STATE
   ============================================ */
.dashboard-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.dashboard-error .error-icon { font-size: 48px; color: #c62828; margin-bottom: 15px; }
.dashboard-error h3 { color: #333 !important; font-size: 18px !important; text-transform: none !important; margin-bottom: 10px !important; }
.dashboard-error p { color: #888; margin-bottom: 20px; font-size: 14px; }

.dashboard-error .btn-retry {
    background: #293503;
    color: #fff;
    border: 0;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.dashboard-error .btn-retry:hover { background: #3d4f0a; }

/* ============================================
   FILE NEW CASE BUTTON (Prominent CTA)
   ============================================ */
.btn-file-new-case {
    background: linear-gradient(135deg, #293503, #3d4f0a) !important;
    color: #fff !important;
    border: 0;
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(41, 53, 3, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-file-new-case:hover {
    background: linear-gradient(135deg, #3d4f0a, #4e6310) !important;
    box-shadow: 0 5px 16px rgba(41, 53, 3, 0.35);
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none !important;
}

.btn-file-new-case i { font-size: 15px; }

/* ============================================
   SEARCH BAR
   ============================================ */
.dashboard-search-bar {
    background: #f8f8f6;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    border: 1px solid #e8e8e5;
}

.dashboard-search-bar .form-control {
    border-radius: 6px 0 0 6px;
    border: 1px solid #d2d2cd;
    height: 42px;
    font-size: 13px;
}

.dashboard-search-bar .btn-search {
    border-radius: 0 6px 6px 0;
    height: 42px;
    padding: 8px 18px;
}

/* ============================================
   hpanel overrides (API stat panels)
   ============================================ */
#jsCenterColumn .hpanel,
#dashboardLoaded .hpanel {
    border-radius: 10px;
    border: 0 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

#jsCenterColumn .hpanel .panel-body,
#dashboardLoaded .hpanel .panel-body {
    border: none !important;
    border-radius: 10px 10px 0 0;
}

#jsCenterColumn .hpanel .panel-footer,
#dashboardLoaded .hpanel .panel-footer {
    border: none !important;
    border-radius: 0 0 10px 10px;
}

/* ============================================
   MODAL ENHANCEMENTS
   ============================================ */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #f0f0ed;
    padding: 16px 20px;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}

/* ============================================
   GLOBAL OVERRIDES for injected content
   ============================================ */

/* Better badge styling */
#jsCenterColumn .badge,
#dashboardLoaded .badge {
    border-radius: 6px;
    font-weight: 600;
    padding: 5px 10px;
}

/* DataTables processing overlay */
div.dataTables_wrapper div.dataTables_processing {
    border-radius: 6px !important;
    font-size: 13px;
    font-weight: 600;
}

/* Section divider rows */
#jsCenterColumn .row[style*="border-bottom"],
#dashboardLoaded .row[style*="border-bottom"] {
    margin-bottom: 12px;
}

/* ============================================
   RESPONSIVE (Global for all pages)
   ============================================ */

/* --- Responsive containers for all pages --- */
.container, .container-fluid, .well, .panel, .row {
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: auto;
}

/* --- Responsive tables for all pages --- */
.table-responsive, .responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.table-responsive::after, .responsive-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 24px;
    pointer-events: none;
    background: linear-gradient(to left, #fff 60%, rgba(255,255,255,0));
    display: none;
}

@media (max-width: 768px) {
    .table-responsive::after, .responsive-table-wrapper::after {
        display: block;
    }
}

.table, .table-colored, .jambo_table, #cases {
    min-width: 600px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .table, .table-colored, .jambo_table, #cases {
        font-size: 12px;
        min-width: 480px;
    }
}

/* --- Responsive breakpoints for all main containers --- */
@media (max-width: 768px) {
    .container, .container-fluid, .well, .panel, .row {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}

/* ============================================
   PAYMENT CARDS (Payable / Paid / Balance)
   Targets the .card divs from dashboard_state.php
   ============================================ */

/* Row wrapper — the .well-lg with the 3 payment cards */
.payment-cards-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 18px;
    padding: 20px !important;
    background: #f8f8f6 !important;
    border: 1px solid #e8e8e5 !important;
    border-radius: 10px !important;
    border-bottom: none !important;
    margin-bottom: 16px !important;
    align-items: stretch;
}

.payment-cards-row > [class*="col-"],
.payment-cards-row > .payment-col {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    /* padding: 0 !important; */
    float: none !important;
}

/* Enhanced payment card */
.payment-card {
    display: flex !important;
    align-items: center;
    gap: 16px;
    background: #fff !important;
    border-radius: 10px !important;
    padding: 20px 22px !important;
    margin: 0 !important;
    border: 1px solid #e8e8e5 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    font-size: 14px !important;
    height: 100%;
}

.payment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.payment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08) !important;
}

.payment-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.payment-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.payment-card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
}

.payment-card-amount {
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Remove the old "br" line break look — make it clean */
.payment-card-amount br {
    display: none;
}

/* Payable - Blue */
.payment-card-payable::before { background: #1565c0; }
.payment-card-payable .payment-card-icon { background: #e3f2fd; color: #1565c0; }
.payment-card-payable .payment-card-amount { color: #1565c0 !important; }

/* Paid - Green */
.payment-card-paid::before { background: #2e7d32; }
.payment-card-paid .payment-card-icon { background: #e8f5e9; color: #2e7d32; }
.payment-card-paid .payment-card-amount { color: #2e7d32 !important; }

/* Balance - Red */
.payment-card-balance::before { background: #c62828; }
.payment-card-balance .payment-card-icon { background: #ffebee; color: #c62828; }
.payment-card-balance .payment-card-amount { color: #c62828 !important; }

/* ============================================
   PAYMENT SUMMARY ROW (Chart + Progress)
   Sits below the 3 payment cards as a unified bar
   ============================================ */
.payment-summary-row {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 24px;
    margin-bottom: 20px;
    border: 1px solid #e8e8e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.payment-summary-chart {
    flex-shrink: 0;
}

.payment-summary-info {
    flex: 1;
    min-width: 0;
}

/* Hide the operator signs (- and =) */
.card-sign {
    display: none !important;
}

/* Chart percentage in legend */
.chart-pct {
    margin-left: auto;
    font-weight: 700;
    color: #293503;
    font-size: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.progress-title i {
    color: #293503;
    margin-right: 5px;
}

.progress-percent {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: #f0f0ed;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2e7d32, #43a047);
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-legend {
    display: flex;
    gap: 18px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #888;
    font-weight: 500;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-paid { background: #2e7d32; }
.dot-balance { background: #e0e0dc; }

/* ============================================
   RESPONSIVE
   ============================================ */

/* --- Override legacy body min-width that blocks mobile --- */
body {
    min-width: 0 !important;
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .skeleton-block {
        animation: none !important;
        background: #e8e8e5 !important;
    }
}

/* --- Accessibility: Focus visible states (WCAG 2.4.7) --- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.btn-file-new-case:focus-visible,
.payment-card a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-tabs > li > a:focus-visible,
.paginate_button:focus-visible {
    outline: 3px solid #1565c0 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.25) !important;
}

/* --- Accessibility: High-contrast text (WCAG 1.4.3 AA minimum 4.5:1) --- */
/* Upgrade greys from #888 to #595959 (7:1 on white) */
.payment-card-label {
    color: #595959;
}

.progress-title {
    color: #444;
}

.legend-item {
    color: #595959;
    font-size: 12px;
}

.stat-widget .stat-body ul li .stat-label {
    color: #444;
}

.tile_stats_count .count_top {
    color: #595959;
}

.dashboard-welcome .welcome-text p {
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-error p {
    color: #595959;
}

/* Ensure status labels have readable text at small sizes (WCAG 1.4.12) */
.label-danger,
.label-success,
.label-default {
    font-size: 12px;
    padding: 4px 10px;
    line-height: 1.4;
}

/* --- Accessibility: Minimum touch target 44x44 (WCAG 2.5.8 / 2.5.5 AAA) --- */
#dashboardLoaded .btn,
#dashboardLoaded .btn-primary,
#dashboardLoaded .btn-link,
.btn-file-new-case,
.btn-retry {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#jsCenterColumn .nav-tabs > li > a,
#dashboardLoaded .nav-tabs > li > a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* DataTables pagination touch targets */
#dashboardLoaded .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============================================
   LARGE DESKTOPS (>1200px) — ensure max-width for readability
   ============================================ */
@media (min-width: 1201px) {
    .payment-cards-row {
        max-width: 100%;
    }
    .payment-summary-row {
        max-width: 100%;
    }
}

/* ============================================
   TABLETS & SMALL LAPTOPS (≤992px)
   ============================================ */
@media (max-width: 992px) {
    .dashboard-search-bar .row > div {
        margin-bottom: 10px;
    }

    .dashboard-search-bar .row > div:last-child {
        text-align: left !important;
    }

    .payment-card-amount {
        font-size: 17px !important;
    }

    .payment-card {
        padding: 16px 18px !important;
    }

    .payment-cards-row {
        gap: 14px;
        padding: 16px !important;
    }

    /* Table: allow horizontal scroll */
    #dashboardLoaded .table-responsive,
    #jsCenterColumn .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack action bar buttons */
    #dashboardLoaded .row[style*="background:#F0F0ED"] .btn,
    #dashboardLoaded .row[style*="background: #F0F0ED"] .btn {
        margin-bottom: 6px;
        font-size: 12px;
    }
}

/* ============================================
   TABLETS PORTRAIT (≤768px)
   ============================================ */
@media (max-width: 768px) {
    /* Welcome banner stacks vertically */
    .dashboard-welcome {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-welcome .welcome-text h2 {
        font-size: 17px;
    }

    .dashboard-welcome .welcome-actions {
        width: 100%;
    }

    .dashboard-welcome .welcome-actions .btn-file-new-case {
        width: 100%;
        justify-content: center;
    }

    /* Skeleton stacks */
    .skeleton-row {
        flex-direction: column;
    }

    /* Case article card actions: flow inline */
    article.oJobTile .oRight {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Mail list column: full width */
    .mail_list_column {
        border-right: none !important;
        border-bottom: 1px solid #e8e8e5;
        max-height: 300px;
    }

    /* Tabs: scrollable row */
    #jsCenterColumn .nav-tabs,
    #dashboardLoaded .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    #jsCenterColumn .nav-tabs::-webkit-scrollbar,
    #dashboardLoaded .nav-tabs::-webkit-scrollbar {
        display: none; /* Chrome / Safari */
    }

    #jsCenterColumn .nav-tabs > li > a,
    #dashboardLoaded .nav-tabs > li > a {
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Payment cards stack vertically */
    .payment-cards-row {
        flex-direction: column;
        gap: 10px;
        padding: 14px !important;
    }

    .payment-cards-row > [class*="col-"],
    .payment-cards-row > .payment-col {
        width: 100% !important;
        flex: none;
    }

    .payment-card {
        padding: 16px 18px !important;
    }

    .payment-card-amount {
        font-size: 18px !important;
    }

    /* Summary row stacks */
    .payment-summary-row {
        flex-direction: column;
        gap: 14px;
        padding: 16px;
        text-align: center;
    }


    /* Table becomes scrollable (all tables, all pages) */
    .table, .table-colored, .jambo_table, #cases {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .table thead, .table tbody, .table tr,
    .table-colored thead, .table-colored tbody, .table-colored tr,
    .jambo_table thead, .jambo_table tbody, .jambo_table tr,
    #cases thead, #cases tbody, #cases tr {
        display: table;
        width: 100%;
        table-layout: auto;
    }

    /* DataTables controls stack */
    #dashboardLoaded .dataTables_wrapper .dataTables_length,
    #dashboardLoaded .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
        margin-bottom: 10px;
    }

    #dashboardLoaded .dataTables_wrapper .dataTables_info,
    #dashboardLoaded .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin-top: 10px;
    }

    /* Small box report cards: 2 columns → 1 column */
    #dashboardLoaded .small-box {
        min-height: 120px;
    }

    /* hpanel stat cards */
    #dashboardLoaded .hpanel {
        margin-bottom: 12px;
    }

    /* Dashboard stat panels */
    .dashboard-stat-panel .panel-heading {
        padding: 16px 12px 14px;
    }

    .dashboard-stat-panel .badge {
        font-size: 18px;
        padding: 6px 12px;
    }

    /* Tile stats */
    .tile_stats_count {
        margin: 0 0 10px 0 !important;
    }

    .tile_stats_count .count {
        font-size: 22px !important;
    }

    /* Modal full-width on small screens */
    .modal-dialog {
        margin: 10px;
        width: auto !important;
    }

    /* Action bar from dashboard_state.php */
    #dashboardLoaded .row.well-lg + .row {
        flex-wrap: wrap;
    }

    #dashboardLoaded .row .btn {
        font-size: 11px;
        padding: 6px 10px;
        margin-bottom: 4px;
    }
}

/* ============================================
   LARGE PHONES (≤576px)
   ============================================ */
@media (max-width: 576px) {
    /* Container padding */
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .dashboard-welcome {
        padding: 14px;
        border-radius: 8px;
        margin-bottom: 14px;
    }

    .dashboard-welcome .welcome-text h2 {
        font-size: 15px;
    }

    .dashboard-welcome .welcome-text p {
        font-size: 12px;
    }

    /* Payment cards tighter */
    .payment-cards-row {
        padding: 10px !important;
        gap: 8px;
        border-radius: 8px !important;
    }

    .payment-card {
        padding: 14px 14px !important;
        gap: 12px;
        border-radius: 8px !important;
    }

    .payment-card-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-radius: 8px;
    }

    .payment-card-label {
        font-size: 11px;
    }

    .payment-card-amount {
        font-size: 16px !important;
    }

    /* Summary row */
    .payment-summary-row {
        padding: 14px;
        gap: 12px;
    }

    .progress-percent {
        font-size: 15px;
    }

    /* Table header smaller */
    #jsCenterColumn .table thead th,
    #dashboardLoaded .table thead th,
    table.table-colored thead td,
    table.table-colored thead th {
        padding: 10px 8px;
        font-size: 11px;
    }

    #jsCenterColumn .table tbody td,
    #dashboardLoaded .table tbody td,
    table.table-colored tbody td {
        padding: 9px 8px;
        font-size: 12px;
    }

    /* Case article cards */
    article.oJobTile {
        padding: 12px !important;
    }

    article.oJobTile .oRowTitle.oH3 {
        font-size: 13px !important;
    }

    /* Tabs smaller */
    #jsCenterColumn .nav-tabs > li > a,
    #dashboardLoaded .nav-tabs > li > a {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* File new case button full width */
    .btn-file-new-case {
        width: 100%;
        justify-content: center;
        padding: 12px 20px !important;
        font-size: 13px;
    }

    /* Progress bar legend wraps */
    .progress-legend {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* DataTables page buttons */
    #dashboardLoaded .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 4px 8px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 11px;
    }
}

/* ============================================
   SMALL PHONES (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .container-fluid {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .dashboard-welcome {
        padding: 12px;
        margin-bottom: 12px;
    }

    .dashboard-welcome .welcome-text h2 {
        font-size: 14px;
    }

    /* Payment card — icon on top */
    .payment-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 14px !important;
    }

    .payment-card-content {
        width: 100%;
    }

    .payment-card-amount {
        font-size: 18px !important;
    }

    /* Table: card-style layout */
    #dashboardLoaded table.table-colored,
    #dashboardLoaded #cases {
        font-size: 11px;
    }

    #dashboardLoaded table.table-colored thead th,
    #dashboardLoaded #cases thead th {
        padding: 8px 6px;
        font-size: 10px;
    }

    #dashboardLoaded table.table-colored tbody td,
    #dashboardLoaded #cases tbody td {
        padding: 8px 6px;
    }

    /* Small boxes */
    #dashboardLoaded .small-box {
        min-height: 100px;
    }

    #dashboardLoaded .small-box h3 {
        font-size: 26px !important;
    }

    /* Modal */
    .modal-dialog {
        margin: 5px;
    }

    .modal-body {
        padding: 14px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .dashboard-welcome,
    .btn-file-new-case,
    .skeleton-container,
    .payment-summary-row,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_paginate,
    .dataTables_info {
        display: none !important;
    }

    .payment-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .payment-cards-row {
        box-shadow: none !important;
    }

    body {
        min-width: 0 !important;
    }
}

/* ============================================
   FILING JOURNEY — Page Shell & Layout
   ============================================ */
.filing-journey-container {
    max-width: 100%;
    width: 83%;
    margin: 0 auto;
    padding: 20px 15px 40px;
    box-sizing: border-box;
}

/* --- Breadcrumb --- */
.filing-breadcrumb {
    margin-bottom: 18px;
}

.filing-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
}

.filing-breadcrumb ol li {
    display: flex;
    align-items: center;
    color: #888;
}

.filing-breadcrumb ol li a {
    color: #293503;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.filing-breadcrumb ol li a:hover {
    color: #CFB53B;
    text-decoration: underline;
}

.filing-breadcrumb ol li + li::before {
    content: '›';
    margin-right: 6px;
    color: #bbb;
    font-size: 15px;
    font-weight: 300;
}

.filing-breadcrumb ol li[aria-current="page"] {
    color: #444;
    font-weight: 600;
}

/* --- Page Header --- */
.filing-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 22px 28px;
    background: linear-gradient(135deg, #293503 0%, #3d4f0a 100%);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(41, 53, 3, 0.2);
    color: #fff;
}

.filing-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.filing-header-text h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #fff;
}

.filing-header-text p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* --- Loading Skeleton for Filing --- */
.filing-skeleton {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    border: 1px solid #e8e8e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* --- Form Card Container --- */
.filing-form-card {
    background: #fff;
    border-radius: 10px;
    padding: 0;
    border: 1px solid #e8e8e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: visible;
}

.filing-form-card__header {
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    background: linear-gradient(135deg, #293503 0%, #3d4f0a 100%);
    color: #fff;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.filing-form-card__header-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    color: #fff;
}

.filing-form-card__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.filing-form-card__header p {
    margin: 4px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.filing-form-card__body {
    overflow: visible;
}

/* --- Screen reader only --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   FILING JOURNEY — hpanel (API-injected header)
   Modernized from inline styles
   ============================================ */
.filing-form-card .hpanel,
.filing-journey-container .hpanel {
    background: linear-gradient(135deg, #293503, #3d4f0a);
    color: #fff;
    border: 0;
    box-shadow: none;
    margin-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.filing-form-card .hpanel .panel-body,
.filing-journey-container .hpanel .panel-body {
    background: linear-gradient(135deg, #293503, #3d4f0a);
    color: #fff;
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 22px 24px;
    position: relative;
}

.filing-form-card .hpanel .panel-body h2,
.filing-journey-container .hpanel .panel-body h2 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.filing-form-card .hpanel > .panel-footer,
.filing-form-card .hpanel > .panel-section,
.filing-journey-container .hpanel > .panel-footer,
.filing-journey-container .hpanel > .panel-section {
    color: #fff;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 13px;
    background: #293503;
    padding: 12px 24px;
    border-radius: 0 0 10px 10px;
}

/* ============================================
   FILING JOURNEY — Form Elements
   ============================================ */
.filing-form-card select,
.filing-journey-container select,
.filing-form-card .form-control,
.filing-journey-container .form-control {
    height: 44px !important;
    font-size: 14px;
    border: 1px solid #d2d2cd;
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #333;
}

.filing-form-card select:focus,
.filing-journey-container select:focus,
.filing-form-card .form-control:focus,
.filing-journey-container .form-control:focus {
    border-color: #293503;
    box-shadow: 0 0 0 3px rgba(41, 53, 3, 0.15);
    outline: none;
}

.filing-form-card label,
.filing-journey-container label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}

.filing-form-card .form-group,
.filing-journey-container .form-group {
    margin-bottom: 18px;
}

/* Select2 overrides in filing context */
.filing-form-card .select2-container,
.filing-journey-container .select2-container {
    width: 100% !important;
}

.filing-form-card .select2-container--default .select2-selection--single,
.filing-journey-container .select2-container--default .select2-selection--single {
    height: 44px !important;
    border: 1px solid #d2d2cd;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
}

.filing-form-card .select2-container--default .select2-selection--single .select2-selection__rendered,
.filing-journey-container .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px;
    color: #333;
}

.filing-form-card .select2-container--default .select2-selection--single .select2-selection__arrow,
.filing-journey-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.select2-results__option {
    font-size: 13px;
    padding: 8px 12px;
}

.select2-results__option--highlighted {
    background: #293503 !important;
}

/* --- Proceed / Go Button --- */
.filing-form-card .btn-go,
.filing-journey-container .btn-go {
    background: linear-gradient(135deg, #293503, #3d4f0a) !important;
    color: #fff !important;
    border: 0;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(41, 53, 3, 0.25);
    transition: all 0.2s ease;
    cursor: pointer;
}

.filing-form-card .btn-go:hover,
.filing-journey-container .btn-go:hover {
    background: linear-gradient(135deg, #3d4f0a, #4e6310) !important;
    box-shadow: 0 5px 16px rgba(41, 53, 3, 0.35);
    transform: translateY(-1px);
}

.filing-form-card .btn-go:disabled,
.filing-journey-container .btn-go:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- Error Fields --- */
.errorField2,
.errorField {
    border: 2px solid #c62828 !important;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12) !important;
}

.help-block-error,
.help-block.error {
    color: #c62828;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    display: block;
}

/* ============================================
   FILING JOURNEY — SmartWizard Overrides
   Modern, responsive, accessible step wizard
   ============================================ */

/* Wizard container */
.filing-form-card .wizard,
.filing-journey-container .wizard,
.filing-form-card .sw-main,
.filing-journey-container .sw-main {
    background: #fff;
    border-radius: 0 0 10px 10px;
    overflow: visible;
}

/* SmartWizard sw-container: override plugin's overflow:hidden so Select2 dropdowns show */
.sw-main .sw-container,
.sw-theme-arrows .sw-container,
.filing-form-card .sw-container {
    overflow: visible !important;
}

/* Step-content panels also need visible overflow for dropdowns */
.sw-main .step-content,
.sw-theme-arrows .step-content,
.filing-form-card .step-content,
.filing-form-card .tab-pane {
    overflow: visible !important;
}

/* Step toolbar (top step indicators) */
.sw-theme-arrows > .sw-toolbar,
.sw-theme-arrows .nav-tabs,
.sw-main > .nav,
.filing-form-card .nav.nav-tabs {
    background: #f8f8f6;
    border-bottom: 2px solid #e8e8e5;
    padding: 0;
    margin: 0;
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sw-theme-arrows > .sw-toolbar::-webkit-scrollbar,
.sw-main > .nav::-webkit-scrollbar,
.filing-form-card .nav.nav-tabs::-webkit-scrollbar {
    height: 3px;
}

.sw-theme-arrows > .sw-toolbar::-webkit-scrollbar-thumb,
.sw-main > .nav::-webkit-scrollbar-thumb,
.filing-form-card .nav.nav-tabs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Individual step tab */
.sw-theme-arrows .nav-link,
.sw-theme-arrows .nav-tabs > li > a,
.sw-main .nav-link,
.filing-form-card .nav-tabs > li > a {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    transition: all 0.2s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

/* Remove the arrow pseudo-elements from theme */
.sw-theme-arrows .nav-link::after,
.sw-theme-arrows .nav-link::before {
    display: none !important;
}

/* Active step */
.sw-theme-arrows .nav-link.active,
.sw-theme-arrows .nav-tabs > li.active > a,
.sw-main .nav-link.active,
.filing-form-card .nav-tabs > li.active > a {
    color: #293503 !important;
    border-bottom-color: #293503 !important;
    background: #fff !important;
}

/* Done (completed) step */
.sw-theme-arrows .nav-link.done,
.sw-main .nav-link.done {
    color: #2e7d32 !important;
    border-bottom-color: #2e7d32 !important;
}

/* Disabled step */
.sw-theme-arrows .nav-link.disabled,
.sw-main .nav-link.disabled {
    color: #bbb !important;
    cursor: not-allowed;
}

/* Hover state */
.sw-theme-arrows .nav-link:hover:not(.disabled),
.sw-main .nav-link:hover:not(.disabled),
.filing-form-card .nav-tabs > li > a:hover {
    color: #293503;
    background: #fafaf8 !important;
    border-bottom-color: #CFB53B !important;
}

/* Step number badge */
.sw-theme-arrows .nav-link .num,
.sw-main .nav-link .num,
.sw-theme-arrows .step-number,
.sw-main .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e8e8e5;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.sw-theme-arrows .nav-link.active .num,
.sw-main .nav-link.active .num,
.sw-theme-arrows .nav-link.active .step-number,
.sw-main .nav-link.active .step-number {
    background: #293503;
    color: #fff;
}

.sw-theme-arrows .nav-link.done .num,
.sw-main .nav-link.done .num,
.sw-theme-arrows .nav-link.done .step-number,
.sw-main .nav-link.done .step-number {
    background: #2e7d32;
    color: #fff;
}

/* Step content area */
.sw-theme-arrows .sw-container,
.sw-main .sw-container,
.sw-theme-arrows .tab-content,
.sw-main .tab-content,
.filing-form-card .tab-content {
    padding: 16px 20px;
    min-height: auto;
}

/* Wizard action buttons – toolbar is the ONLY flex row container */
.sw-theme-arrows .sw-toolbar-bottom,
.sw-main .sw-toolbar-bottom {
    padding: 12px 20px;
    background: #f8f8f6;
    border-top: 1px solid #e8e8e5;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

/* Reset Bootstrap .navbar overrides on SmartWizard toolbar */
nav.sw-toolbar.sw-toolbar-bottom {
    min-height: auto !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-top: 1px solid #e8e8e5 !important;
    border-radius: 0 0 10px 10px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Override Bootstrap .pull-right float on ALL children inside toolbar */
nav.sw-toolbar.sw-toolbar-bottom > * {
    float: none !important;
}

/* Ensure button groups inside toolbar are inline-flex rows (NOT flex columns) */
nav.sw-toolbar .sw-btn-group,
nav.sw-toolbar .sw-btn-group-extra,
nav.sw-toolbar .btn-group {
    display: inline-flex !important;
    flex-direction: row !important;
    visibility: visible !important;
    float: none !important;
    gap: 8px;
    align-items: center;
}

/* Button ORDER: Previous, Next (sw-btn-group) first, then Cancel, Submit (sw-btn-group-extra) */
nav.sw-toolbar .sw-btn-group {
    order: 1 !important;
}
nav.sw-toolbar .sw-btn-group-extra {
    order: 2 !important;
}

nav.sw-toolbar .sw-btn-group .btn,
nav.sw-toolbar .sw-btn-group-extra .btn:not(.hidden):not(.hide) {
    float: none !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap;
}

/* Respect SmartWizard's step-based hidden state for finish/submit buttons */
nav.sw-toolbar .sw-btn-group-extra .btn.hidden,
nav.sw-toolbar .sw-btn-group-extra .btn.hide {
    display: none !important;
    visibility: hidden !important;
}

.sw-btn-next,
.sw-btn-prev,
.sw-btn-group .btn:not(.hidden):not(.hide) {
    min-height: 44px;
    min-width: 44px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
}

.sw-btn-next {
    background: linear-gradient(135deg, #293503, #3d4f0a) !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 2px 6px rgba(41, 53, 3, 0.18);
    letter-spacing: 0.3px;
}

.sw-btn-next::after {
    content: ' \2192';
    margin-left: 6px;
    font-size: 15px;
}

.sw-btn-next:hover {
    background: linear-gradient(135deg, #3d4f0a, #4e6510) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(41, 53, 3, 0.28);
}

.sw-btn-prev {
    background: #fff !important;
    color: #293503 !important;
    border: 1px solid #d2d2cd !important;
    letter-spacing: 0.3px;
}

.sw-btn-prev::before {
    content: '\2190 ';
    margin-right: 6px;
    font-size: 15px;
}

.sw-btn-prev:hover {
    background: #f0f0ed !important;
    border-color: #293503 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Extra toolbar buttons (Cancel, Submit) */
nav.sw-toolbar .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: #fff !important;
    border: none !important;
    min-height: 44px;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.18);
    transition: all 0.2s ease;
}

nav.sw-toolbar .btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #b21f2d) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.28);
}

nav.sw-toolbar .btn-info.btn-finish:not(.hidden) {
    background: #293503 !important;
    border-color: #293503 !important;
    color: #fff !important;
    min-height: 44px;
    border-radius: 6px;
    padding: 10px 28px;
    font-weight: 600;
    font-size: 14px;
}

/* --- h-200 utility modernized --- */
.h-200 {
    min-height: 150px;
}

/* ============================================
   FILING JOURNEY — Responsive Breakpoints
   ============================================ */
@media (max-width: 768px) {
    .filing-journey-container {
        padding: 14px 10px 30px;
    }

    .filing-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
        gap: 12px;
    }

    .filing-header-text h1 {
        font-size: 18px;
    }

    .filing-header-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
        border-radius: 10px;
    }

    /* Wizard step tabs scroll horizontally */
    .sw-theme-arrows > .sw-toolbar,
    .sw-main > .nav,
    .filing-form-card .nav.nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sw-theme-arrows > .sw-toolbar::-webkit-scrollbar,
    .sw-main > .nav::-webkit-scrollbar {
        display: none;
    }

    .sw-theme-arrows .nav-link,
    .sw-main .nav-link,
    .filing-form-card .nav-tabs > li > a {
        padding: 10px 14px;
        font-size: 11px;
    }

    /* Step content tighter */
    .sw-theme-arrows .sw-container,
    .sw-main .sw-container,
    .sw-theme-arrows .tab-content,
    .filing-form-card .tab-content {
        padding: 12px 10px;
    }

    .sw-theme-arrows .sw-toolbar-bottom,
    .sw-main .sw-toolbar-bottom,
    nav.sw-toolbar.sw-toolbar-bottom,
    .sw-btn-group {
        padding: 10px 12px;
        flex-wrap: wrap;
        display: flex !important;
        visibility: visible !important;
        justify-content: flex-end;
        gap: 6px;
    }

    nav.sw-toolbar .sw-btn-group,
    nav.sw-toolbar .sw-btn-group-extra {
        flex-wrap: wrap;
        gap: 6px;
    }

    nav.sw-toolbar .sw-btn-group {
        order: 1 !important;
    }
    nav.sw-toolbar .sw-btn-group-extra {
        order: 2 !important;
    }

    .sw-btn-next,
    .sw-btn-prev,
    .sw-btn-group .btn,
    nav.sw-toolbar .btn {
        width: 100%;
        justify-content: center;
        display: inline-flex !important;
        visibility: visible !important;
    }

    /* Breadcrumb */
    .filing-breadcrumb ol {
        font-size: 12px;
    }

    /* Form elements full width */
    .filing-form-card .col-sm-4,
    .filing-form-card .col-sm-6,
    .filing-form-card .col-md-4,
    .filing-form-card .col-md-6,
    .filing-journey-container .col-sm-4,
    .filing-journey-container .col-sm-6,
    .filing-journey-container .col-md-4,
    .filing-journey-container .col-md-6 {
        width: 100%;
        float: none;
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Filing skeleton tighter */
    .filing-skeleton {
        padding: 18px 14px;
    }
}

@media (max-width: 576px) {
    .filing-journey-container {
        padding: 10px 6px 24px;
    }

    .filing-header {
        padding: 14px;
        border-radius: 8px;
    }

    .filing-header-text h1 {
        font-size: 16px;
    }

    .filing-header-text p {
        font-size: 12px;
    }

    .filing-form-card select,
    .filing-journey-container select,
    .filing-form-card .form-control,
    .filing-journey-container .form-control {
        font-size: 13px;
    }

    .filing-form-card .btn-go,
    .filing-journey-container .btn-go {
        width: 100%;
        justify-content: center;
        font-size: 13px;
    }

    /* Step numbers hide on very small screens — use text only */
    .sw-theme-arrows .nav-link .num,
    .sw-main .nav-link .num,
    .sw-theme-arrows .step-number,
    .sw-main .step-number {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .filing-header-icon {
        display: none;
    }

    .filing-header {
        padding: 12px;
        margin-bottom: 16px;
    }

    .filing-header-text h1 {
        font-size: 15px;
    }
}

/* --- Accessibility: Focus visible for filing elements --- */
.filing-form-card select:focus-visible,
.filing-form-card .form-control:focus-visible,
.filing-form-card .btn-go:focus-visible,
.filing-journey-container select:focus-visible,
.filing-journey-container .form-control:focus-visible,
.filing-journey-container .btn-go:focus-visible,
.sw-theme-arrows .nav-link:focus-visible,
.sw-main .nav-link:focus-visible,
.sw-btn-next:focus-visible,
.sw-btn-prev:focus-visible,
.filing-breadcrumb a:focus-visible {
    outline: 3px solid #1565c0 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.25) !important;
}

/* --- Filing print styles --- */
@media print {
    .filing-breadcrumb,
    .filing-skeleton,
    .filing-header-icon,
    .sw-theme-arrows .sw-toolbar-bottom,
    .sw-btn-group {
        display: none !important;
    }

    .filing-header {
        background: #293503 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .filing-form-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* ============================================
   NAVBAR & HEADER-TOP — Dropdown Fix (no scroll)
   Overrides Bootstrap's max-height: 340px and
   ensures dropdowns render without clipping
   ============================================ */
.navbar-collapse {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
}

.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse,
.navbar-static-top .navbar-collapse {
    max-height: none !important;
}

/* Dropdown menu itself should not be height-restricted */
.main-navigation .dropdown-menu,
.navbar-nav .dropdown-menu,
.mega-menu .dropdown-menu {
    max-height: none !important;
    overflow-y: visible !important;
}

/* ---- Header-top dropdown (Validate/Search, SO Requests) ---- */
.header-top {
    position: relative;
    z-index: 1040;
    overflow: visible !important;
}

.header-top .container,
.header-top .row,
.header-top .header-top-first,
.header-top #header-top-second,
.header-top .header-top-dropdown {
    overflow: visible !important;
}

.header-top .btn-group {
    position: relative;
}

.header-top .btn-group > .dropdown-menu {
    z-index: 1050;
    min-width: 220px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0dc;
    padding: 6px 0;
    margin-top: 2px;
    animation: efiling-dropdown-in 0.15s ease-out;
}

.header-top .btn-group > .dropdown-menu > li > a {
    padding: 9px 18px;
    font-size: 13px;
    color: #444;
    transition: background 0.15s ease, color 0.15s ease;
}

.header-top .btn-group > .dropdown-menu > li > a:hover,
.header-top .btn-group > .dropdown-menu > li > a:focus {
    background: #f0f5e6;
    color: #293503;
}

.header-top .btn-group > .dropdown-menu > li > a i {
    width: 20px;
    text-align: center;
    color: #293503;
}

/* Main nav dropdown (SO Requests etc.) */
.main-navigation {
    overflow: visible !important;
}

.main-navigation .navbar {
    overflow: visible !important;
}

.main-navigation .navbar .container-fluid {
    overflow: visible !important;
}

.main-navigation .navbar-collapse {
    overflow: visible !important;
}

.main-navigation .navbar-nav {
    overflow: visible !important;
}

/* Ensure SO Requests and all mega-menu dropdowns display properly */
li.mega-menu {
    position: relative;
    overflow: visible !important;
}

li.mega-menu > .dropdown-menu,
.mega-menu > .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    min-width: 200px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0dc;
    padding: 6px 0;
    margin-top: 0;
    animation: efiling-dropdown-in 0.15s ease-out;
    background: #fff;
}

li.mega-menu.open > .dropdown-menu,
li.mega-menu > .dropdown-menu.show {
    display: block !important;
}

/* Fixed header dropdown escape — ensure dropdowns are not clipped by fixed header */
header.header.fixed,
header.header.fixed .container,
header.header.fixed .header-second,
header.header.fixed .main-navigation,
header.header.fixed .navbar,
header.header.fixed .navbar .container-fluid,
header.header.fixed .navbar-collapse,
header.header.fixed .navbar-nav {
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
}

.navbar-nav > li.mega-menu.dropdown {
    position: relative !important;
    overflow: visible !important;
}

.navbar-nav > li.mega-menu.dropdown > .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    z-index: 10000 !important;
    min-width: 220px;
    max-width: 300px;
    clip: auto !important;
    overflow: visible !important;
}

/* Ensure the open state shows the dropdown */
.navbar-nav > li.mega-menu.dropdown.open > .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mega-menu > .dropdown-menu > li {
    display: block !important;
}

.mega-menu > .dropdown-menu > li > a {
    padding: 10px 20px;
    font-size: 13px;
    color: #555;
    display: block;
    transition: background 0.15s ease, color 0.15s ease;
}

.mega-menu > .dropdown-menu > li > a:hover,
.mega-menu > .dropdown-menu > li > a:focus {
    background: #f0f5e6;
    color: #293503;
}

@keyframes efiling-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* On mobile (collapsed navbar), allow scroll with larger max-height */
@media (max-width: 767px) {
    .navbar-collapse.in,
    .navbar-collapse.collapsing {
        max-height: 80vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .navbar-collapse .dropdown-menu {
        max-height: none !important;
        position: static !important;
        float: none !important;
        width: 100% !important;
        background: #f9f9f6;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .navbar-collapse .dropdown-menu li a {
        padding: 10px 30px;
    }
    /* Better touch targets on mobile */
    .navbar-nav > li > a {
        padding: 12px 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
}

/* ============================================
   FILING JOURNEY — API Form Column Responsive
   The API form uses Bootstrap col-md-3/col-md-7 etc.
   Make them stack properly on smaller screens.
   ============================================ */
.filing-form-card .container-fluid,
.filing-journey-container .container-fluid {
    padding: 0;
}

.filing-form-card .container-fluid .row {
    margin-left: -8px;
    margin-right: -8px;
}

.filing-form-card .container-fluid .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 10px;
}

/* Form row spacing */
.filing-form-card .filter,
.filing-form-card .form-horizontal.filter {
    margin: 0 !important;
    padding: 20px 24px !important;
    border: none !important;
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.filing-form-card .filter hr {
    margin: 14px 0;
    border-color: #e8e8e5;
}

/* Button rows: align proceed / change buttons nicely */
.filing-form-card .btn-go,
.filing-form-card .btn-go-scc,
.filing-form-card .btn-go-old-filing,
.filing-journey-container .btn-go,
.filing-journey-container .btn-go-scc,
.filing-journey-container .btn-go-old-filing {
    background: linear-gradient(135deg, #293503, #3d4f0a) !important;
    color: #fff !important;
    border: 0;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(41, 53, 3, 0.25);
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    margin-top: 4px;
}

.filing-form-card .btn-go:hover,
.filing-form-card .btn-go-scc:hover,
.filing-form-card .btn-go-old-filing:hover {
    background: linear-gradient(135deg, #3d4f0a, #4e6310) !important;
    box-shadow: 0 5px 16px rgba(41, 53, 3, 0.35);
    transform: translateY(-1px);
}

.filing-form-card .btn-go:disabled,
.filing-form-card .btn-go-scc:disabled,
.filing-form-card .btn-go-old-filing:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.filing-form-card .btn-cancel,
.filing-form-card .btn-cancel-scc,
.filing-form-card .btn-cancel-old-filing {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

/* Select2 classic theme overrides in filing context */
.filing-form-card .select2-container--classic .select2-selection--single,
.filing-journey-container .select2-container--classic .select2-selection--single {
    height: 44px !important;
    border: 1px solid #d2d2cd;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 14px;
    background: #fff;
    background-image: none;
}

.filing-form-card .select2-container--classic .select2-selection--single .select2-selection__rendered,
.filing-journey-container .select2-container--classic .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    color: #333;
    padding-left: 0;
}

.filing-form-card .select2-container--classic .select2-selection--single .select2-selection__arrow,
.filing-journey-container .select2-container--classic .select2-selection--single .select2-selection__arrow {
    height: 42px;
    border-left: 1px solid #d2d2cd;
    background: #f8f8f6;
    border-radius: 0 6px 6px 0;
}

/* ============================================
   FILING JOURNEY — Wizard Tables (Responsive)
   Tables inside wizard steps for parties,
   documents, confirmations etc.
   ============================================ */
.wizard table,
.filing-form-card table,
.filing-journey-container table,
.sw-main table,
.tab-content table {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 13px;
}

.wizard table thead th,
.filing-form-card table thead th,
.sw-main table thead th,
.tab-content table thead th {
    background: #f0f4e1 !important;
    color: #333;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 10px 12px;
    border-bottom: 2px solid #d2d2cd;
    white-space: nowrap;
}

.wizard table tbody td,
.filing-form-card table tbody td,
.sw-main table tbody td,
.tab-content table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    color: #444;
}

.wizard table tbody tr:hover,
.filing-form-card table tbody tr:hover,
.sw-main table tbody tr:hover,
.tab-content table tbody tr:hover {
    background: #fafaf6;
}

/* Responsive table wrapper — horizontal scroll */
.wizard .table-responsive,
.filing-form-card .table-responsive,
.sw-main .table-responsive,
.tab-content .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e8e8e5;
    border-radius: 6px;
    margin-bottom: 14px;
}

/* Auto-wrap any table inside wizard steps in a scrollable wrapper on mobile */
@media (max-width: 992px) {
    .wizard table,
    .sw-main table,
    .tab-content table,
    .filing-form-card table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .wizard table thead,
    .wizard table tbody,
    .wizard table tr,
    .sw-main table thead,
    .sw-main table tbody,
    .sw-main table tr,
    .tab-content table thead,
    .tab-content table tbody,
    .tab-content table tr {
        display: table;
        width: 100%;
        table-layout: auto;
    }
}

/* DataTables overrides inside wizard */
.wizard .dataTables_wrapper,
.filing-form-card .dataTables_wrapper,
.sw-main .dataTables_wrapper,
.tab-content .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wizard .dataTables_wrapper table.dataTable,
.sw-main .dataTables_wrapper table.dataTable,
.tab-content .dataTables_wrapper table.dataTable {
    width: 100% !important;
    min-width: 600px;
}

.wizard .dataTables_wrapper .dataTables_filter input,
.wizard .dataTables_wrapper .dataTables_length select {
    min-height: 36px;
    border-radius: 4px;
    border: 1px solid #d2d2cd;
    padding: 4px 8px;
}

/* ============================================
   FILING JOURNEY — Wizard Button Alignment
   Next/Previous/Finish at bottom of each step
   ============================================ */
.wizard .btn,
.sw-main .btn,
.tab-content .btn {
    min-height: 40px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

/* Wizard action row at bottom of step (upload, add party, etc.) */
.wizard .form-group .btn,
.sw-main .form-group .btn,
.tab-content .form-group .btn {
    margin: 2px 4px 2px 0;
}

/* Wizard step bottom toolbar — standardize spacing */
.wizard .toolbar,
.sw-main .toolbar {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8f8f6;
    border-top: 1px solid #e8e8e5;
}

/* ============================================
   FILING JOURNEY — Responsive Columns
   Override API form's col-md-3/5/7 on mobile
   ============================================ */
@media (max-width: 768px) {
    .filing-form-card .col-md-1,
    .filing-form-card .col-md-2,
    .filing-form-card .col-md-3,
    .filing-form-card .col-md-4,
    .filing-form-card .col-md-5,
    .filing-form-card .col-md-6,
    .filing-form-card .col-md-7,
    .filing-form-card .col-md-8,
    .filing-form-card .col-md-9,
    .filing-form-card .col-md-10 {
        width: 100% !important;
        float: none !important;
        padding-left: 8px;
        padding-right: 8px;
    }

    .filing-form-card label {
        margin-bottom: 4px;
        margin-top: 8px;
    }

    /* Stack buttons full width */
    .filing-form-card .btn-go,
    .filing-form-card .btn-go-scc,
    .filing-form-card .btn-go-old-filing,
    .filing-form-card .btn-cancel,
    .filing-form-card .btn-cancel-scc,
    .filing-form-card .btn-cancel-old-filing {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    /* Wizard tables smaller text on mobile */
    .wizard table,
    .sw-main table,
    .tab-content table {
        font-size: 12px;
    }

    .wizard table thead th,
    .sw-main table thead th,
    .tab-content table thead th {
        font-size: 11px;
        padding: 8px 8px;
    }

    .wizard table tbody td,
    .sw-main table tbody td,
    .tab-content table tbody td {
        padding: 8px 8px;
    }

    /* Wizard buttons stack */
    .wizard .toolbar,
    .sw-main .toolbar {
        flex-direction: column;
    }

    .wizard .toolbar .btn,
    .sw-main .toolbar .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .filing-form-card .filter,
    .filing-form-card .form-horizontal.filter {
        padding: 14px 12px !important;
    }

    /* Wizard step content tighter */
    .wizard .tab-content,
    .sw-main .tab-content,
    .sw-theme-arrows .sw-container {
        padding: 12px 8px;
    }

    .wizard .toolbar {
        padding: 10px 12px;
    }

    .filing-form-card .btn-go,
    .filing-form-card .btn-go-scc,
    .filing-form-card .btn-go-old-filing {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* ============================================
   SO REQUESTS & GENERAL FORM PAGES
   Consistent styling for forms outside filing
   ============================================ */
.object-non-visible .form-horizontal .form-group {
    margin-bottom: 12px;
}

.object-non-visible .form-horizontal label {
    font-weight: 600;
    font-size: 13px;
    color: #444;
}

.object-non-visible .form-horizontal .form-control,
.object-non-visible .form-horizontal select {
    border-radius: 6px;
    border: 1px solid #d2d2cd;
    min-height: 40px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.object-non-visible .form-horizontal .form-control:focus,
.object-non-visible .form-horizontal select:focus {
    border-color: #293503;
    box-shadow: 0 0 0 3px rgba(41, 53, 3, 0.12);
}

/* ============================================
   POPOVER-X (info icons in filing form)
   Ensure they render properly within the card
   ============================================ */
.filing-form-card .popover,
.filing-journey-container .popover {
    z-index: 10060;
    max-width: 320px;
}

/* ============================================
   MODAL inside filing (division_info etc.)
   ============================================ */
.filing-form-card .modal,
.filing-journey-container .modal {
    z-index: 10050;
}

.filing-form-card .modal-backdrop,
.filing-journey-container .modal-backdrop {
    z-index: 10049;
}

/* ============================================
   ACCESSIBILITY — Skip to content link
   ============================================ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #293503;
    color: #fff;
    padding: 8px 16px;
    z-index: 100000;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   LINKING / MAPPING REQUESTS & SEARCH PAGES
   ============================================ */
.filing-journey-container .table-responsive {
    border: 0;
    margin-bottom: 0;
}

.filing-journey-container .dataTables_wrapper {
    padding: 0;
}

.filing-journey-container .dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #d2d2cd;
    padding: 6px 12px;
    min-height: 38px;
    transition: border-color 0.2s ease;
}

.filing-journey-container .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #293503;
    box-shadow: 0 0 0 3px rgba(41, 53, 3, 0.12);
    outline: none;
}

.filing-journey-container .dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    border: 1px solid #d2d2cd;
    padding: 4px 8px;
    min-height: 34px;
}

.filing-journey-container .dataTables_wrapper .dataTables_info,
.filing-journey-container .dataTables_wrapper .dataTables_paginate {
    padding-top: 12px;
}

.filing-journey-container .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px;
    margin: 0 2px;
}

.filing-journey-container .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.filing-journey-container .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #293503;
    border-color: #293503;
    color: #fff !important;
}

/* Status badges in linking table */
.filing-journey-container .label-success {
    background-color: #27ae60;
}

.filing-journey-container .label-warning {
    background-color: #f39c12;
}

.filing-journey-container .label-danger {
    background-color: #e74c3c;
}

.filing-journey-container .label-info {
    background-color: #3498db;
}

/* No-wrap for action buttons column */
td.no-wrap,
.no-wrap {
    white-space: nowrap;
}

/* ============================================
   FILING FORM — Make Request button styling
   ============================================ */
.filing-form-card .btn-info {
    background-color: #293503;
    border-color: #293503;
    color: #fff;
    border-radius: 6px;
    min-height: 44px;
    padding: 10px 28px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.filing-form-card .btn-info:hover,
.filing-form-card .btn-info:focus {
    background-color: #3d4e0a;
    border-color: #3d4e0a;
    box-shadow: 0 2px 8px rgba(41, 53, 3, 0.25);
}

@media (max-width: 768px) {
    .filing-journey-container .dataTables_wrapper .dataTables_filter,
    .filing-journey-container .dataTables_wrapper .dataTables_length {
        float: none;
        text-align: left;
        margin-bottom: 8px;
    }

    .filing-journey-container .dataTables_wrapper .dataTables_info,
    .filing-journey-container .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
    }
}

/* ============================================
   SELECT2 DROPDOWN — Z-index & Positioning
   Select2 renders its dropdown at <body> level,
   so it needs a high z-index to sit above modals
   and fixed headers.
   ============================================ */
.select2-container--open .select2-dropdown {
    z-index: 10060;
    border-radius: 0 0 6px 6px;
    border-color: #d2d2cd;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.select2-container--open .select2-dropdown--above {
    border-radius: 6px 6px 0 0;
}

.select2-container--classic.select2-container--open .select2-dropdown {
    border-color: #d2d2cd;
}

.select2-results__option--highlighted {
    background-color: #293503 !important;
    color: #fff !important;
}

/* ============================================
   HEADER-TOP — Responsive wrapping
   Make the top bar buttons wrap on small screens
   so they don't cause horizontal scroll
   ============================================ */
@media (max-width: 992px) {
    .header-top .header-top-dropdown > div,
    .header-top #header-top-second > .header-top-dropdown > div {
        flex-wrap: wrap;
        gap: 4px;
    }

    .header-top .btn-group > .btn {
        font-size: 11px;
        padding: 5px 8px;
    }

    /* Contact info bar: stack vertically */
    .header-top .header-top-dropdown > div > div[style*="margin-top"] {
        padding: 6px 8px;
        font-size: 12px;
    }

    .header-top .header-top-dropdown > div > div[style*="margin-top"] > div[style*="display: flex"] {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .header-top .col-sm-3 {
        display: none;
    }

    .header-top .col-sm-9 {
        width: 100%;
    }

    /* Navbar links wrap nicely */
    .main-navigation .navbar-nav {
        margin: 0;
    }

    .main-navigation .navbar-nav > li > a {
        padding: 10px 12px;
        font-size: 13px;
    }
}