* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, #eef1f5 0%, #e4e8ee 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #1f2937;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    padding: 36px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    position: relative;
}

h1 {
    text-align: left;
    color: #0f2942;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ---------- PAGE HEADER (with Logout) ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.page-header h1::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    background: #1b6ca8;
    border-radius: 2px;
    margin-top: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 6px;
}

.user-info span {
    font-size: 14px;
    color: #475569;
}

.logout-btn {
    padding: 8px 18px;
    background-color: #64748b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.logout-btn:hover {
    background-color: #475569;
}

/* ---------- FORM ---------- */
.form-box {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.form-box input {
    flex: 1;
    min-width: 160px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-box input:focus {
    outline: none;
    border-color: #1b6ca8;
    box-shadow: 0 0 0 3px rgba(27, 108, 168, 0.15);
}

.form-box input::placeholder {
    color: #94a3b8;
}

.form-box button {
    padding: 11px 26px;
    background-color: #1b6ca8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.form-box button:hover {
    background-color: #145482;
}

.form-box button:active {
    transform: scale(0.98);
}

/* ---------- TABLE ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

thead th {
    background-color: #0f2942;
    color: #ffffff;
    text-align: left;
    padding: 13px 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

thead th:first-child {
    border-top-left-radius: 8px;
}

thead th:last-child {
    border-top-right-radius: 8px;
}

tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid #e5e9ef;
    font-size: 14px;
    color: #1f2937;
    vertical-align: middle;
    word-wrap: break-word;
    background-color: #ffffff;
}

tbody tr:hover td {
    background-color: #f5f8fb;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Column sizing guidance */
th:nth-child(1), td:nth-child(1) { width: 6%; }
th:nth-child(2), td:nth-child(2) { min-width: 140px; }
th:nth-child(3), td:nth-child(3) { min-width: 160px; }
th:nth-child(6), td:nth-child(6) { white-space: nowrap; width: 10%; }
th:nth-child(7), td:nth-child(7) { white-space: nowrap; width: 1%; }

/* ---------- ACTIONS BUTTON + GLOBAL DROPDOWN ---------- */
.actions-toggle {
    padding: 7px 16px;
    background-color: #475569;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.actions-toggle:hover {
    background-color: #334155;
}

.actions-menu {
    display: none;
    position: fixed;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    z-index: 9999;
    min-width: 130px;
}

.actions-menu.open {
    display: flex;
    flex-direction: column;
}

.actions-menu button {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
}

.actions-menu button:hover {
    background-color: #f1f5f9;
}

.actions-menu .delete-option {
    color: #d64550;
}

/* ---------- LOGIN PAGE ---------- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #ffffff;
    padding: 40px 36px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.1);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-box h1 {
    color: #0f2942;
    font-size: 24px;
    margin-bottom: 4px;
    text-align: center;
}

.login-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 28px;
}

.login-box input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.login-box input:focus {
    outline: none;
    border-color: #1b6ca8;
    box-shadow: 0 0 0 3px rgba(27, 108, 168, 0.15);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background-color: #1b6ca8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.login-box button:hover {
    background-color: #145482;
}

.error-msg {
    color: #d64550;
    font-size: 13px;
    margin-top: 12px;
    min-height: 16px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
    .container {
        padding: 22px;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
    }

    .form-box {
        flex-direction: column;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        margin-bottom: 14px;
        border: 1px solid #e5e9ef;
        border-radius: 8px;
        padding: 10px;
    }

    tbody td {
        border-bottom: none;
        padding: 6px 4px;
    }
}