/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-text-size-adjust: 100%; /* Prevent iOS font scaling */
}

html {
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Prevent horizontal overflow */
.container,
main,
.page {
    max-width: 100%;
    overflow-x: hidden;
}

/* Header */
header {
    background-color: #1976d2;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Improve nav container */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.nav-left {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-separator {
    color: rgba(255,255,255,0.5);
    margin: 0 0.5rem;
}

.current-claim {
    color: #ffeb3b;
    font-weight: bold;
    margin-right: 0.5rem;
}

.claim-nav {
    background-color: rgba(255,193,7,0.2);
}

.claim-nav:hover {
    background-color: rgba(255,193,7,0.3);
}

.nav-btn {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none !important;
    display: inline-block;
}

.nav-btn:hover {
    background-color: rgba(255,255,255,0.3);
    text-decoration: none !important;
}

a.nav-btn {
    text-decoration: none !important;
}

a.nav-btn:hover,
a.nav-btn:visited,
a.nav-btn:active,
a.nav-btn:link {
    text-decoration: none !important;
}

/* Specific fix for Help link */
.nav-right a.nav-btn {
    text-decoration: none !important;
    color: white;
}

.nav-btn-primary {
    background-color: #4caf50 !important;
    font-weight: bold;
}

.nav-btn-primary:hover {
    background-color: #45a049 !important;
}

.nav-btn-developer {
    background-color: #ff9800 !important;
}

.nav-btn-developer:hover {
    background-color: #f57c00 !important;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    transition: all 0.3s;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.click-hint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card.clickable:hover .click-hint {
    opacity: 1;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1976d2;
}


/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 1rem 0;
}

form {
    display: grid;
    gap: 1rem;
}

input, select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-height: 44px;
    box-sizing: border-box;
}

input:focus, select:focus {
    outline: none;
    border-color: #1976d2;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    min-height: 44px;
    min-width: 44px;
}

/* Mobile form improvements */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        margin: 0.5rem 0;
        max-width: 100%;
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
        min-height: 48px;
    }
    
    button {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        width: 100%;
    }
}

button[type="submit"], .btn-primary {
    background-color: #1976d2;
    color: white;
}

button[type="submit"]:hover, .btn-primary:hover {
    background-color: #1565c0;
}

/* Tables */
.claim-item, .transaction-item, .account-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.claim-number {
    font-weight: bold;
    color: #1976d2;
}

.status-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-label {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.claim-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.status-closed {
    background-color: #9e9e9e;
    color: white;
}

/* Reserve Display */
.reserves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.reserve-item {
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 0.9rem;
}

.reserve-label {
    color: #666;
}

.reserve-amount {
    font-weight: bold;
}

/* Transactions */
.transaction-item {
    display: grid;
    grid-template-columns: 120px 1fr 180px;
    align-items: start;
    gap: 1rem;
}

.transaction-item.reversed {
    opacity: 0.6;
    text-decoration: line-through;
    border-left: 4px solid #999;
    padding-left: calc(1rem - 4px);
}

.transaction-item.reversal {
    border-left: 4px solid #ff9800;
    padding-left: calc(1rem - 4px);
    background-color: #fff3e0;
}

.reversed-badge, .reversal-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.reversed-badge {
    background-color: #999;
    color: white;
}

.reversal-badge {
    background-color: #ff9800;
    color: white;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.transaction-date {
    color: #666;
    font-size: 0.9rem;
}

.transaction-amount {
    text-align: right;
    font-weight: bold;
}

.debit {
    color: #f44336;
}

.credit {
    color: #4caf50;
}

/* Chart of Accounts */
.account-section {
    margin-bottom: 2rem;
}

.account-section h3 {
    color: #1976d2;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e3f2fd;
}

.account-item {
    display: grid;
    grid-template-columns: 100px 1fr auto 150px;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

.account-item.has-activity {
    background-color: #f8f9fa;
}

.account-item.no-activity {
    opacity: 0.7;
}

.account-code {
    font-weight: bold;
    color: #1976d2;
}

.account-name {
    font-size: 0.95rem;
}

.account-meta {
    text-align: right;
}

.transaction-count {
    font-size: 0.85rem;
    color: #666;
    background-color: #e3f2fd;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.no-activity-label {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

.account-balance {
    text-align: right;
    font-weight: bold;
}

.account-balance.positive {
    color: #2e7d32;
}

.account-balance.negative {
    color: #d32f2f;
}

.account-balance.zero {
    color: #999;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem;
    background-color: #333;
    color: white;
    text-align: center;
}

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-actions button {
    background-color: #555;
    color: white;
}

.footer-actions button:hover {
    background-color: #666;
}

/* Utility Classes */
.recent-section {
    margin-top: 2rem;
}

.filter-bar {
    margin-bottom: 1rem;
}

.success-message {
    background-color: #4caf50;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.error-message {
    background-color: #f44336;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

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

.custom-alert {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.custom-alert h3 {
    color: #4caf50;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.custom-alert p {
    color: #333;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.custom-alert .alert-details {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 0.9rem;
}

.custom-alert .alert-note {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 1rem;
}

.custom-alert button {
    background-color: #1976d2;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

.custom-alert button:hover {
    background-color: #1565c0;
}

/* Claim Navigation Grid */
.claim-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.claim-nav-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.claim-nav-section h4 {
    color: #333;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1976d2;
}

/* Claim Sections */
.claim-section {
    background: white;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #1976d2;
}

.section-header h3 {
    margin: 0;
    color: #333;
}

@media (max-width: 768px) {
    .claim-nav-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .claim-detail-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .claim-tabs {
        flex-wrap: wrap;
        justify-content: center;
        margin: 0;
        gap: 0.25rem;
    }
    
    .claim-tab {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
        min-height: 44px;
        flex: 1 1 calc(33.333% - 0.25rem);
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}

/* Claim Detail Page */
.claim-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 1rem;
}

.claim-title-section {
    flex: 0 0 auto;
}

.claim-tabs {
    display: flex;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
    margin: 0 2rem;
}

.claim-actions-right {
    flex: 0 0 auto;
}

/* Claim Tabs */
.claim-tab {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px 6px 0 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.claim-tab:hover {
    background-color: #e8f4fd;
    color: #1976d2;
}

.claim-tab.active {
    background-color: #1976d2;
    color: white !important;
    border-color: #1976d2;
    font-weight: 500;
}

/* Claim Tab Content */
.claim-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.claim-tab-content.active {
    display: block;
}

.btn-secondary {
    background-color: #757575;
    color: white;
}

.btn-secondary:hover {
    background-color: #616161;
}

.claim-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.claim-info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.claim-info-card h4 {
    color: #666;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-size: 0.9rem;
}

.info-value {
    font-weight: bold;
}

.claim-actions {
    margin: 2rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.claim-transactions {
    margin-top: 2rem;
}

textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    min-height: 80px;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #1976d2;
}

.view-claim-btn {
    background-color: #1976d2;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.view-claim-btn:hover {
    background-color: #1565c0;
}

/* Reserves Page Styling */
.reserves-display {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.reserves-section {
    margin-bottom: 3rem;
}

.reserves-section h3 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1976d2;
}

.reserves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.reserve-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #1976d2;
}

.reserve-card h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 0.9rem;
}

.reserve-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1976d2;
}

/* Reserves Actions Grid */
.reserves-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

.reserves-actions-grid .reserves-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.reserves-actions-grid .form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reserves-actions-grid form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reserves-actions-grid textarea {
    flex: 1;
    min-height: 100px;
}

@media (max-width: 768px) {
    .reserves-actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .reserves-actions-grid .reserves-section {
        height: auto;
    }
}

/* Claim Chart of Accounts */
.accounts-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.account-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.account-section h4 {
    color: #333;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1976d2;
}

.accounts-list {
    display: grid;
    gap: 0.75rem;
}

.claim-account-header {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    font-weight: bold;
    color: #666;
    font-size: 0.875rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 0.5rem;
}

.claim-account-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #1976d2;
}

.claim-account-item.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.claim-account-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #f0f7ff;
}

.claim-account-code {
    font-weight: bold;
    color: #1976d2;
    font-size: 0.9rem;
}

.claim-account-name {
    color: #333;
    font-size: 0.9rem;
}

.claim-account-activity {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.claim-account-balance {
    text-align: right;
    font-weight: bold;
    font-size: 0.95rem;
}

.claim-account-balance.positive {
    color: #4caf50;
}

.claim-account-balance.negative {
    color: #f44336;
}

.claim-account-balance.zero {
    color: #999;
}

/* Accounting Summary */
.accounting-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.accounting-summary h4 {
    color: #333;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1976d2;
}

.equation-display {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.equation-item {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 120px;
}

.equation-operator {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1976d2;
}

.balance-check {
    text-align: center;
    padding: 1rem;
}

.balance-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

.balance-status.balanced {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.balance-status.unbalanced {
    background-color: #ffebee;
    color: #c62828;
}

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

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid #eee;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

@media (max-width: 600px) {
    .modal {
        width: 95%;
        margin: 1rem;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-actions,
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions button,
    .modal-actions button,
    .form-actions .btn,
    .modal-actions .btn {
        width: 100%;
        min-height: 44px;
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* Fix form inputs in modals */
    .modal input,
    .modal select,
    .modal textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }
    
    .modal textarea {
        min-height: 100px;
    }
}

/* Revenue Transaction Styles */
.revenue-transaction {
    border-left: 4px solid #4caf50;
}

.revenue-badge {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charge Type Selector */
.charge-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.charge-type-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.charge-type-label {
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Amount Calculation Section */
.amount-calculation-section {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.calc-toggle {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.calc-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.calc-toggle label span {
    margin-left: 0.5rem;
}

.hourly-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.calculated-amount {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #e3f2fd;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

/* Markup Section */
#markupSection {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin: 1rem 0;
}

.markup-toggle {
    margin-bottom: 0.5rem;
}

.markup-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.markup-inputs {
    padding: 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.markup-type-selector {
    display: flex;
    gap: 1rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #ffeaa7;
}

.markup-type-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.markup-type-selector input[type="radio"] {
    margin-right: 0.5rem;
}

.markup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: center;
}

.markup-grid > div {
    text-align: center;
}

.markup-grid label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.amount-display {
    font-weight: bold;
    font-size: 1.1rem;
}

.markup-amount {
    color: #ff6b6b;
}

.total-amount {
    color: #4caf50;
    font-size: 1.2rem;
}

/* Invoice Section */
.invoice-section {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #e3f2fd;
    border-radius: 6px;
}

.invoice-section h5 {
    margin: 0 0 0.75rem 0;
    color: #1976d2;
}

.invoice-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    row-gap: 0.75rem;
}

.bill-to-container {
    display: flex;
    flex-direction: column;
}

.bill-to-container select {
    width: 100%;
}

.bill-to-container input {
    width: 100%;
}

/* Revenue Summary */
.revenue-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.revenue-summary h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

/* Form styling fixes for Billables */
#claimBillablesTab form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#claimBillablesTab .form-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

#claimBillablesTab .form-container h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

#claimBillablesTab select,
#claimBillablesTab input[type="text"],
#claimBillablesTab input[type="number"],
#claimBillablesTab input[type="date"],
#claimBillablesTab textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

#claimBillablesTab textarea {
    min-height: 80px;
    resize: vertical;
}

#claimBillablesTab button[type="submit"] {
    padding: 0.75rem 1.5rem;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

#claimBillablesTab button[type="submit"]:hover {
    background-color: #1976d2;
}

/* Fix the hourly inputs layout */
.hourly-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Fix markup grid layout */
.markup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
}

.markup-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.markup-grid label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* Invoices and Billables Lists */
.invoices-section, .billables-section {
    margin-top: 2rem;
}

/* Fix for the Generated Invoices and Billable Transactions sections */
#claimBillablesTab h4 {
    margin: 1.5rem 0 0.75rem 0;
    color: #333;
    font-size: 1.1rem;
}

#claimBillablesTab .no-items-message {
    color: #666;
    font-style: italic;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.invoice-item, .billable-item {
    background: white;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.invoice-item.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.invoice-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.invoice-number {
    font-weight: bold;
    color: #1976d2;
}

.invoice-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-draft {
    background-color: #e0e0e0;
    color: #424242;
}

.status-sent {
    background-color: #fff3cd;
    color: #856404;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

/* Stat Details Modal */
.stat-details-modal {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
}

.stat-details-modal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.stat-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.stat-detail-item:hover {
    background-color: #f8f9fa;
}

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

.detail-label {
    font-weight: 500;
    color: #333;
}

.detail-value {
    font-weight: bold;
    color: #1976d2;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h4 {
    color: #666;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* Developer Page Styles */
.developer-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.developer-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.developer-card h3 {
    color: #ff9800;
    margin-bottom: 0.75rem;
}

.developer-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.developer-card .button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.developer-card .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #f57c00;
}

/* Receivable Info Display */
.receivable-info {
    background-color: #e3f2fd;
    border: 1px solid #1976d2;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.receivable-info .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.receivable-info .info-label {
    font-weight: bold;
    color: #1565c0;
}

.receivable-info .info-value {
    color: #333;
}

.receivable-info .warning {
    color: #f57c00;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Clickable Account Items */
.account-item.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.account-item.clickable:hover {
    background-color: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.account-item.clickable .transaction-count {
    color: #1976d2;
    text-decoration: underline;
}

/* Account Transactions Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.account-transactions-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 90%;
    max-height: 80vh;
    width: 800px;
    display: flex;
    flex-direction: column;
}

.account-transactions-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-transactions-modal .modal-header h3 {
    margin: 0;
    color: #333;
}

.account-transactions-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.account-transactions-modal .close-btn:hover {
    color: #333;
}

.account-transactions-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

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

.transactions-table th,
.transactions-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.transactions-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #666;
}

.transactions-table td.amount {
    text-align: right;
    font-family: monospace;
}

.transactions-table tbody tr:hover {
    background-color: #f9f9f9;
}

.transactions-table tfoot tr {
    background-color: #f0f0f0;
    border-top: 2px solid #ccc;
}

.transactions-table tfoot td {
    font-weight: bold;
}

/* Invoice Details Modal */
.invoice-details-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.invoice-details-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-details-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.invoice-header-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-group label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.invoice-description,
.invoice-amounts {
    margin-bottom: 1.5rem;
}

.invoice-description h4,
.invoice-amounts h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1.1rem;
}

.invoice-description p {
    color: #333;
    line-height: 1.5;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.amount-row.total {
    border-bottom: none;
    border-top: 2px solid #ddd;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.invoice-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: #2196F3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976d2;
}

.btn-secondary {
    background-color: #757575;
    color: white;
}

.btn-secondary:hover {
    background-color: #616161;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68900;
}

/* Responsive Design - Mobile First Approach */

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Hamburger Menu Icon */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-toggle:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

/* Mobile Header */
.header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #1976d2;
    color: white;
}

.header-mobile h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background: #f5f5f5;
    padding: 1rem;
    border-top: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-menu-item {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus {
    background: #f0f0f0;
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-menu-item:active {
    transform: translateY(0);
    background: #e8f4fd;
}

.mobile-menu-item[data-action="newclaim"] {
    background: #4caf50;
    color: white;
    font-weight: bold;
    border-color: #45a049;
}

.mobile-menu-item[data-action="newclaim"]:hover {
    background: #45a049;
}

/* Responsive Media Queries */

/* Large Tablet/Small Desktop */
@media (max-width: 1280px) and (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .claims-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .developer-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet styles */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .developer-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .claim-info-grid {
        grid-template-columns: 1fr;
    }
    
    .claims-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    /* Tablet navigation improvements */
    .nav-container {
        padding: 0.75rem;
    }
    
    .nav-left {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 48px;
        min-width: 48px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Tablet modal improvements */
    .modal {
        width: 85%;
        max-width: 700px;
        margin: 2rem auto;
    }
    
    .modal-body {
        padding: 2rem;
        max-height: 70vh;
    }
    
    /* Tablet form improvements */
    .form-container {
        padding: 1.75rem;
        max-width: 100%;
    }
    
    .form-row {
        display: flex;
        flex-direction: row;
        gap: 1rem;
    }
    
    .form-group {
        flex: 1;
    }
    
    /* Tablet table improvements */
    .account-item {
        grid-template-columns: 100px 1fr auto auto;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .transaction-item {
        grid-template-columns: 120px 1fr 150px;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    /* Claim tabs for tablet */
    .claim-tabs {
        gap: 0.5rem;
        justify-content: flex-start;
    }
    
    .claim-tab {
        flex: 0 1 auto;
        min-width: 120px;
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    /* Mobile styles */
    
    /* Hide desktop navigation, show mobile navigation */
    .header-mobile {
        display: flex !important;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu {
        display: none; /* Initially hidden, shown via JavaScript */
    }
    
    /* Navigation */
    .navbar {
        padding: 0;
        min-height: auto;
    }
    
    .nav-container {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        position: relative;
    }
    
    /* Legacy styles for fallback when mobile header isn't working */
    .nav-left {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
        padding-right: 120px; /* Space for developer button */
    }
    
    .nav-left .nav-btn {
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem;
        text-align: center;
        text-decoration: none !important;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        min-width: 48px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Help button specific fix */
    .nav-left a.nav-btn {
        text-decoration: none !important;
    }
    
    .nav-left a.nav-btn:hover {
        text-decoration: none !important;
    }
    
    .nav-btn-primary {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 0.5rem;
        min-height: 48px;
    }
    
    .nav-right {
        position: absolute;
        top: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-right .nav-btn {
        font-size: 0.75rem;
        padding: 0.6rem 0.8rem;
        min-width: 100px;
        min-height: 44px;
    }
    
    #claimSpecificNav {
        width: 100%;
        margin-top: 0.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    #claimSpecificNav .claim-nav {
        flex: 1 1 calc(33.333% - 0.5rem);
        min-width: 80px;
        font-size: 0.75rem;
        padding: 0.4rem;
        text-align: center;
    }
    
    /* Main content */
    main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Tables - make them scrollable */
    .transaction-item,
    .claim-item {
        font-size: 0.875rem;
        display: block;
        padding: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        margin-bottom: 0.75rem;
    }
    
    .claim-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .claim-number {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .claim-info {
        display: block;
        margin-bottom: 0.75rem;
    }
    
    .claim-info > div {
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }
    
    .claim-info strong {
        display: inline-block;
        min-width: 80px;
        color: #666;
    }
    
    .view-claim-btn {
        width: 100%;
        margin-top: 0.5rem;
        min-height: 44px;
    }
    
    /* Transaction responsive layout */
    .transaction-item {
        border-left: 4px solid #1976d2;
        background: #f9f9f9;
    }
    
    .transaction-date {
        font-weight: bold;
        color: #1976d2;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .transaction-description {
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }
    
    .transaction-amount {
        font-size: 1.1rem;
        font-weight: bold;
        text-align: left;
        padding: 0.5rem;
        background: white;
        border-radius: 4px;
        border: 1px solid #e0e0e0;
    }
    
    /* Account items on mobile */
    .account-item {
        font-size: 0.875rem;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .account-item .account-code {
        display: inline-block;
        margin-right: 0.5rem;
        font-size: 0.9rem;
    }
    
    .account-item .account-name {
        display: inline-block;
        font-size: 0.85rem;
        max-width: calc(100% - 80px);
        word-wrap: break-word;
    }
    
    .account-item .no-activity-label,
    .account-item .account-meta {
        grid-column: 1;
        margin-top: 0.25rem;
        text-align: left;
    }
    
    .account-item .account-balance {
        grid-column: 1;
        text-align: left;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e0e0e0;
    }
    
    .transaction-grid {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .transaction-header {
        display: none;
    }
    
    .transaction-item {
        display: block;
        padding: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    
    .transaction-item > div::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        display: inline-block;
        width: 100px;
    }
    
    /* Forms */
    .form-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 0.875rem;
        min-height: 48px;
        border-radius: 6px;
        border: 2px solid #ddd;
        transition: border-color 0.2s ease;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #1976d2;
        outline: none;
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
    }
    
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .reserves-actions-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Modals */
    .modal {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .modal-body {
        max-height: 75vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .modal-close {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Buttons */
    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .button-group button,
    .button-group a {
        width: 100%;
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    button,
    .btn,
    input[type="submit"] {
        min-height: 48px;
        min-width: 48px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        border-radius: 6px;
    }
    
    .nav-btn,
    .claim-tab {
        min-height: 48px;
        min-width: 48px;
        padding: 0.875rem 1rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Form actions */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .form-actions button,
    .form-actions .btn {
        width: 100%;
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none;
    }
    
    /* Claim cards - make them touch-friendly */
    .claim-card {
        cursor: pointer;
        min-height: 120px;
        padding: 1.25rem;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        transition: all 0.2s ease;
    }
    
    .claim-card:hover,
    .claim-card:focus {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .claim-card:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    .claims-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Claim tabs */
    .claim-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .claim-tab {
        flex: 1 1 calc(50% - 0.25rem);
        font-size: 0.875rem;
        padding: 0.875rem 0.5rem;
        min-height: 48px;
        text-align: center;
        border-radius: 6px;
    }
    
    /* Footer */
    footer {
        position: static;
        margin-top: 2rem;
    }
    
    .footer-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Small mobile styles */
    
    /* Mobile header and menu only */
    .header-mobile {
        padding: 0.75rem 1rem;
    }
    
    .header-mobile h1 {
        font-size: 1.1rem;
    }
    
    .menu-toggle {
        min-width: 48px;
        min-height: 48px;
        padding: 0.75rem;
    }
    
    .mobile-menu {
        padding: 0.75rem;
    }
    
    .mobile-menu-item {
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 52px;
    }
    
    /* Better mobile navigation layout (fallback) */
    .navbar {
        padding: 0.5rem 0.25rem;
    }
    
    .nav-container {
        gap: 0.25rem;
    }
    
    .nav-left {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding-right: 90px; /* Reduced space for developer button */
    }
    
    .nav-left .nav-btn {
        flex: 1 1 calc(50% - 0.125rem);
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
        min-width: 44px;
        min-height: 48px;
    }
    
    .nav-btn-primary {
        flex: 1 1 100%;
        margin-top: 0.25rem;
        font-size: 0.8rem;
    }
    
    .nav-right {
        right: 0.25rem;
        top: 0;
        gap: 0.25rem;
    }
    
    .nav-right .nav-btn {
        font-size: 0.65rem;
        padding: 0.3rem 0.4rem;
        min-width: 85px;
    }
    
    /* Stack claim tabs */
    .claim-tab {
        flex: 1 1 calc(50% - 0.25rem);
    }
    
    #claimSpecificNav .claim-nav {
        flex: 1 1 calc(50% - 0.25rem);
        font-size: 0.7rem;
        padding: 0.35rem;
    }
    
    /* Smaller text */
    body {
        font-size: 14px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Smaller stat cards */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Compact forms */
    input, select, textarea {
        padding: 0.5rem;
        font-size: 14px;
    }
    
    button {
        padding: 0.5rem 1rem;
        font-size: 14px;
    }
}

/* Export buttons container */
.export-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: flex-end;
}

.export-buttons-container .btn {
    white-space: nowrap;
}

/* Utility classes for responsive tables */
@media (max-width: 768px) {
    .responsive-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .responsive-table table {
        min-width: 600px;
    }
    
    /* Export buttons responsive */
    .export-buttons-container {
        justify-content: center;
    }
    
    .export-buttons-container .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        font-size: 0.875rem;
        padding: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .export-buttons-container .btn {
        flex: 1 1 100%;
    }
}

/* Additional mobile styles for account items in portrait mode */
@media (max-width: 600px) and (orientation: portrait) {
    .account-item {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
        background: #f8f9fa;
        border-left: 3px solid #1976d2;
    }
    
    .account-item .account-code {
        font-weight: bold;
        color: #1976d2;
        font-size: 0.95rem;
        margin-right: 0.75rem;
    }
    
    .account-item .account-name {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.875rem;
        color: #555;
        line-height: 1.3;
    }
    
    .account-item .account-meta {
        display: block;
        margin-top: 0.5rem;
        font-size: 0.8rem;
    }
    
    .account-item .transaction-count {
        display: inline-block;
        padding: 0.15rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .account-item .no-activity-label {
        display: inline-block;
        font-size: 0.8rem;
        color: #999;
    }
    
    .account-item .account-balance {
        display: block;
        font-size: 1.1rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #dee2e6;
    }
    
    /* Account section headers */
    .account-section h3,
    .account-section h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Export buttons specific to portrait */
    .export-buttons-container {
        margin-bottom: 1rem;
    }
    
    .export-buttons-container .btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Invoice Edit Modal */
.invoice-edit-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.invoice-edit-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.invoice-edit-modal .form-group {
    margin-bottom: 1rem;
}

.invoice-edit-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.invoice-edit-modal .form-group input,
.invoice-edit-modal .form-group select,
.invoice-edit-modal .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.invoice-edit-modal .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.invoice-edit-modal .form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.invoice-edit-modal .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.notification.success {
    background-color: #4caf50;
    color: white;
}

.notification.error {
    background-color: #f44336;
    color: white;
}

.notification.warning {
    background-color: #ff9800;
    color: white;
}

.notification.info {
    background-color: #2196F3;
    color: white;
}

.notification-copy,
.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.notification-copy:hover,
.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.notification-message {
    flex: 1;
    margin-right: 0.5rem;
}

/* Confirmation Dialog */
.confirm-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
}

.confirm-dialog .modal-body p {
    margin: 0;
    color: #333;
    line-height: 1.5;
}

.confirm-dialog .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Copy Button Styles for Testing Guide */
.copyable {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copyable:hover {
    background: #e0e0e0;
}

.copy-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 4px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: #0056b3;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Stat Card Link */
.stat-card-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #1976d2;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.2s;
}

.stat-card-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.stat-card {
    position: relative;
}

/* Clickable Stat Detail Items */
.stat-detail-item.clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.stat-detail-item.clickable:hover {
    background-color: #f5f5f5;
}

/* Claims List Modal */
.claims-list-modal {
    max-height: 400px;
    overflow-y: auto;
}

.claim-item-modal {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.claim-item-modal:hover {
    background: #f0f0f0;
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.claim-item-modal .claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.claim-item-modal .claim-amounts {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
    font-size: 0.9em;
    color: #666;
}

/* Developer Tools Tabs */
.developer-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.developer-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.developer-tab:hover {
    color: #1976d2;
    background: #f5f5f5;
}

.developer-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: white;
}

.developer-tab-content {
    display: none;
}

.developer-tab-content.active {
    display: block;
}

/* Developer Actions Grid */
.developer-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.action-group {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.action-group h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.action-group button {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}

.action-group button:last-child {
    margin-bottom: 0;
}

/* Developer Testing Grid */
.developer-testing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Debug Tools Grid */
.debug-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.debug-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.debug-section h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.debug-section button {
    display: inline-block;
    margin: 0 0.5rem 0.5rem 0;
}

/* Data Management Grid */
.data-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Claude Agents Grid */
.claude-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.agent-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.agent-card:hover {
    border-color: #1976d2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.agent-header h4 {
    margin: 0;
    color: #333;
}

.agent-usage {
    margin-top: 0.75rem;
    font-size: 0.9em;
    color: #666;
}

/* Small buttons for agent cards */
.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-small:hover {
    background: #0d47a1;
}

.btn-small.btn-green {
    background: #4caf50;
}

.btn-small.btn-green:hover {
    background: #388e3c;
}

.btn-small.btn-cyan {
    background: #00bcd4;
}

.btn-small.btn-cyan:hover {
    background: #0097a7;
}

.btn-small.btn-purple {
    background: #9c27b0;
}

.btn-small.btn-purple:hover {
    background: #7b1fa2;
}

/* Touch improvements for all interactive elements */
@media (hover: none) and (pointer: coarse) {
    /* Touch device specific styles */
    .nav-btn:hover,
    .claim-tab:hover,
    .stat-card:hover,
    .account-item:hover,
    .transaction-item:hover {
        transform: none; /* Disable hover animations on touch */
    }
    
    /* Increase touch targets on touch devices */
    .nav-btn,
    .claim-tab,
    button,
    .btn,
    input,
    select {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Improve touch scrolling */
    .modal-body,
    main,
    .page {
        -webkit-overflow-scrolling: touch;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high DPI displays */
    .stat-card,
    .modal,
    .form-container {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}