/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Screen Management */
.screen {
    display: block;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 50px;
    text-align: center;
    max-width: 500px;
    margin: 100px auto;
}

.logo {
    margin-bottom: 40px;
}

.logo i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.logo h1 {
    color: #333;
    font-size: 2.2rem;
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

.login-form {
    text-align: left;
}

.login-form h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.login-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

/* Password field styling - FIXED */
#pinInput {
    font-family: monospace;
    letter-spacing: 3px;
    text-align: center;
    font-size: 1.2rem;
}

.login-form input:focus {
    border-color: #667eea;
    outline: none;
}

.setup-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.setup-section h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.note {
    color: #666;
    font-size: 0.85rem;
    margin-top: 10px;
    font-style: italic;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-submit, .btn-warning, .btn-logout, .btn-icon, .btn-small {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #dee2e6;
    width: 100%;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-submit {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 152, 0, 0.4);
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
}

.btn-logout:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-icon {
    background: #6c757d;
    color: white;
    padding: 10px 15px;
}

.btn-icon:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* App Header */
.app-header {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.role-badge.user {
    background: #6c757d;
    color: white;
}

.date-display {
    font-size: 1.2rem;
    color: #666;
}

.date-display i {
    margin-right: 10px;
    color: #667eea;
}

.balance-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    min-width: 400px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.balance-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.balance-item.total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    padding-top: 10px;
    border-top: 2px solid #667eea;
}

.amount {
    font-weight: 600;
}

.amount.in {
    color: #4CAF50;
}

.amount.out {
    color: #f44336;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Admin Controls */
.admin-controls {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #667eea;
}

.admin-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.backdate-toggle {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.backdate-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.backdate-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.backdate-section small {
    color: #666;
    font-size: 0.85rem;
    display: block;
    margin-top: 5px;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.entry-form {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    grid-column: 1;
}

.transactions-section, .history-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    grid-column: 2;
}

.history-section {
    grid-column: 1 / -1;
}

.entry-form h2, .transactions-section h2, .history-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.entry-form h2 i, .transactions-section h2 i, .history-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #555;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
}

.form-group input, .form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    border-color: #667eea;
    outline: none;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    gap: 10px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-filter input {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
}

th {
    padding: 15px;
    text-align: left;
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #333;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Type Badges */
.type-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.type-in {
    background: #d4edda;
    color: #155724;
}

.type-out {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.edit-btn {
    background: #ffc107;
    color: #212529;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.view-btn {
    background: #17a2b8;
    color: white;
}

/* Footer */
.app-footer {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.footer-info {
    display: flex;
    gap: 30px;
    color: #666;
}

.footer-info span i {
    margin-right: 8px;
    color: #667eea;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: 60vh;
}

/* Users List */
.users-list {
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-item-actions {
    display: flex;
    gap: 10px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #4CAF50;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}

/* Print Styles */
@media print {
    .no-print, 
    .admin-controls,
    button,
    .section-header .controls,
    .footer-actions,
    .action-buttons,
    #actionHeader {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .entry-form {
        display: none !important;
    }
    
    .transactions-section,
    .history-section {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    table {
        font-size: 12px !important;
    }
    
    th, td {
        padding: 8px !important;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .transactions-section {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .balance-box {
        min-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .app-footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* Security note */
.security-note {
    color: #666;
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: center;
}