:root {
    --primary-color: #0078d4;
    --primary-dark: #005a9e;
    --bg-color: #f3f2f1;
    --card-bg: #ffffff;
    --text-color: #201f1e;
    --text-muted: #605e5c;
    --border-color: #edebe9;
    --success-color: #107c10;
    --error-color: #a80000;
}

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

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, #0078d4 0%, #00bcf2 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    margin-top: 0;
}

.app-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: #fff;
    color: #5e5e5e;
    padding: 10px 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid #8c8c8c;
    border-radius: 0; /* Microsoft buttons are often sharp or slightly rounded, usually 0 or 2px */
    transition: all 0.2s;
    font-family: 'Segoe UI', 'Helvetica Neue', 'Lucida Grande', 'Roboto', 'Ebrima', 'Nirmala UI', 'Gadugi', 'Segoe Xbox Symbol', 'Segoe UI Symbol', 'Meiryo', 'Segoe UI', 'Arial', sans-serif;
}

.btn-microsoft:hover {
    background-color: #f3f2f1;
    border-color: #8c8c8c;
    box-shadow: none; /* Microsoft guidelines usually don't use shadow for this button */
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.main-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
    width: 100%;
}

/* Navigation */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(0, 120, 212, 0.1);
    /* transparent primary */
    color: var(--primary-color);
    font-weight: 600;
}

.nav-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0.5rem;
}

/* Header & Toggle */
.mobile-header {
    display: none;
    padding: 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: filter 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    filter: brightness(90%);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Recent Activity Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        height: 100vh;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(280px);
    }

    .main-content {
        padding: 1rem;
    }

    .mobile-header {
        display: flex;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
    }

    .sidebar-overlay.active {
        display: block;
    }
}