/* Dashboard Gradient Cards */
.bg-gradient-blue { background: linear-gradient(135deg, #2563EB, #60A5FA) !important; }
.bg-gradient-purple { background: linear-gradient(135deg, #7C3AED, #A78BFA) !important; }
.bg-gradient-emerald { background: linear-gradient(135deg, #10B981, #34D399) !important; }
.bg-gradient-orange { background: linear-gradient(135deg, #F59E0B, #FBBF24) !important; }

/* ==========================================================================
   Premium UI Theme (Inspired by Logistix & Vercel Dashboard)
   ========================================================================== */

/* --- 1. GLOBAL LAYOUT & TYPOGRAPHY --- */
body {
    background-color: #f0f4fa !important; /* Soft light-blue background from screenshot */
    color: #111827 !important;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
    color: #111827 !important;
    letter-spacing: -0.02em !important;
}

h2 {
    font-size: 1.625rem !important;
}

.text-muted {
    color: #6B7280 !important;
}

.small.text-muted, .text-muted.small {
    color: #9CA3AF !important;
}

/* --- 2. CARD COMPONENT OVERRIDES --- */
.card {
    background-color: #FFFFFF !important;
    border-radius: 12px !important; /* 12px corners */
    border: 1px solid #e2e8f0 !important; /* Clean soft border */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02), 0 1px 2px -1px rgba(0, 0, 0, 0.01) !important; /* Soft shadow */
    overflow: hidden !important;
    transition: all 200ms ease !important;
}

.card:hover {
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.02) !important;
}

.card-header {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1.25rem 1.5rem !important;
}

.card-body {
    padding: 1.5rem !important;
}

/* --- 3. INPUTS, SELECTS, & FILTERS --- */
.form-control, .form-select {
    border-radius: 8px !important; /* 8px corners */
    padding: 0.5rem 0.85rem !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    border: 1px solid #D1D5DB !important;
    background-color: #FFFFFF !important;
    color: #111827 !important;
    height: 40px !important; /* Much more compact and elegant height */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02) !important;
    transition: all 200ms ease !important;
}
textarea.form-control {
    height: auto !important;
    resize: vertical !important;
    min-height: 150px !important;
}

.form-control::placeholder {
    color: #9CA3AF !important;
}

.form-control:focus, .form-select:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important; /* Subtle focus ring */
    outline: none !important;
}

/* Small inputs & dropdowns */
.form-select-sm, .form-control-sm {
    height: 38px !important;
    padding: 0.35rem 2rem 0.35rem 0.75rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
}

/* Checkboxes design */
.form-check-input {
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    margin-top: 0 !important;
    transition: all 200ms ease !important;
}
.form-check-input:checked {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* --- 4. BUTTONS --- */
.btn {
    border-radius: 8px !important;
    padding: 0.5rem 1.25rem !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    height: 40px !important; /* Matches input height */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    transition: all 200ms ease !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Primary Button standing out (Vibrant Blue) */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.18) !important;
}
.btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25) !important;
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
}
.btn-primary:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.15) !important;
}

/* Softer outline buttons */
.btn-outline-secondary, .btn-light {
    border: 1px solid #D1D5DB !important;
    color: #4B5563 !important;
    background-color: #FFFFFF !important;
}
.btn-outline-secondary:hover, .btn-light:hover {
    background-color: #F1F5F9 !important;
    color: #111827 !important;
    border-color: #9CA3AF !important;
}

.btn-outline-primary {
    border: 1px solid #c7d2fe !important;
    color: #4f46e5 !important;
    background-color: #eef2ff !important;
}
.btn-outline-primary:hover {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
}

/* Small Apply button */
.btn-sm {
    height: 38px !important;
    padding: 0.35rem 1.25rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
}

/* Table row actions (32px height) */
.table .btn-sm {
    height: 32px !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

.table .btn-outline-info {
    border: 1px solid #e2f1ff !important;
    color: #0284c7 !important;
    background-color: #f0f9ff !important;
}
.table .btn-outline-info:hover {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

.table .btn-outline-primary {
    border: 1px solid #e0e7ff !important;
    color: #4f46e5 !important;
    background-color: #eef2ff !important;
}
.table .btn-outline-primary:hover {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
}

.table .btn-outline-secondary {
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    background-color: #f8fafc !important;
}
.table .btn-outline-secondary:hover {
    background-color: #64748b !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}

/* Danger buttons lighter until hover */
.table .btn-outline-danger, .btn-outline-danger {
    border: 1px solid #fee2e2 !important;
    color: #EF4444 !important;
    background-color: #fef2f2 !important;
}
.table .btn-outline-danger:hover, .btn-outline-danger:hover {
    background-color: #EF4444 !important;
    color: #ffffff !important;
    border-color: #EF4444 !important;
}

/* --- 5. TABLE STYLING (Inspired by Logistix header) --- */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

/* Sticky Header Override to match Logistix Sky-Blue Header */
.table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: #4f46e5 !important; /* Vibrant Indigo Header matching logo */
    color: #ffffff !important; /* White text */
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    text-transform: capitalize !important; /* Nice capitalization */
    letter-spacing: 0.02em !important;
    padding: 0.85rem 1.25rem !important;
    border-bottom: none !important;
    border-top: none !important;
    box-shadow: none !important;
}

/* Round first-row headers to stay inside rounded card outlines */
.table thead tr:first-child th:first-child {
    border-top-left-radius: 12px !important;
}
.table thead tr:first-child th:last-child {
    border-top-right-radius: 12px !important;
}

/* Center-align first column checkboxes — ONLY for tables that have a checkbox column */
.table.has-checkbox td:first-child, .table.has-checkbox th:first-child {
    text-align: center !important;
    vertical-align: middle !important;
    width: 45px !important;
    padding: 0 !important;
}
.table.has-checkbox td:first-child .form-check-input, .table.has-checkbox th:first-child .form-check-input {
    margin: 0 auto !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Table body columns with vertical alignment & reduced padding */
.table td, .table th {
    vertical-align: middle !important;
}

.table tbody td {
    padding: 0.85rem 1.25rem !important; /* Shorter vertical padding for elegance */
    font-size: 0.88rem !important;
    color: #334155 !important;
    border-bottom: 1px solid #edf2f7 !important; /* Very soft borders */
    border-top: none !important;
}

/* Table alternating row backgrounds */
.table tbody tr {
    cursor: pointer !important;
    transition: background-color 150ms ease !important;
}

.table tbody tr:nth-child(odd) td {
    background-color: #ffffff !important; /* Odd rows white */
}

.table tbody tr:nth-child(even) td {
    background-color: #f8fafc !important; /* Soft, premium slate-gray for alternate rows */
}

/* Subtle Hover Highlight */
.table tbody tr:hover td {
    background-color: #f1f5f9 !important; /* Soft hover grey */
}

/* Table inline form spacing */
.table td form {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

.table .btn, .table td form button {
    vertical-align: middle !important;
}

@media (max-width: 767.98px) {
    .card-body.p-0 {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
    }

    .card-body.p-0 > .table,
    .card > .table,
    .card .table-responsive {
        display: block !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
    }

    .card-body.p-0 > .table,
    .card .table-responsive > .table {
        width: max-content !important;
        min-width: 100% !important;
        white-space: nowrap !important;
    }
}

code {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
}

/* --- 6. BADGES (999px pill-shape, softer backgrounds, better spacing) --- */
.badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.35rem 0.85rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    border-radius: 999px !important; /* 999px badges */
    border: 1px solid transparent !important;
    text-transform: capitalize !important;
    letter-spacing: 0.01em !important;
}

/* Active Status (Soft Green) */
.badge.bg-success {
    background-color: #ECFDF5 !important;
    color: #166534 !important;
    border: 1px solid #A7F3D0 !important;
}

/* Completed Status / Primary (Soft Blue) */
.badge.bg-primary {
    background-color: #eef2ff !important;
    color: #3730a3 !important;
    border: 1px solid #c7d2fe !important;
}

/* Hidden / Archived / Secondary Status (Soft Gray) */
.badge.bg-secondary, .badge.bg-light.text-dark {
    background-color: #F3F4F6 !important;
    color: #4B5563 !important;
    border: 1px solid #E5E7EB !important;
}

/* Draft / Warning Status (Soft Orange) */
.badge.bg-warning {
    background-color: #FFF7ED !important;
    color: #C2410C !important;
    border: 1px solid #FED7AA !important;
}

/* Info Badges / Item Type (Soft Purple) */
.badge.bg-info {
    background-color: #F3E8FF !important;
    color: #6B21A8 !important;
    border: 1px solid #E9D5FF !important;
}

/* --- 7. PROGRESS BARS --- */
.progress {
    height: 6px !important;
    border-radius: 999px !important;
    background-color: #F1F5F9 !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.progress-bar {
    border-radius: 999px !important;
    background: linear-gradient(90deg, #4f46e5, #818cf8) !important;
    box-shadow: none !important;
    transition: width 0.4s ease !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #16A34A, #4ADE80) !important;
}

.progress-bar.bg-primary {
    background: linear-gradient(90deg, #4f46e5, #818cf8) !important;
}

/* --- 8. NAVIGATION LAYOUT ADJUSTMENTS --- */
.navbar {
    padding: 0.75rem 1.5rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(18px) !important;
    border-bottom: 1px solid #E5E7EB !important;
}

.nav-link {
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: 8px !important;
    transition: all 200ms ease !important;
}

.nav-link:hover {
    background-color: #F1F5F9 !important;
    color: #4f46e5 !important;
}

.nav-item.active .nav-link, .nav-link.active {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
}

/* Compact Sidebar Filters styling */
#filterForm .form-select, #filterForm .form-control {
    height: 38px !important;
    font-size: 0.85rem !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 6px !important;
}
#filterForm .form-label {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}
#filterForm .btn {
    height: 38px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
}
#filterForm div {
    margin-bottom: 0.25rem !important;
}
#filterForm .d-flex.flex-column.gap-2 {
    margin-top: 0.5rem !important;
}
#filterForm .d-flex.gap-2 {
    gap: 0.5rem !important;
}
#filterForm .d-flex.flex-column.gap-2 > button, #filterForm .d-flex.flex-column.gap-2 > a {
    margin-top: 0.25rem !important;
}

/* Square action buttons in table cells */
.table td .btn-square {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
}

/* --- 9. PAGINATION STYLING (Brand Indigo & Bigger Centered Buttons) --- */
.pagination {
    display: flex !important;
    padding-left: 0 !important;
    list-style: none !important;
    gap: 6px !important; /* Elegant spacing between buttons */
}

.page-link {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #4f46e5 !important; /* Brand Indigo */
    background-color: #FFFFFF !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important; /* 8px rounded corners */
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 0.85rem !important;
    font-size: 0.95rem !important; /* Slightly bigger font size */
    font-weight: 600 !important;
    transition: all 150ms ease !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02) !important;
}

.page-link:hover {
    color: #4338ca !important;
    background-color: #F1F5F9 !important;
    border-color: #9CA3AF !important;
}

.page-item.active .page-link {
    z-index: 3 !important;
    color: #FFFFFF !important;
    background-color: #4f46e5 !important; /* Brand Indigo Active */
    border-color: #4f46e5 !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2) !important;
}

.page-item.disabled .page-link {
    color: #9CA3AF !important;
    background-color: #F9FAFB !important;
    border-color: #E5E7EB !important;
    pointer-events: none !important;
    opacity: 0.6 !important;
}
