:root {
    /* Brand Colors - Pulse Corporate */
    --brand-primary: #0052CC;
    /* Enterprise Blue */
    --brand-primary-soft: #EBF2FF;
    --brand-secondary: #091E42;
    /* Deep Navy */
    --brand-success: #00875A;
    --brand-warning: #FF9900;
    --brand-danger: #DE350B;

    /* Neutral Palette */
    --text-main: #172B4D;
    --text-muted: #6B778C;
    --bg-page: #F4F5F7;
    --bg-surface: #FFFFFF;
    --border-subtle: #DFE1E6;
    --border-strong: #C1C7D0;

    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.08);
    --shadow-md: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
    --shadow-lg: 0 12px 24px -6px rgba(9, 30, 66, 0.2), 0 0 1px rgba(9, 30, 66, 0.31);
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography Overhaul */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--brand-secondary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.display-1,
.display-2,
.display-3 {
    letter-spacing: -0.03em;
    font-weight: 800;
}

/* Component Standardization */

/* Premium Cards */
.card-pro {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.card-pro:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

/* =============================================
   UNIFIED BUTTON SYSTEM
   ============================================= */

/* --- Base override: All buttons share transitions & micro-animation --- */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.01em;
    will-change: transform;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.97);
}

/* --- Bootstrap btn-primary override → Brand Blue --- */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 82, 204, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0747A6;
    border-color: #0747A6;
    color: white;
    box-shadow: 0 4px 14px rgba(0, 82, 204, 0.32);
}

.btn-primary:active {
    background-color: #0040a0;
    border-color: #0040a0;
    box-shadow: none;
}

/* --- Bootstrap btn-outline-primary override --- */
.btn-outline-primary {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 82, 204, 0.22);
}

/* --- Bootstrap btn-secondary override --- */
.btn-secondary {
    background-color: var(--bg-page);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--border-subtle);
    border-color: var(--border-strong);
    color: var(--text-main);
}

/* --- Bootstrap btn-danger override --- */
.btn-danger {
    background-color: var(--brand-danger);
    border-color: var(--brand-danger);
    box-shadow: 0 1px 3px rgba(222, 53, 11, 0.18);
}

.btn-danger:hover {
    background-color: #b52c07;
    border-color: #b52c07;
    box-shadow: 0 4px 14px rgba(222, 53, 11, 0.3);
}

/* --- btn-pro-primary / btn-pro: aliases for backward compatibility --- */
.btn-pro {
    font-family: var(--font-heading);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-pro-primary {
    background-color: var(--brand-primary);
    color: white;
    border: 1px solid var(--brand-primary);
    box-shadow: 0 1px 3px rgba(0, 82, 204, 0.18);
}

.btn-pro-primary:hover,
.btn-pro-primary:focus {
    background-color: #0747A6;
    border-color: #0747A6;
    color: white;
    box-shadow: 0 4px 14px rgba(0, 82, 204, 0.32);
}

.btn-pro-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-main);
}

.btn-pro-outline:hover {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.12);
}

/* --- NEW: Ghost Button (transparent, hover fills soft brand bg) --- */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.btn-ghost:hover {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: none;
    transform: translateY(-1px);
}

/* --- NEW: Danger Soft (red tint bg, for destructive secondary actions) --- */
.btn-danger-soft {
    background-color: rgba(222, 53, 11, 0.08);
    border: 1px solid rgba(222, 53, 11, 0.18);
    color: var(--brand-danger);
}

.btn-danger-soft:hover {
    background-color: var(--brand-danger);
    border-color: var(--brand-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(222, 53, 11, 0.28);
}

/* --- NEW: Icon-Round Button (circle, icon-only) --- */
.btn-icon-round {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.btn-icon-round:hover {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.btn-icon-round.btn-sm {
    width: 32px;
    height: 32px;
    min-width: 32px;
}

/* --- NEW: Action Group (flex row wrapper for paired buttons) --- */
.btn-action-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- Executive aliases (product_detail uses these) --- */
.btn-executive {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 8px;
}

.btn-executive-primary {
    background-color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.22);
}

.btn-executive-primary:hover {
    background-color: #0747A6;
    color: white;
    box-shadow: 0 6px 18px rgba(0, 82, 204, 0.32);
}

.btn-executive-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-main);
}

.btn-executive-outline:hover {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* Refined Form Elements */
.input-pro {
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    transition: var(--transition-base);
}

.input-pro:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
    outline: none;
}

/* Professional Tables */
.table-pro {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-main);
    vertical-align: top;
    border-color: var(--border-subtle);
}

.table-pro thead th {
    background-color: var(--bg-page);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-subtle);
}

.table-pro td {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
}

/* Navbar v3 - Enterprise Elevation */
.navbar-pro {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 0;

}

.nav-link-proV3 {
    color: var(--text-main) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem !important;
    border-radius: 6px;
    transition: var(--transition-base);
}

.nav-link-proV3:hover {
    color: var(--brand-primary) !important;
    background: var(--brand-primary-soft);
}

.nav-link-proV3.active {
    color: var(--brand-primary) !important;
}

/* Utility Classes */
.bg-subtle {
    background-color: var(--bg-page) !important;
}

.text-pro-muted {
    color: var(--text-muted) !important;
}

.rounded-xl {
    border-radius: 16px !important;
}

.shadow-premium {
    box-shadow: var(--shadow-lg) !important;
}

.ls-tight {
    letter-spacing: -0.02em;
}

.font-900 {
    font-weight: 900 !important;
}

/* Dashboard Sidebar v2 */
.sidebar-pro {
    background-color: var(--brand-secondary) !important;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 24px rgba(9, 30, 66, 0.05);
}

.sidebar-pro .nav-link-proV3 {
    color: rgba(255, 255, 255, 0.6) !important;
    margin: 4px 16px;
    padding: 12px 16px !important;
    border-radius: 10px;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.sidebar-pro .nav-link-proV3:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.sidebar-pro .nav-link-proV3.active {
    background-color: var(--brand-primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
}

.sidebar-pro .nav-link-proV3 .material-icons-outlined {
    font-size: 20px;
    opacity: 0.8;
}

.sidebar-pro .nav-link-proV3.active .material-icons-outlined {
    opacity: 1;
}

/* Custom Scrollbar for Sidebar */
.sidebar-pro .position-sticky::-webkit-scrollbar {
    width: 4px;
}

.sidebar-pro .position-sticky::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-pro .position-sticky::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-pro .position-sticky::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Fix main content collision with sidebar shadow */
.main-content {
    position: relative;
    z-index: 0;
}

.ls-2 {
    letter-spacing: 0.1em !important;
}

/* Mobile Tweak */
@media (max-width: 991.98px) {
    .navbar-pro {
        padding: 0.5rem 0;

    }
}

/* Refined Header Elements */
.dropdown-notif-menu {
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    width: 380px !important;
    max-width: 95vw;
}

.notif-header {
    background-color: #ffffff;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.notif-footer {
    background-color: #f8fafc;
    padding: 12px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.user-pill {
    padding: 6px 12px 6px 6px !important;
    border-radius: 12px !important;
    /* Changed from pill to rounded square for professional look */
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    height: 48px !important;
}

.user-pill:hover {
    border-color: rgba(0, 0, 0, 0.15) !important;
    background: #fafafa !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.user-pill.show {
    border-color: var(--brand-primary) !important;
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 82, 204, 0.08) !important;
    transform: translateY(-1px);
}

.avatar-premium {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #0042a5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* Matching the pill's new rounded square feel */
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 82, 204, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.notif-item {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background-color: #f8fbff;
}

.notif-item.unread {
    background-color: rgba(0, 82, 204, 0.03);
}

.notif-icon-box {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

/* Mobile-First Base Adjustments */
@media (max-width: 767.98px) {

    /* Ensure minimum touch target size (44x44px) */
    .btn,
    button,
    a.btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Full-width ONLY when explicitly marked — don't force all primary buttons */
    .btn.w-100 {
        width: 100%;
    }

    /* Standalone (not in a flex group) form submit buttons go full-width on mobile */
    form>.btn,
    .form-actions>.btn {
        width: 100%;
        padding: 12px 20px;
    }

    /* Responsive typography */
    body {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    h1,
    .display-1 {
        font-size: 2rem;
    }

    h2,
    .display-2 {
        font-size: 1.75rem;
    }

    h3,
    .display-3 {
        font-size: 1.5rem;
    }

    h4,
    .display-4 {
        font-size: 1.25rem;
    }

    h5,
    .display-5 {
        font-size: 1.1rem;
    }

    h6,
    .display-6 {
        font-size: 1rem;
    }

    /* Main content area adjustments */
    .main-content {
        padding: 1rem !important;
        margin-top: 60px;
    }

    /* Card spacing */
    .card-pro,
    .card {
        margin-bottom: 1rem;
    }

    /* Form inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }

    /* Tables - make scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 14px;
    }

    /* Stack columns vertically */
    .row>[class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Navbar adjustments */
    .navbar-pro {
        padding: 0.75rem 0 !important;

    }

    .navbar-brand {
        font-size: 1.25rem !important;
    }

    /* Offcanvas menu */
    .offcanvas {
        width: 85% !important;
        max-width: 320px;
    }

    /* Sidebar navigation in offcanvas */
    .nav-link-proV3 {
        padding: 12px 16px !important;
        font-size: 15px !important;
    }

    /* Stats cards */
    .stat-card {
        text-align: center;
        padding: 1.5rem 1rem;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 12px;
    }

    /* Reduce padding on containers */
    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Dashboard specific */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .dashboard-header .btn {
        width: 100%;
    }
}

/* Tablet adjustments (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .main-content {
        padding: 1.5rem !important;
    }
}

/* Small phones (< 576px) */
@media (max-width: 575.98px) {
    .main-content {
        padding: 0.75rem !important;
    }

    .card-pro {
        padding: 1rem !important;
    }

    /* Single column for everything */
    .row>[class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-link {
        padding: 14px 16px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .card:hover {
        transform: none;
    }
}

/* CTA Section Enhancements */
.text-gradient-cyan {
    background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.transform-perspective {
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.5s ease;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* Skeleton Loader - Facebook Style */
.skeleton-loader {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #f6f7f8 4%, #edeef1 25%, #f6f7f8 36%);
    background-size: 1000px 100%;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton-card {
    height: 100%;
    border-radius: 12px;
    background-color: white;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.skeleton-image {
    height: 180px;
    width: 100%;
}

.skeleton-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-footer {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}