/* assets/css/style.css - SIMPLE SCROLL VERSION */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d5c46;
    --secondary-color: #1a936f;
    --accent-color: #f39c12;
    --text-color: #333;
    --border-radius: 12px;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --procurement-color: #3498db;
    --payment-color: #f1c40f;
    --stores-color: #e67e22;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #eef2f3 0%, #8e9eab 100%);
    color: var(--text-color);
    min-height: 100vh;
}

.navbar {
    background: rgba(13, 92, 70, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
}

.navbar-brand {
    font-weight: 700;
    color: #fff !important;
    font-size: 1.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-link:hover {
    color: #fff !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../images/sugarcane_plantation_landscape.webp') center/cover;
}

.brand-logo {
    height: 36px;
    /* navbar height ekata match */
    width: auto;
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.login-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* ============================================
   TABLE CONTAINER - SIMPLE SCROLL SOLUTION
   ============================================ */

.table-container {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

/* THIS IS THE KEY - WRAPPER WITH SCROLL */
.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    /* HORIZONTAL SCROLL */
    overflow-y: auto;
    /* VERTICAL SCROLL */
    max-height: 600px;
    /* Maximum height before vertical scroll kicks in */
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

/* Custom Scrollbar Styling */
.table-scroll-wrapper::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 8px;
    border: 3px solid #f1f1f1;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
    cursor: pointer;
}

.table-scroll-wrapper::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* Firefox */
.table-scroll-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

/* Top Scrollbar Styling */
.top-scrollbar-wrapper {
    border: 2px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f8f9fa;
}

.top-scrollbar-wrapper::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.top-scrollbar-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.top-scrollbar-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 8px;
    border: 3px solid #f1f1f1;
}

.top-scrollbar-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
    cursor: pointer;
}

/* Icon Box Styling for KPI Cards */
.icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================
   TABLE STYLES
   ============================================ */

.custom-table {
    width: 100%;
    min-width: 2500px;
    /* FORCE HORIZONTAL SCROLL - CRITICAL! */
    margin: 0;
    border-collapse: collapse;
    background: #fff;
}

.custom-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-color);
}

.custom-table th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 14px 12px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.custom-table td {
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 120px;
    background: #fff;
}

/* Section Header Colors */
.th-procurement {
    background: var(--procurement-color) !important;
}

.th-payment {
    background: var(--payment-color) !important;
    color: #1a1a1a !important;
}

.th-stores {
    background: var(--stores-color) !important;
}

/* Section Column Styling */
.procurement-col {
    background: rgba(52, 152, 219, 0.12) !important;
    border-left: 2px solid var(--procurement-color) !important;
}

.payment-col {
    background: rgba(241, 196, 15, 0.12) !important;
    border-left: 2px solid var(--payment-color) !important;
}

.stores-col {
    background: rgba(230, 126, 34, 0.12) !important;
    border-left: 2px solid var(--stores-color) !important;
}

/* Body Cell Colors */
.custom-table tbody .procurement-col {
    background: rgba(52, 152, 219, 0.04);
}

.custom-table tbody .payment-col {
    background: rgba(241, 196, 15, 0.04);
}

.custom-table tbody .stores-col {
    background: rgba(230, 126, 34, 0.04);
}

.custom-table tbody tr:hover td {
    background: rgba(13, 92, 70, 0.06) !important;
}

/* Status Badges */
.badge-status {
    padding: 0.5em 1em;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-returned {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #ef4444;
}

/* Editable Inputs */
.editable-input {
    width: 100%;
    min-width: 100px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    padding: 6px 8px;
    transition: all 0.2s;
}

.editable-input:focus {
    border-color: var(--accent-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

.editable-select {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    padding: 6px 8px;
    min-width: 120px;
}

.editable-select:focus {
    border-color: var(--accent-color);
    background: #fff;
    outline: none;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1rem;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(13, 92, 70, 0.1);
    border-color: var(--primary-color);
}

/* Floating Button */
.add-row-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 10px 25px rgba(243, 156, 18, 0.4);
    transition: all 0.3s;
    z-index: 100;
    cursor: pointer;
    border: none;
}

.add-row-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: #e67e22;
}

/* Modal */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    background: var(--primary-color);
    color: #fff;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
}

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

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .table-container {
        padding: 1rem;
    }

    .table-scroll-wrapper {
        max-height: 500px;
    }

    .custom-table th,
    .custom-table td {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-width: 90px;
    }

    .table-scroll-wrapper::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    .add-row-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 576px) {
    .custom-table {
        min-width: 2200px;
        /* Still force scroll on small screens */
    }

    .custom-table th,
    .custom-table td {
        font-size: 0.7rem;
        padding: 5px 6px;
        min-width: 80px;
    }
}

@media print {

    .add-row-btn,
    .navbar,
    .btn-group {
        display: none !important;
    }

    .table-scroll-wrapper {
        overflow: visible !important;
        max-height: none !important;
        border: none;
    }

    .custom-table {
        min-width: 100% !important;
    }
}

/* ============================================
   DATATABLES PAGINATION CENTERING
   ============================================ */
.dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: center !important;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.dataTables_wrapper .dataTables_info {
    float: none !important;
    text-align: center !important;
    margin-bottom: 10px;
}