* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    width: 90%;
    max-width: 700px;
    margin: 40px auto;
}

.login-container {
    width: 90%;
    max-width: 460px;
    margin: 80px auto;
}

.login-card {
    background: white;
    padding: 35px;
    border-radius: 8px;
    text-align: center;
}

.login-card label {
    text-align: left;
}

.error-message {
    color: #9b1c1c;
    background: #fff0f0;
    padding: 10px;
    border-radius: 5px;
}

.top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.top-actions form {
    margin: 0;
}

.logout-button {
    width: auto;
    margin: 0;
    padding: 8px 14px;
    background: #666;
    font-size: 14px;
}

.admin-container {
    width: min(96%, 1400px);
    margin: 30px auto;
}

.admin-header,
.table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-brand,
.admin-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-actions form {
    margin: 0;
}

.admin-logo {
    width: 110px;
    max-height: 70px;
    object-fit: contain;
}

.admin-header h1,
.admin-header p {
    margin: 0 0 6px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.summary-card,
.admin-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.summary-card strong,
.summary-card span {
    display: block;
}

.summary-card strong {
    font-size: 30px;
    margin-bottom: 5px;
}

.table-tools label {
    font-weight: bold;
}

.table-tools input {
    flex: 1;
    min-width: 220px;
}

.download-button {
    padding: 12px 16px;
    border-radius: 5px;
    background: #333;
    color: white;
    text-decoration: none;
}

.secondary-button {
    background: white;
    color: #333;
    border: 1px solid #333;
}

.print-only {
    display: none;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f2f2f2;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 30px 10px;
}

.event-section,
.rsvp-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.event-section {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    height: 120px;
    margin-bottom: 20px;
}

.logo img {
    max-width: 200px;
    max-height: 120px;
}

h1 {
    margin-bottom: 25px;
}

.event-details {
    text-align: left;
    line-height: 1.8;
}

.event-details a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

h2 {
    margin-bottom: 25px;
    text-align: center;
}

label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: bold;
}

input,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
}

textarea {
    height: 80px;
    resize: vertical;
}

button {
    width: 100%;
    margin-top: 25px;
    padding: 13px;
    background: #333;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #555;
}

@media (max-width: 600px) {
    .container {
        width: 95%;
        margin: 20px auto;
    }

    .event-section,
    .rsvp-section {
        padding: 20px;
    }

    h1 {
        font-size: 25px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body,
    body.print-view {
        background: white;
        color: #1d2433;
        font-family: Arial, sans-serif;
    }

    .admin-container {
        width: 100%;
        margin: 0;
    }

    .admin-header {
        padding-bottom: 10px;
        margin-bottom: 12px;
        border-bottom: 3px solid #252e5f;
    }

    .admin-header h1 {
        color: #252e5f;
        font-size: 20pt;
        margin-bottom: 3px;
    }

    .admin-header p {
        font-size: 9pt;
        color: #555;
        margin: 2px 0;
    }

    .admin-logo {
        width: 85px;
        max-height: 52px;
    }

    .screen-only,
    .table-tools {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin: 0 0 12px;
    }

    .summary-card {
        padding: 9px 12px;
        border: 1px solid #cfd4e2;
        border-left: 4px solid #252e5f;
        border-radius: 4px;
    }

    .summary-card strong {
        color: #252e5f;
        font-size: 18pt;
        margin: 0;
    }

    .summary-card span {
        font-size: 8pt;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .admin-panel {
        padding: 0;
        border-radius: 0;
    }

    .table-scroll {
        overflow: visible;
        margin-top: 0;
    }

    table {
        table-layout: fixed;
        font-size: 7.5pt;
        line-height: 1.25;
    }

    thead {
        display: table-header-group;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    th {
        background: #252e5f !important;
        color: white;
        font-size: 7.5pt;
        padding: 6px;
    }

    td {
        padding: 6px;
        border-bottom: 1px solid #d9dce5;
        overflow-wrap: anywhere;
    }

    th:nth-child(1), td:nth-child(1) { width: 12%; }
    th:nth-child(2), td:nth-child(2) { width: 15%; }
    th:nth-child(3), td:nth-child(3) { width: 14%; }
    th:nth-child(4), td:nth-child(4) { width: 7%; text-align: center; }
    th:nth-child(5), td:nth-child(5) { width: 18%; }
    th:nth-child(6), td:nth-child(6) { width: 10%; }
    th:nth-child(7), td:nth-child(7) { width: 24%; }
}
