/* Tally-Style Reports CSS Framework */

/* Tally Report Container */
.tally-report {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    background: white;
    color: #000;
    line-height: 1.2;
    font-size: 12px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Tally Report Header */
.tally-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tally-company-name {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.tally-company-address {
    font-size: 11px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.tally-report-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px 0;
}

.tally-report-period {
    font-size: 11px;
    margin-bottom: 5px;
}

.tally-report-date {
    font-size: 10px;
    color: #666;
}

/* Tally Report Body */
.tally-body {
    margin: 20px 0;
}

/* Tally Tables */
.tally-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 11px;
}

.tally-table th,
.tally-table td {
    padding: 4px 8px;
    text-align: left;
    border: none;
    vertical-align: top;
}

.tally-table th {
    background: #f0f0f0;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #000;
}

.tally-table tr:nth-child(even) {
    background: #fafafa;
}

.tally-table tr:hover {
    background: #f5f5f5;
}

/* Tally Column Styles */
.tally-col-account {
    width: 40%;
    font-weight: normal;
}

.tally-col-description {
    width: 30%;
    font-style: italic;
    color: #666;
}

.tally-col-debit {
    width: 15%;
    text-align: right;
    font-weight: bold;
}

.tally-col-credit {
    width: 15%;
    text-align: right;
    font-weight: bold;
}

.tally-col-amount {
    width: 20%;
    text-align: right;
    font-weight: bold;
}

.tally-col-date {
    width: 12%;
    text-align: center;
}

.tally-col-ref {
    width: 15%;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.tally-col-narration {
    width: 58%;
}

/* Tally Amount Formatting */
.tally-amount {
    font-family: 'Courier New', monospace;
    text-align: right;
    white-space: nowrap;
}

.tally-amount.positive {
    color: #000;
}

.tally-amount.negative {
    color: #d32f2f;
}

.tally-amount.zero {
    color: #666;
}

/* Tally Section Headers */
.tally-section {
    margin: 20px 0;
}

.tally-section-title {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #e0e0e0;
    padding: 8px 12px;
    border-left: 4px solid #000;
    margin: 15px 0 10px 0;
}

.tally-subsection-title {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f5f5f5;
    padding: 6px 10px;
    border-left: 3px solid #666;
    margin: 10px 0 5px 0;
}

/* Tally Totals */
.tally-total-row {
    border-top: 2px solid #000;
    background: #f0f0f0;
    font-weight: bold;
    font-size: 12px;
}

.tally-subtotal-row {
    border-top: 1px solid #666;
    background: #f8f8f8;
    font-weight: bold;
    font-size: 11px;
}

.tally-grand-total-row {
    border-top: 3px double #000;
    background: #e0e0e0;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
}

/* Tally Account Hierarchy */
.tally-account-level-1 {
    padding-left: 0px;
    font-weight: bold;
    text-transform: uppercase;
}

.tally-account-level-2 {
    padding-left: 20px;
    font-weight: bold;
}

.tally-account-level-3 {
    padding-left: 40px;
    font-weight: normal;
}

.tally-account-level-4 {
    padding-left: 60px;
    font-weight: normal;
    color: #666;
}

/* Tally Report Footer */
.tally-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #ccc;
    font-size: 10px;
    color: #666;
}

.tally-footer-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tally-generated-at {
    text-align: right;
    font-style: italic;
}

/* Tally Print Styles */
@media print {
    .tally-report {
        margin: 0;
        padding: 10px;
        font-size: 10px;
    }
    
    .tally-table {
        font-size: 9px;
    }
    
    .tally-table th,
    .tally-table td {
        padding: 2px 4px;
    }
    
    .tally-company-name {
        font-size: 16px;
    }
    
    .tally-report-title {
        font-size: 14px;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Tally Report Controls */
.tally-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.tally-controls .form-group {
    margin-bottom: 10px;
}

.tally-controls label {
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    display: block;
}

.tally-controls .form-control {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.tally-controls .btn {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 12px;
    border: 1px solid #000;
    background: white;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-right: 5px;
}

.tally-controls .btn:hover {
    background: #000;
    color: white;
}

.tally-controls .btn-primary {
    background: #000;
    color: white;
}

.tally-controls .btn-primary:hover {
    background: #333;
}

/* Tally Report Summary */
.tally-summary {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 20px 0;
}

.tally-summary-title {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.tally-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px dotted #ccc;
}

.tally-summary-item:last-child {
    border-bottom: none;
    font-weight: bold;
    border-top: 1px solid #000;
    margin-top: 5px;
    padding-top: 8px;
}

.tally-summary-label {
    font-weight: normal;
}

.tally-summary-value {
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Tally Report Notes */
.tally-notes {
    margin-top: 20px;
    padding: 10px;
    background: #fffacd;
    border-left: 4px solid #ffd700;
    font-size: 10px;
    line-height: 1.4;
}

.tally-notes-title {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* Tally Report Responsive */
@media (max-width: 768px) {
    .tally-report {
        padding: 10px;
        font-size: 10px;
    }
    
    .tally-table {
        font-size: 9px;
    }
    
    .tally-table th,
    .tally-table td {
        padding: 2px 4px;
    }
    
    .tally-col-account {
        width: 35%;
    }
    
    .tally-col-description {
        width: 25%;
    }
    
    .tally-col-debit,
    .tally-col-credit,
    .tally-col-amount {
        width: 20%;
    }
    
    .tally-account-level-2 {
        padding-left: 15px;
    }
    
    .tally-account-level-3 {
        padding-left: 30px;
    }
    
    .tally-account-level-4 {
        padding-left: 45px;
    }
}

/* Tally Report Loading */
.tally-loading {
    text-align: center;
    padding: 40px;
    font-size: 12px;
    color: #666;
}

.tally-loading::after {
    content: '...';
    animation: tally-dots 1.5s infinite;
}

@keyframes tally-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Tally Report Error */
.tally-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.tally-error-title {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* Tally Report Empty State */
.tally-empty {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.tally-empty-icon {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.tally-empty-message {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
