/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    padding: 20px;
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.content {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Card / Panel ===== */
.code-container {
    margin: 20px auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.invitation-id {
    background-color: #e5e5e5;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: bold;
    margin-bottom: 20px;
    width: fit-content;
}

.code-section {
    margin-bottom: 24px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.code-section h2 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
}

.description {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-bottom: 6px;
}

.code {
    font-size: 20px;
    font-family: monospace;
    color: #222;
    margin: 4px 0 0;
}

.code.success {
    color: #2e7d32;
}

.code.warning {
    font-style: italic;
    color: #888;
}

/* ===== Table ===== */
.table-container {
    margin: 20px auto;
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid #eee;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

tr td:last-child {
    width: 1%;
    white-space: nowrap;
}

/* ===== Status badges ===== */
.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.status-orange {
    background: #fff3e0;
    color: #ef6c00;
}

.status-gray {
    background: #f5f5f5;
    color: #9e9e9e;
}

.status-yellow {
    background: #fff6dd;
    color: #e9a208;
}

.status-blue {
    background: #e3f2fd;
    color: #1e88e5;
}

/* ===== Buttons ===== */
.actions {
    display: flex;
    gap: 8px;
}

.action-button {
    text-decoration: none;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.view-button {
    background: #e8f5e9;
    color: #2e7d32;
}

.delete-button {
    color: #f44336;
}

.back-button {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 16px;
    background-color: #c5c5c5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: #000;
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: #ddd;
}

.btn-retour {
    display: inline-block;
    margin: 10px;
    background: #e9e9ed;
    color: #000;
}

/* ===== Forms ===== */
form {
    display: grid;
    gap: 5px;
}

.input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    max-width: 200px;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-button.cancel {
    background: #e0e0e0;
}

.modal-button.confirm {
    background: #f44336;
    color: #fff;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #323232;
    color: #fff;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .table-container {
        overflow-x: visible;
    }

    tr td:last-child {
        width: inherit;
        white-space: nowrap;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 12px;
    }

    td {
        display: grid;
        grid-template-columns: 120px 1fr;
        padding: 8px 0;
        border: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #666;
    }

    .actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}