:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --gray-light: #e5e7eb;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

button#openModalBtn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

button#openModalBtn:hover {
    background-color: var(--primary-hover);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 75vh;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    position: sticky;
    top: 0;
}

tr:last-child td {
    border-bottom: none;
}
tr:hover {
    background-color: #f9fafb;
    transition: background 0.2s;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 10px;
}

.modal-content {
    background-color: var(--white);
    margin: 5vh auto;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

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

.close {
    color: #9ca3af;
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: #111827;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #111827;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.85em;
    margin-top: 5px;
    display: none;
}
.btn-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
}
.btn-submit:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

#loading {
    text-align: center;
    color: var(--primary-color);
    margin: 20px 0;
    font-weight: 500;
    display: none;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    button#openModalBtn {
        width: 100%;
        text-align: center;
    }

    .modal-content {
        margin: 10vh auto;
        width: 100%;
    }
}
