/* ============================================
   STAFF PAYMENT REGISTER - MODULE CSS
   MilkRecord RMRD
   ============================================ */

/* Field Label */
.field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.field-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 0.65rem;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111418;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.field-input:focus {
    border-color: #13ec49;
    box-shadow: 0 0 0 3px rgba(19, 236, 73, 0.1);
}

.field-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Autofill glow */
.af-glow {
    animation: afPulse 0.7s ease;
}

@keyframes afPulse {
    0% { border-color: #13ec49; background: #f0fdf4; }
    100% { border-color: #e5e7eb; background: #fff; }
}

/* Card animation */
@keyframes cardIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.card-new {
    animation: cardIn 0.3s ease;
}

/* Saved chip */
.s-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1d4ed8;
    cursor: pointer;
    transition: all 0.15s;
    margin-right: 4px;
    margin-bottom: 4px;
}

.s-chip:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* Modal animations */
@keyframes modalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: #fff;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Table responsive */
@media (max-width: 768px) {
    .responsive-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .responsive-table table {
        min-width: 800px;
    }
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-success {
    background-color: #10b98120;
    color: #10b981;
}

.badge-warning {
    background-color: #f59e0b20;
    color: #f59e0b;
}

.badge-error {
    background-color: #ef444420;
    color: #ef4444;
}

.badge-primary {
    background-color: #13ec4933;
    color: #13ec49;
}

/* Action buttons in tables */
.action-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn-view {
    background: #eff6ff;
    color: #1d4ed8;
}

.action-btn-view:hover {
    background: #dbeafe;
}

.action-btn-edit {
    background: #fef3c7;
    color: #92400e;
}

.action-btn-edit:hover {
    background: #fde68a;
}

.action-btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn-delete:hover {
    background: #fecaca;
}

.action-btn-approve {
    background: #d1fae5;
    color: #065f46;
}

.action-btn-approve:hover {
    background: #a7f3d0;
}

.action-btn-paid {
    background: #10b98120;
    color: #10b981;
}

.action-btn-paid:hover {
    background: #10b98140;
}

/* Summary cards hover effect */
.summary-card {
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 9999px;
}

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

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

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #13ec49;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast animation */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #102215;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .modal-box {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 1rem;
    }
    
    .field-input {
        font-size: 0.875rem;
        padding: 0.6rem 0.875rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Dark mode support */
.dark .field-input {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.dark .modal-box {
    background: #1f2937;
}

.dark .card {
    background: #1f2937;
    border-color: #374151;
}

.dark table thead {
    background: #111827;
}

.dark table tbody tr:hover {
    background: #1f2937;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
}

/* Loading state */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dark .loading-overlay {
    background: rgba(31, 41, 55, 0.8);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Highlight animation for new records */
@keyframes highlightNew {
    0% { background-color: #fef3c7; }
    100% { background-color: transparent; }
}

.highlight-new {
    animation: highlightNew 2s ease;
}

/* Pulse animation for live indicators */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}