:root {
    --beige: #C9AB6E;
    --beige-light: #DCC98E;
    --brown: #7B3517;
    --brown-light: #A0522D;
    --cream: #F5F0E8;
    --cream-dark: #EDE5D5;
    --green: #4A7A4A;
    --terracotta: #C1714F;
    --white: #FEFCF8;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(123,53,23,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--cream);
    color: #333;
    line-height: 1.5;
}

/* ===== HEADER ===== */
.header {
    background: var(--brown);
    color: var(--white);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header h1 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}
.version-tag {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
}
.header nav { display: flex; gap: 4px; }
.nav-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--cream-dark);
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}
.nav-btn:hover, .nav-btn.active {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: var(--white);
}
.nav-logout { margin-left: 12px; opacity: 0.7; }

/* ===== CONTAINER ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ===== SECTION ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-header h2 {
    font-size: 18px;
    color: var(--brown);
    font-weight: 500;
}

/* ===== TABLE ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}
.table th {
    background: var(--cream-dark);
    color: var(--brown);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tr:not(:last-child) td { border-bottom: 1px solid var(--cream-dark); }
.table .actions { white-space: nowrap; }

/* ===== FORMS ===== */
.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--brown);
    margin-bottom: 4px;
}
.form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    transition: border-color 0.2s;
}
.input:focus {
    outline: none;
    border-color: var(--beige);
}
.input-sm { max-width: 100px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    background: var(--white);
    color: var(--brown);
    transition: all 0.2s;
}
.btn:hover { border-color: var(--beige); }
.btn-primary {
    background: var(--brown);
    color: var(--white);
    border-color: var(--brown);
}
.btn-primary:hover { background: var(--brown-light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    opacity: 0.6;
}
.btn-icon:hover { opacity: 1; }

/* ===== CREDIT BADGE ===== */
.credit-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.credit-ok { background: #e8f5e9; color: var(--green); }
.credit-low { background: #fff3e0; color: #e65100; }
.credit-zero { background: #ffebee; color: #c62828; }

/* ===== CHECKBOX LIST ===== */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--cream);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
}
.checkbox-item:hover { background: var(--cream-dark); }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; }
.checkbox-item small { margin-left: auto; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 16px; color: var(--brown); }
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brown);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* ===== ALERT ===== */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 360px;
}
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo h1 {
    font-size: 22px;
    color: var(--brown);
    margin-bottom: 4px;
}
.login-logo p {
    font-size: 13px;
    color: var(--beige);
    letter-spacing: 1px;
}
.logo-circle-sm {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--beige);
    margin: 0 auto 12px;
}

/* ===== PARTICIPANT PAGE ===== */
.participant-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}
.participant-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    padding: 32px 24px;
}
.participant-header {
    text-align: center;
    margin-bottom: 24px;
}
.participant-header h1 {
    font-size: 24px;
    color: var(--brown);
    margin-bottom: 4px;
}
.participant-header .subtitle {
    font-size: 13px;
    color: var(--beige);
    letter-spacing: 1px;
}
.credit-display {
    text-align: center;
    padding: 20px;
    background: var(--cream);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.credit-number {
    font-size: 48px;
    font-weight: 600;
    color: var(--green);
}
.credit-label {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}
.stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}
.stat { text-align: center; }
.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 500;
    color: var(--brown);
}
.stat-label {
    font-size: 12px;
    color: #888;
}
.section-title {
    font-size: 14px;
    color: var(--brown);
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table-simple { box-shadow: none; }
.table-simple th { background: var(--cream); }
.empty-state {
    text-align: center;
    color: #888;
    padding: 24px;
    font-style: italic;
}

/* ===== HELP ===== */
.help-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    max-width: 640px;
}
.help-content h2 {
    color: var(--brown);
    font-size: 20px;
    margin-bottom: 16px;
}
.help-content h3 {
    color: var(--brown);
    font-size: 15px;
    margin-top: 20px;
    margin-bottom: 8px;
}
.help-content p, .help-content li {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}
.help-content ol, .help-content ul {
    padding-left: 20px;
    margin-bottom: 8px;
}
.help-content li { margin-bottom: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .header { flex-direction: column; gap: 8px; padding: 12px; }
    .header h1 { font-size: 16px; }
    .form-row { flex-direction: column; }
    .input-sm { max-width: 100%; }
    .table th, .table td { padding: 8px 10px; font-size: 13px; }
    .container { padding: 16px 12px; }
    .section-header { flex-wrap: wrap; gap: 8px; }
    .checkbox-item {
        padding: 12px 14px;
        font-size: 16px;
    }
    .checkbox-item input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }
    .btn { padding: 12px 16px; font-size: 15px; }
    .btn-sm { padding: 8px 12px; font-size: 13px; }
    .form-group label { font-size: 14px; }
    .input { padding: 12px; font-size: 16px; }
    select.input { font-size: 16px; height: 44px; }
    .nav-btn { padding: 8px 14px; font-size: 14px; }
    .table { font-size: 13px; }
    .table th { font-size: 11px; }
    .modal { padding: 20px 16px; width: 95%; }
    .credit-number { font-size: 56px; }
}
