* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Sinhala', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin-bottom: 18px;
    font-size: 26px;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid transparent;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.section {
    display: none;
    background: white;
    padding: 30px;
    min-height: calc(100vh - 170px);
    margin: 0;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    color: #667eea;
    font-size: 24px;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Items Grid Styles - NEW */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
    padding: 10px;
}

.item-card {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.item-card:hover::before {
    transform: scaleX(1);
}

.item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.item-card:active {
    transform: translateY(-4px);
}

.item-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.item-name-si {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.item-name-en {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
    font-weight: 500;
}

.item-stock {
    display: inline-block;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.item-stock.low {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.item-stock.out {
    background: linear-gradient(135deg, #636363 0%, #a2ab58 100%);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
    grid-column: 1/-1;
}

.recent-distributions {
    margin-top: 25px;
}

.recent-distributions h3 {
    color: #495057;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

table tbody tr:last-child td {
    border-bottom: none;
}

.stock-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
    padding: 10px 0;
}

.stock-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.stock-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.stock-card h3 {
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

.stock-card .stock-quantity {
    font-size: 38px;
    font-weight: bold;
    margin: 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stock-card .stock-status {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 500;
}

.suppliers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
    padding: 10px 0;
}

.supplier-card {
    background: white;
    border: 2px solid #e9ecef;
    padding: 25px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.supplier-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transform: translateY(-5px);
    border-color: #667eea;
}

.supplier-card h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 19px;
    font-weight: 700;
}

.supplier-card p {
    margin: 8px 0;
    color: #495057;
    font-size: 14px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
    padding: 10px 0;
}

.report-card {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.report-card h3 {
    font-size: 17px;
    margin-bottom: 12px;
    opacity: 0.95;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-value {
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* Modal එකේ මේ section එක replace කරන්න */

/* Modern Modal Styles - Replace existing modal CSS */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
    padding: 20px;
}

.modern-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.4s ease;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    border: 3px solid rgba(102, 126, 234, 0.3);
}

.modal-header-design {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.modal-icon {
    font-size: 42px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.modal-header-design h2 {
    color: white;
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.close {
    color: white;
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    background: rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

form {
    padding: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.form-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.form-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.card-icon {
    font-size: 24px;
}

.card-header h3 {
    font-size: 16px;
    color: #495057;
    font-weight: 700;
    margin: 0;
}

/* Color Coding for Cards */
.farmer-card {
    border-left: 4px solid #667eea;
}

.item-card {
    border-left: 4px solid #38ef7d;
}

.price-card {
    border-left: 4px solid #f093fb;
}

.payment-card {
    border-left: 4px solid #fa709a;
}

.notes-card {
    border-left: 4px solid #feca57;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.15);
    transform: scale(1.02);
}

.form-group input:read-only {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    cursor: not-allowed;
    font-weight: 700;
    color: #667eea;
}

.price-input-wrapper {
    position: relative;
}

.currency-symbol {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #667eea;
    font-size: 16px;
}

.price-input-wrapper input {
    padding-right: 50px;
}

.total-display {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 3px;
}

.total-display input {
    background: white;
    border: none;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    text-align: center;
}

.total-label {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #667eea;
    font-size: 14px;
}

.price-suggestion {
    display: block;
    margin-top: 5px;
    color: #11998e;
    font-size: 12px;
    font-weight: 600;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
    grid-column: 1 / -1;
}

.btn-cancel,
.btn-save {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-cancel:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.btn-save {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(17, 153, 142, 0.4);
}

/* Animation for price changes */
@keyframes priceChange {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.price-animation {
    animation: priceChange 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modern-modal {
        width: 98%;
        margin: 5% auto;
    }
    
    .modal-header-design {
        padding: 20px;
    }
    
    .modal-icon {
        font-size: 32px;
    }
    
    .modal-header-design h2 {
        font-size: 20px;
    }
    
    form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-save {
        width: 100%;
        justify-content: center;
    }
}
/* මේ styles existing CSS file එකේ අගට add කරන්න */

/* Items Price Grid */
.items-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.item-price-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-price-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 0 0 0 100%;
}

.item-price-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.item-price-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.item-info h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
    font-weight: 700;
}

.item-info .item-code {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
}

.item-icon-large {
    font-size: 36px;
    line-height: 1;
}

.price-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    text-align: center;
}

.price-label {
    color: white;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.price-value {
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.price-date {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    margin-top: 5px;
}

.no-price {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-update-price,
.btn-edit-item {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-update-price {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    color: white;
}

.btn-update-price:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.btn-edit-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-edit-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.daily-price-alert {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 20px 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

.alert-icon {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.alert-content h3 {
    color: #2d3436;
    margin-bottom: 5px;
    font-size: 18px;
}

.alert-content p {
    color: #636e72;
    font-size: 14px;
    margin: 0;
}

.price-update-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    color: white;
    text-align: center;
}

.price-update-info h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.price-update-info p {
    font-size: 14px;
    opacity: 0.9;
}

#last-price-info {
    color: #11998e;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .items-price-grid {
        grid-template-columns: 1fr;
    }
    
    .daily-price-alert {
        flex-direction: column;
        text-align: center;
    }
}
