/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:'Times New Roman', Times, serif;
}

/* ================= BODY ================= */
/*
body {
    background: #f3f6fb;
    color: #1f2937;
    min-height: 100vh;
    padding: 20px;
}
*/
/* ================= CONTAINER ================= */
.container {
    max-width: 1100px;
    margin: auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.08);
    /*used to 10px both*/
}

/* ================= HEADINGS ================= */
h1 {
    text-align: center;
    font-size: 2.2rem;
    color: #1e3a8a;
    font-weight: 700;
    margin-bottom: 25px;
}

h2 {
    font-size: 1.3rem;
    color: #0c3fad;
    margin-bottom: 14px;
}

/* ================= FORM SECTION ================= */
.form-container {
    background: #f8fafc;
    padding: 22px;
    border-radius: 10px;
    /*border: 1px solid #e5e7eb;*/
    margin-bottom: 25px;
}

/* ================= FORM GROUP ================= */
.form-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* ================= INPUT WRAPPER ================= */
.input-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
    gap: 4px;
}

.input-wrapper label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.required-note {
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
}

/* ================= FIELD ERROR ================= */
.field-error {
    font-size: 12px;
    color: #dc2626;
    min-height: 16px;
    display: block;
}

/* ================= VALIDATION MESSAGE ================= */
.validation-msg {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ================= INPUTS & SELECT ================= */
input, select {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

input::placeholder {
    color: #9ca3af;
}

input:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input.invalid, select.invalid {
    border-color: #ef4444;
}

/* ================= FORM ACTIONS ================= */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

/* ================= BUTTONS ================= */
button {
    background: #25eb25;
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
    background: #1eaf5f;
}

button:active {
    transform: scale(0.98);
}

/* Cancel button */
#cancelBtn {
    background: #6b7280;
}
#cancelBtn:hover {
    background: #4b5563;
}

/* ================= TABLE SECTION ================= */
.table-container {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
}

/* ================= TABLE ================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 6px;
}

th {
    padding: 12px 14px;
    background: #0c348a;
    color: white;
    font-weight: 600;
    text-align: left;
}

th:first-child { border-radius: 6px 0 0 0; }
th:last-child  { border-radius: 0 6px 0 0; }

td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

tr:hover td {
    background: #f1f5f9;
}

/* Row being edited — highlighted */
tr.editing-row td {
    background: #eff6ff;
    border-bottom-color: #bfdbfe;
}

tr.editing-row:hover td {
    background: #dbeafe;
}

/* ================= ACTION CELL ================= */
.action-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ================= ACTION BUTTONS ================= */
.action-btn {
    padding: 6px 14px;
    border-radius: 5px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
}

.action-btn:active {
    transform: scale(0.97);
}

/* Edit — green */
.edit-btn {
    background: #22c55e;
}
.edit-btn:hover {
    background: #16a34a;
}

/* Delete — red */
.delete-btn {
    background: #ef4444;
}
.delete-btn:hover {
    background: #dc2626;
}

/* Editing badge shown instead of delete */
.editing-badge {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    background: #dbeafe;
    border-radius: 4px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .form-group {
        flex-direction: column;
    }

    .input-wrapper {
        min-width: 100%;
    }

    h1 {
        font-size: 1.7rem;
    }

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