@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    /* ธีมพื้นฐาน (จะถูกเขียนทับโดย sidebar.php) */
    --background: #f8fafc;
    --card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #ffffff;
    --item-hover: #f1f5f9;
    --border-color: #f1f5f9;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 15px 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    opacity: 0.7;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: 0.2s;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--item-hover);
    opacity: 1;
}

.menu-item.active {
    background: var(--primary);
    color: white;
    opacity: 1;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    background-color: var(--background);
}

.header-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-area h1 {
    color: var(--text-main);
    margin: 0;
}

/* Card Styling */
.card {
    background: var(--card);
    color: var(--text-main);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

/* Form Styling */
.input-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    opacity: 0.8;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: 0.2s;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

/* Task Badges */
.badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-working { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge-submitted { background: rgba(16, 185, 129, 0.2); color: #10b981; }

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--card);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--primary);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: 0 0 25px rgba(0,0,0,0.2); }
    .main-content { margin-left: 0 !important; padding: 1rem; padding-top: 80px !important; }
    .mobile-toggle { display: flex !important; }
}
