:root {
    --primary-color: #2a9d8f;
    --secondary-color: #e9c46a;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ccc;
    --error-color: #e76f51;
}
body {
    font-family: "Noto Sans Tamil", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* --- Styles for PWA Install Screen --- */
/* --- Style for the Install Button --- */
#install-button {
    display: block; /* Will be managed by JS, but 'block' is the default when shown */
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    background-color: #28a745; /* A nice green for "install" */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#install-button:hover {
    background-color: #218838; /* A darker green on hover */
}
#install-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1000;
}

.install-box {
    background-color: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 350px;
}

.install-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.install-box h1 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.install-box p {
    font-size: 1em;
    color: #666;
    margin-bottom: 20px;
}

.install-instructions {
    font-size: 0.9em;
    color: #555;
    text-align: left;
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
}
h2 { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; margin-top: 0; }
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input, select, button { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 5px; box-sizing: border-box; font-size: 16px; font-family: inherit; }
input[readonly] { background-color: #e9ecef; cursor: not-allowed; }
button { background-color: var(--primary-color); color: white; border: none; cursor: pointer; font-weight: bold; transition: background-color 0.3s; }
button:hover { background-color: #264653; }
.back-button { background-color: #6c757d; margin-top: 15px; }
.back-button:hover { background-color: #5a6268; }
.nav-container { text-align: center; }
.page-header { display: flex; justify-content: space-between; align-items: center; position: relative; padding-bottom: 15px; margin-bottom: 15px; }
.page-header h1 { margin: 0; font-size: 1.8em; border-bottom: none; color: var(--primary-color); }
.logout-icon { color: var(--error-color); text-decoration: none; transition: transform 0.2s; }
.logout-icon:hover { transform: scale(1.1); }
.welcome-message { text-align: center; font-size: 1.1em; margin-bottom: 30px; }
.nav-choices { display: flex; flex-direction: column; gap: 20px; }
.choice-button { display: block; background-color: var(--primary-color); color: white; padding: 25px; font-size: 1.5em; text-decoration: none; border-radius: 8px; transition: transform 0.2s, background-color 0.2s; }
.choice-button:hover { background-color: #264653; transform: scale(1.03); }
#downloadPdfBtn { background-color: #e76f51; display: none; margin-bottom: 15px; }
.table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border-color); padding: 10px; text-align: left; white-space: nowrap; }
th { background-color: #f2f2f2; }

/* --- மாற்றம் 1: மொத்த வரிசைக்கான புதிய ஸ்டைல் --- */
.table-total-row td {
    font-weight: bold;
    background-color: #f2f2f2;
}

.balance-negative { color: var(--error-color); font-weight: bold; }
.balance-positive { color: #008000; font-weight: bold; }
.final-summary-box { margin-top: 25px; padding: 15px; border: 1px solid #aaa; border-radius: 5px; background-color: #f9f9f9; }
.final-summary-box p { margin: 10px 0; font-size: 1.1em; display: flex; justify-content: space-between; }
.final-summary-box hr { border: none; border-top: 1px solid #ccc; margin: 15px 0; }
.final-summary-box .final-balance-display { font-size: 1.4em !important; font-weight: bold; }
#message { padding: 10px; margin-bottom: 15px; border-radius: 4px; text-align: center; font-weight: bold; display: none; }
.message-success { background-color: #d4edda; color: #155724; }
.message-error { background-color: #f8d7da; color: #721c24; }
#print-header { display: none; align-items: center; justify-content: space-between; padding-bottom: 15px; margin-bottom: 20px; border-bottom: 2px solid #333; }
#print-header .header-left, #print-header .header-right { flex: 1; }
#print-header .header-left { text-align: left; }
#print-header .header-right { text-align: right; }
#print-header .header-logo { flex-shrink: 0; padding: 0 20px; }
#print-header .god-image { max-height: 90px; display: block; }
#print-header p { margin: 2px 0; font-size: 13px; font-weight: bold; line-height: 1.5; }
.choice-chip-container { display: flex; gap: 10px; margin-bottom: 25px; }
.choice-chip { flex-grow: 1; background-color: #e9ecef; color: #495057; border: 1px solid #ced4da; font-weight: normal; }
.choice-chip.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); font-weight: bold; }
.data-list { list-style-type: none; padding: 0; max-height: 300px; overflow-y: auto; border: 1px solid #eee; border-radius: 4px; margin-top: 15px; }
.data-list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #eee; }
.data-list-item:last-child { border-bottom: none; }
.item-actions button { padding: 5px 10px; font-size: 14px; width: auto; min-width: 60px; margin-left: 5px; }
.edit-btn { background-color: #007bff; }
.delete-btn { background-color: #dc3545; }
.balance-btn { background-color: #ffc107; color: #212529; }
.modal-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 100; }
.modal-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 25px; border-radius: 8px; width: 90%; max-width: 400px; z-index: 101; }
.modal-content h3 { margin-top: 0; }
.filter-controls { display: flex; gap: 20px; align-items: flex-end; }
.filter-group { flex: 1; }
.transaction-actions { display: flex; gap: 5px; }
.transaction-actions button { padding: 4px 8px; font-size: 13px; width: auto; min-width: 50px; }
.print-only { display: none; }

@media (max-width: 600px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    .filter-controls { flex-direction: column; align-items: stretch; }
    .page-header h1 { font-size: 1.5em; }
}
@media print {
    body { padding: 0; margin: 0; font-size: 10pt; }
    .container { box-shadow: none; border: none; padding: 0; }
    body * { visibility: hidden; }
    #printable-wrapper, #printable-wrapper * { visibility: visible; }
    #printable-wrapper { position: absolute; left: 0; top: 0; width: 100%; }
    #print-header { display: flex; }
    #printable-wrapper h3, #printable-wrapper h4 { font-size: 11pt; margin: 5px 0; }
    button, .back-button, #reportForm, .nav-container, .transaction-actions, .transaction-actions-header { display: none !important; }
    
    /* --- மாற்றம் 2: கச்சிதமான அட்டவணைக்கான ஸ்டைல்கள் --- */
    .table-responsive-wrapper { overflow-x: visible; }
    .table-responsive-wrapper table th, .table-responsive-wrapper table td {
        padding: 4px 6px; /* பேடிங்கைக் குறைக்கவும் */
        font-size: 9pt;   /* எழுத்து அளவைக் குறைக்கவும் */
    }
    .final-summary-box { padding: 10px; margin-top: 15px; }
    .final-summary-box p { font-size: 10pt; margin: 5px 0; }
    .final-summary-box .final-balance-display { font-size: 11pt !important; }
    
    .col-vilai { display: none; }
    .screen-only { display: none; }
    .print-only { display: table-row; } /* மொத்த வரிசையைக் காண்பிக்கவும் */
}