/* Soft UI Design System - Pastel & Gradient Version */
:root {
    /* Colors - Pastel & Light */
    --primary-color: #60a5fa;
    /* Pastel Blue */
    --primary-gradient: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
    /* Very Light Gradient */
    --primary-color-hover: #3b82f6;
    --secondary-color: #94a3b8;
    /* Slate */
    --success-color: #34d399;
    /* Emerald */
    --danger-color: #f87171;
    /* Red */
    --warning-color: #fbbf24;
    /* Amber */
    --info-color: #60a5fa;

    /* Backgrounds */
    --bg-body: #f8fafc;
    /* Very Light Blue-Gray */
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    /* Text */
    --text-main: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #cbd5e1;

    /* Shadows & Borders */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 1rem;
    /* 16px */
    --border-radius-sm: 0.5rem;
    /* 8px */
    --border-color: #e2e8f0;
    /* Slate 200 */
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    height: 100vh;
    max-height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--bg-sidebar);
    padding-top: 1.5rem;
    box-shadow: var(--shadow-soft);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.brand-logo {
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Gradient Text */
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 1rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: #eff6ff;
    /* Very light blue bg */
}

.nav-link.active,
.nav-link.active * {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 10px -1px rgba(14, 148, 136, 0.4);
}

/* Sidebar Submenus */
.nav-link[data-bs-toggle="collapse"] {
    position: relative;
    cursor: pointer;
}

.nav-link[data-bs-toggle="collapse"]::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.25rem;
    transition: transform 0.3s ease;
}

.nav-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.submenu .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    margin: 0.1rem 1rem;
    opacity: 0.8;
}

.submenu .nav-link:hover {
    opacity: 1;
}

.submenu .nav-link.active {
    opacity: 1;
    font-weight: 600;
    background: rgba(96, 165, 250, 0.1);
    color: var(--primary-color);
    box-shadow: none;
}

.sidebar-divider {
    border-top: 1px solid var(--border-color);
    margin: 1rem 1.5rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 2rem;
}

/* Cards */
.card-soft {
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(96, 165, 250, 0.4);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(96, 165, 250, 0.5);
}

/* Tables */
.table {
    margin-bottom: 0;
    background-color: white;
}

.table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.625rem 1rem;
    color: var(--text-main);
    background-color: #f8fafc;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.3);
    /* Lighter focus ring */
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 600;
    border-radius: 9999px;
    display: inline-block;
}

.bg-success {
    background-color: var(--success-color) !important;
    color: white !important;
}

.bg-info {
    background-color: var(--info-color) !important;
    color: white !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
    color: #334155 !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
    color: white !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
    color: white !important;
}

.bg-primary {
    background: var(--primary-gradient) !important;
    color: white !important;
}

.extra-small {
    font-size: 0.7rem;
    padding: 0.25em 0.6em;
}

/* Bootstrap Overrides */
.bg-primary {
    background: var(--primary-gradient) !important;
}


.text-primary {
    color: var(--primary-color) !important;
}

/* Report Cards - Modern Aesthetic */
.report-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 180px;
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: white;
    z-index: 1;
}

.report-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.report-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    z-index: -1;
    transition: all 0.4s ease;
}

.report-card:hover::before {
    transform: scale(1.2) translate(-10%, 10%);
}

.report-card .icon-box {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.report-card .card-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.report-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Soft Modern Color Palettes */
.card-blue-soft {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
}

.card-purple-soft {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
}

.card-teal-soft {
    background: linear-gradient(135deg, #99f6e4 0%, #5eead4 100%);
}

.card-orange-soft {
    background: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%);
}

.card-emerald-soft {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
}

.card-pill-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    display: inline-block;
}

/* Animations */
@keyframes pulse-danger {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-pulse {
    animation: pulse-danger 2s infinite ease-in-out;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    body.sidebar-collapsed .sidebar,
    html.sidebar-collapsed-preload .sidebar,
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 1085 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        background-color: #0f172a !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.sidebar-collapsed .sidebar.show,
    html.sidebar-collapsed-preload .sidebar.show,
    .sidebar.show {
        transform: translateX(0) !important;
    }

    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .sidebar-company-logo,
    body.sidebar-collapsed .sidebar .ai-command-container,
    body.sidebar-collapsed .sidebar .nav-section-title,
    body.sidebar-collapsed .sidebar .submenu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }

    /* Mobile Navbar (header.php) */
    .mobile-nav {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        background: white;
        padding: 0.75rem 1rem;
        box-shadow: var(--shadow-soft);
        position: sticky;
        top: 0;
        z-index: 999;
    }
}

@media (min-width: 992px) {
    .mobile-nav {
        display: none !important;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1075;
    display: none;
}

.sidebar-overlay.show {
    display: block !important;
}

/* Top Navbar & Notifications */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.6rem 1.25rem !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem !important;
    position: sticky;
    top: 1rem;
    z-index: 990;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}

.notification-bell:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #f87171 !important;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(248, 113, 113, 0.4);
}

.notification-dropdown {
    width: 350px !important;
    max-height: 480px !important;
    overflow-y: auto;
    border: none !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(0,0,0,0.08) !important;
    border-radius: 1rem !important;
    padding: 0 !important;
    margin-top: 12px !important;
}

.notification-item {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
    text-decoration: none !important;
    display: block;
    color: var(--text-main);
}

.notification-item:hover {
    background: #f8fafc;
    padding-left: 1.5rem;
}

.notification-header {
    padding: 1rem 1.25rem !important;
    background: #f8fafc !important;
    font-weight: 700;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid #f1f5f9;
}

.notification-empty {
    padding: 3rem 2rem !important;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem !important;
}

/* User Profile Styles */
.user-profile-btn {
    padding: 0.35rem 0.35rem 0.35rem 1.25rem;
    border-radius: 50px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none !important;
}

.user-profile-btn:hover {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.avatar-initial {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(96, 165, 250, 0.4);
    margin-left: 0.75rem;
}

@media (max-width: 991.98px) {
    .top-navbar {
        top: 0;
        margin-bottom: 1rem;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #f1f5f9;
    }
}

/* Corporate Styling for SweetAlert2 Buttons */
.swal2-popup .swal2-actions .swal2-confirm.swal2-styled,
.swal2-styled.swal2-confirm {
    background-color: #0b2f5c !important;
    background-image: linear-gradient(135deg, #0b2f5c 0%, #1e40af 100%) !important;
    color: #ffffff !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    padding: 0.6rem 1.75rem !important;
    box-shadow: 0 4px 6px -1px rgba(11, 47, 92, 0.4) !important;
    border: none !important;
    outline: none !important;
}

.swal2-popup .swal2-actions .swal2-confirm.swal2-styled:hover,
.swal2-styled.swal2-confirm:hover {
    background-color: #1e40af !important;
    background-image: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
    box-shadow: 0 6px 8px -1px rgba(30, 64, 175, 0.5) !important;
    transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════════════════
   GLOBAL RESPONSIVE ENGINE (MOBILE, TABLET & DESKTOP SUITE)
   ════════════════════════════════════════════════════════════════ */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        padding: 0.75rem !important;
        width: 100% !important;
    }
    .mobile-nav {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 1030;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    .sidebar {
        width: 280px !important;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1050;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 768px) {
    .card, .card-body {
        padding: 0.85rem !important;
    }

    .form-control, .form-select, .btn {
        font-size: 0.9rem !important;
    }

    .table th, .table td {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.8rem !important;
    }

    .floating-quick-notes-btn {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        bottom: 15px !important;
        left: 15px !important;
        transform: none !important;
    }
    .floating-quick-calc-btn {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        bottom: 15px !important;
        right: 15px !important;
    }

    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
}

@media (max-width: 576px) {
    .btn-mobile-block {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .dropdown-menu {
        max-width: 94vw !important;
    }
}