
/* HR RECRUITMENT SYSTEM V1.0 */

:root {
    --background: #090e19;
    --sidebar: #0d1422;
    --card: #141d2d;
    --border: #273449;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --success: #34d399;
    --danger: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: "Noto Sans Thai", "Leelawadee UI",
                 Tahoma, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

h1, h2, h3 {
    font-weight: 600;
}

p {
    color: var(--muted);
}

button, input, select, textarea {
    font: inherit;
}

button {
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

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

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 3px;
}

/* LOGIN PAGE */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(
            ellipse at top,
            #202747 0%,
            #090e19 65%
        );
}

.login-container {
    width: 100%;
    max-width: 430px;
    text-align: center;
}

.logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(
        135deg,
        #818cf8,
        #4338ca
    );
    color: white;
    font-size: 30px;
    font-weight: 700;
    box-shadow: 0 10px 40px #4f46e540;
}

.login-container > h1 {
    font-size: 27px;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.login-card {
    margin-top: 32px;
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    text-align: left;
    box-shadow: 0 20px 60px #00000040;
}

.login-card h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.login-card > p {
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin-top: 18px;
    margin-bottom: 8px;
    color: #cbd5e1;
}

input, select, textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0b1220;
    color: var(--text);
}

input::placeholder {
    color: #64748b;
}

input:focus {
    border-color: var(--primary);
}

.login-card button {
    width: 100%;
    margin-top: 24px;
    font-weight: 600;
}

#loginMessage {
    margin-top: 14px;
    margin-bottom: 0;
    color: var(--danger);
    overflow-wrap: anywhere;
}

footer {
    margin-top: 25px;
    color: var(--muted);
    font-size: 12px;
}

/* DASHBOARD */

.dashboard {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 25px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.brand {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #a5b4fc;
    padding: 10px;
    margin-bottom: 35px;
}

.menu-title {
    padding-left: 12px;
    margin-bottom: 12px;
    font-size: 12px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    width: 100%;
    text-align: left;
    background: transparent;
    color: #aab7cc;
    padding: 12px 15px;
}

.nav-item:hover {
    background: #1e293b;
    color: white;
}

.nav-item.active {
    background: #252e50;
    color: #c7d2fe;
    font-weight: 600;
}

.logout-button {
    margin-top: auto;
    background: #351e2a;
    color: #fca5a5;
}

.logout-button:hover {
    background: #512334;
}

.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-width: 0;
    padding: 30px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-bottom: 24px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.topbar h2 {
    font-size: 23px;
}

.topbar p {
    font-size: 13px;
    margin-top: 4px;
}

.user-profile {
    display: flex;
    flex-direction: column;
    text-align: right;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

#userName {
    font-weight: 600;
}

#userRole {
    color: #a5b4fc;
    font-size: 12px;
}

.welcome {
    margin-bottom: 28px;
}

.welcome h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

/* STATISTICS CARDS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card p {
    font-size: 14px;
}

.stat-card h1 {
    font-size: 38px;
    margin-top: 12px;
    color: #818cf8;
}

.stat-card:nth-child(2) h1 {
    color: #60a5fa;
}

.stat-card:nth-child(3) h1 {
    color: #22d3ee;
}

.stat-card:nth-child(4) h1 {
    color: #fbbf24;
}

.stat-card:nth-child(5) h1 {
    color: #c084fc;
}

.stat-card:nth-child(6) h1 {
    color: #34d399;
}

/* CONTENT AND TABLES */

.content-card {
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 24px;
}

.content-card h2 {
    font-size: 18px;
    margin-bottom: 20px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 14px;
    background: #0e1726;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    color: #e2e8f0;
    overflow-wrap: anywhere;
}

tbody tr:hover {
    background: #1b2639;
}

.page > h2 {
    margin-bottom: 15px;
}

/* SCROLLBAR */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: #0d1422;
}

/* TABLET AND MOBILE */

@media (max-width: 1000px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 16px;
    }

    .brand {
        margin-bottom: 12px;
    }

    .sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logout-button {
        margin-top: 15px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card h1 {
        font-size: 28px;
    }

    .welcome h1 {
        font-size: 22px;
    }

    .login-card {
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
