@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #059669;
    --primary-light: #34d399;
    --primary-dark: #065f46;
    --secondary: #6366f1;
    --accent: #f59e0b;
    --bg-main: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: #1e293b;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Sidebar Styling */
.sidebar-modern {
    background: var(--sidebar-bg);
    border-right: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}

.nav-link-modern {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.25rem 1rem;
    border-radius: 0.75rem;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none !important;
}

.nav-link-modern:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-link-modern.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.nav-link-modern i {
    width: 1.5rem;
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

/* Card Styling */
.card-modern {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* Topbar Search Styling */
.search-container-modern {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input-modern {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-input-modern:focus {
    background: white;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    outline: none;
}

.search-icon-modern {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Status Pipeline Styling */
.pipeline-step-modern {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: white;
    border: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.3s;
}

.pipeline-step-modern:hover {
    border-color: var(--primary-light);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .sidebar-modern {
        width: 280px !important;
    }
    .pipeline-step-modern {
        min-width: 100%;
    }
}

/* Mobile global fixes */
@media (max-width: 767px) {
    /* Ensure tables scroll instead of breaking layout */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Modals take full width on small screens */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-xl, .modal-lg {
        max-width: calc(100vw - 1rem);
    }

    /* Dropdown menus don't overflow screen */
    .dropdown-menu-right {
        right: 0;
        left: auto;
        max-width: calc(100vw - 2rem);
    }

    /* Cards with hover lift — disable on touch to avoid sticky state */
    .card-modern:hover {
        transform: none;
    }
}

/* ===== Tabulator Modern Theme Override ===== */
.tabulator {
    border: none !important;
    background: transparent !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
}
.tabulator .tabulator-header {
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}
.tabulator .tabulator-header .tabulator-col {
    background: #f8fafc !important;
    border-right: 1px solid #f1f5f9 !important;
    border-bottom: none !important;
}
.tabulator .tabulator-header .tabulator-col-title {
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    font-family: 'Inter', sans-serif !important;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background: #f1f5f9 !important;
}
.tabulator-row {
    border-bottom: 1px solid #f1f5f9 !important;
    background: #fff !important;
}
.tabulator-row:hover {
    background: #f8fafc !important;
}
.tabulator-row .tabulator-cell {
    color: #475569 !important;
    border-right: none !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
}
.tabulator-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    font-size: 12px !important;
}
.tabulator-footer .tabulator-page {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
    margin: 0 2px !important;
}
.tabulator-footer .tabulator-page.active {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #fff !important;
}
.tabulator-footer .tabulator-page:hover:not(.active):not([disabled]) {
    background: #f1f5f9 !important;
}
.tabulator-footer .tabulator-page[disabled] {
    opacity: 0.4 !important;
}
.tabulator .tabulator-header-filter input {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    background: #fff !important;
    color: #475569 !important;
    outline: none !important;
}
.tabulator .tabulator-header-filter input:focus {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1) !important;
}
.tabulator-row.tabulator-selected {
    background: #ecfdf5 !important;
}
.tabulator-row.tabulator-selected:hover {
    background: #d1fae5 !important;
}
.tabulator .tabulator-placeholder {
    color: #94a3b8 !important;
    font-style: normal !important;
    font-size: 13px !important;
}
.inactive-row {
    background: #f8fafc !important;
    opacity: 0.55;
}

/* ===== Standard Table Modern Theme ===== */
.table-modern thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 20px;
}
.table-modern tbody td {
    color: #475569;
    font-size: 13px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.table-modern tbody tr:hover {
    background: #f8fafc;
}
.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Badge Modern ===== */
.badge-modern-green  { display:inline-flex; align-items:center; padding: 2px 10px; border-radius:9999px; font-size:11px; font-weight:700; background:#d1fae5; color:#065f46; }
.badge-modern-red    { display:inline-flex; align-items:center; padding: 2px 10px; border-radius:9999px; font-size:11px; font-weight:700; background:#fee2e2; color:#991b1b; }
.badge-modern-amber  { display:inline-flex; align-items:center; padding: 2px 10px; border-radius:9999px; font-size:11px; font-weight:700; background:#fef3c7; color:#92400e; }
.badge-modern-blue   { display:inline-flex; align-items:center; padding: 2px 10px; border-radius:9999px; font-size:11px; font-weight:700; background:#dbeafe; color:#1e40af; }
.badge-modern-slate  { display:inline-flex; align-items:center; padding: 2px 10px; border-radius:9999px; font-size:11px; font-weight:700; background:#f1f5f9; color:#475569; }
