* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f1ea;
    color: #2b2b2b;
    margin: 0;
    padding: 0;
}
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}
.wide {
    max-width: 900px;
}
.topbar {
    background: #d9822b;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.topbar-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    object-fit: cover;
}
.topbar-left span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}
h1, h2 { color: #a8451f; }
.card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 14px;
}
input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}
button, .btn {
    display: inline-block;
    background: #d9822b;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 16px;
    margin-top: 16px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-whatsapp {
    background: #25D366;
}
.btn-secondary {
    background: #888;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #eee;
}
th { background: #f8f3ea; }
.error {
    background: #fde2e2;
    color: #a10000;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.success {
    background: #e0f7e9;
    color: #0a7a3d;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-box {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-box .num {
    font-size: 22px;
    font-weight: 700;
    color: #a8451f;
}
.stat-box .label {
    font-size: 12px;
    color: #666;
}
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}
.filters div { flex: 1; min-width: 120px; }

/* ============================================================
   Responsive tables: on wide screens these are normal tables.
   Below the breakpoint, each row becomes a stacked card with
   labels pulled from the data-label attribute on each <td>.
   This is the standard "responsive table" pattern - no JS needed.
   ============================================================ */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.desktop-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.desktop-table table {
    min-width: 900px;
    border-collapse: collapse;
}

@media (max-width:768px){

.desktop-table .responsive-table{
    display:table !important;
    width:100%;
}

.desktop-table .responsive-table thead{
    display:table-header-group !important;
}

.desktop-table .responsive-table tbody{
    display:table-row-group !important;
}

.desktop-table .responsive-table tr{
    display:table-row !important;
}

.desktop-table .responsive-table th,
.desktop-table .responsive-table td{
    display:table-cell !important;
    white-space:nowrap;
}

.desktop-table .responsive-table td::before{
    display:none !important;
    content:none !important;
}

}
.desktop-table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.desktop-table{
    width:100%;
    min-width:1100px;
    border-collapse:collapse;
}

.desktop-table th,
.desktop-table td{
    padding:12px 10px;
    border-bottom:1px solid #e5e5e5;
    text-align:left;
    white-space:nowrap;
}

.desktop-table thead{
    display:table-header-group;
}

.desktop-table tbody{
    display:table-row-group;
}

.desktop-table tr{
    display:table-row;
}

.desktop-table th,
.desktop-table td{
    display:table-cell;
}

@media (max-width: 680px) {
    .responsive-table thead { display: none; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td {
        display: block;
        width: 100%;
    }
    .responsive-table tr {
        margin-bottom: 12px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 6px 10px;
        background: #fff;
    }
    .responsive-table td {
        border: none;
        border-bottom: 1px solid #f3f3f3;
        padding: 8px 4px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        text-align: right;
    }
    .responsive-table td:last-child { border-bottom: none; }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #a8451f;
        text-align: left;
        flex-shrink: 0;
    }
}

/* Icon buttons used for refund / locked / already-refunded states */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}
.icon-btn.refund-active {
    background: #fff3e0;
    color: #d9822b;
    border: 1.5px solid #d9822b;
}
.icon-btn.refund-active:active { transform: scale(0.95); }
.icon-locked, .icon-refunded {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
}
.icon-locked {
    background: #f0f0f0;
    color: #aaa;
}
.icon-refunded {
    background: #fde2e2;
    color: #a10000;
}

/* Tab navigation - used on collector/expense management pages.
   Styled as pill buttons rather than plain text links, so they're
   clearly tappable on mobile. */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tabs a {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 12px 14px;
    text-decoration: none;
    color: #a8451f;
    font-weight: 600;
    background: #fff;
    border: 1.5px solid #e8c9a8;
    border-radius: 8px;
}
.tabs a.active {
    color: #fff;
    background: #d9822b;
    border-color: #d9822b;
}
.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: #a8451f;
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.site-footer {
    text-align: center;
    padding: 24px 16px 32px;
    font-size: 13px;
    color: #999;
}
.site-footer a {
    color: #d9822b;
    text-decoration: none;
    font-weight: 600;
}
.site-footer a:hover {
    text-decoration: underline;
}
.footer-heart {
    color: #e25555;
}