/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #DDE2EB;
    --main-bg: #F2F5F9;
    --card-bg: #FFFFFF;
    --primary-color: #FC7C5C;
    --primary-hover: #fa6c4a;
    --text-main: #1F1F1F;
    --text-muted: #8A8A8E;
    --border-radius: 24px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', sans-serif;
    font-size: 16px;
    background-color: var(--main-bg);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 200px;
    background-color: var(--bg-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.brand {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 6px; /* Reduced from 10px */
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    padding: 12px 20px;
    border-radius: 30px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer; /* Explicitly set pointing finger */
}

.nav-item:hover, .nav-item.active {
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}
.nav-item.active:hover {
    box-shadow: 0 4px 15px rgba(252, 124, 92, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.greeting h1 {
    font-size: 32px;
    font-weight: 600;
}

.greeting p {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    background-color: var(--card-bg);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    padding: 2px;
    background: white;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 600;
    font-size: 15px;
}

.profile-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Cards & Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.card-value {
    font-size: 36px;
    font-weight: 600;
    color: var(--text-main);
}

/* Primary Styling Elements */
.bg-primary {
    background-color: var(--primary-color);
    color: white;
}
.bg-primary .card-title, .bg-primary .card-value {
    color: white;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 5px 15px rgba(252, 124, 92, 0.4);
}

/* Responsive */
@media screen and (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        position: relative;
    }
    
    .brand {
        margin-bottom: 0;
    }
    
    .nav-links {
        flex-direction: row;
        display: none; 
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg);
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    position: relative;
}
.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    cursor: pointer;
    background: none; border: none; font-size: 20px; color: var(--text-muted);
}
.modal-title { margin-bottom: 25px; font-size: 22px; color: var(--text-main); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.form-control {
    width: 100%; padding: 12px 15px;
    border: 1px solid #eee; border-radius: 12px;
    font-size: 14px; font-family: inherit; color: var(--text-main); outline: none; transition: 0.2s;
}
.form-control:focus { border-color: var(--primary-color); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* Status Badges */
.badge {
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-planning { background: #f0f0f0; color: #555; }
.badge-active { background: #e6f7ff; color: #1890ff; }
.badge-completed { background: #f6ffed; color: #52c41a; }

/* Task Board */
.board-columns { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; }
.board-column {
    background: #fdfdfd; min-width: 300px; flex: 1; border-radius: 16px; padding: 15px; border: 1px dashed #eee;
}
.board-title {
    font-size: 16px; font-weight: 600; margin-bottom: 15px; display: flex; justify-content: space-between;
}
.task-card {
    background: white; border-radius: 12px; padding: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 15px; cursor: pointer; border: 1px solid #f5f5f5;
}
.task-card:hover { border-color: var(--primary-color); }
.task-title { font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.task-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.task-assignee { width: 24px; height: 24px; border-radius: 50%; }

/* ── Global profile dropdown ── */
.profile-menu-wrap { position: relative; }
.profile-dropdown {
    display: none;
    position: absolute;
    right: 0; top: calc(100% + 8px);
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 160px;
    z-index: 900;
    overflow: hidden;
}
.profile-dropdown.open { display: block; }
.profile-dropdown a {
    display: block; padding: 12px 18px;
    font-size: 14px; color: var(--text-main);
    text-decoration: none; transition: 0.15s;
    font-family: 'Sarabun', sans-serif;
}
.profile-dropdown a:hover { background: #f9f9f9; }
.profile-dropdown a.logout { color: #ef4444; border-top: 1px solid #f0f0f0; }

/* ── Brand as link ── */
a.brand { color: var(--primary-color); text-decoration: none; }
a.brand:hover { color: var(--primary-hover); }
