:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --subtext: #64748b;
    --muted: #64748b;
    --radius: 14px;
    --transition: all 0.3s ease-in-out;
}

body {
    font-family: "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}

/* === PROFILE (aerp-*) === */

.aerp-profile-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.aerp-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    margin-bottom: 32px;
    padding: 32px;
    transition: var(--transition);
    position: relative;
}

.aerp-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.aerp-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aerp-title i {
    color: var(--primary);
    font-size: 22px;
}

.aerp-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.aerp-label {
    font-weight: 500;
    color: var(--subtext);
}

.aerp-value {
    font-weight: 600;
    color: var(--text);
}

.aerp-row:last-child {
    border-bottom: none;
}

.aerp-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
    transition: var(--transition);
    margin-top: 24px;
}

.aerp-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
}

@media (max-width: 640px) {
    .aerp-row {
        grid-template-columns: 1fr;
    }
}

/* === TASK LIST (task-*) === */

.task-container {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: "Inter", sans-serif;
    color: var(--text);
}

.task-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    padding: 24px;
    transition: var(--transition);
}

.task-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
}

.task-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.task-meta {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 12px;
}

.task-comments {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    margin-top: 10px;
    list-style: none;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
}

.task-comments li {
    position: relative;
    margin-bottom: 12px;
    padding-left: 0;
    line-height: 1.6;
    word-break: break-word;
}
.task-comments li:last-child {
    margin-bottom: 0;
}
.task-badge {
    text-align: center;
    min-width: 70px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    margin-right: 6px;
    color: #fff;
    font-weight: 500;
}

.badge-admin {
    background-color: #16a34a; /* xanh lá */
}

.badge-user {
    background-color: #2563eb; /* xanh dương */
}
.task-form textarea {
    resize: vertical; /* ✅ Chỉ được kéo theo chiều dọc */
    max-width: 100%; /* ⛔ Không tràn ngang */
}
.task-form select,
.task-form textarea,
.task-form input[type="text"],
.task-form input[type="date"] {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}
.task-form.button,
.task-form button {
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 10px 22px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.task-form.button:hover,
.task-form button:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.task-add-section {
    margin-top: 40px;
}

.task-section-title {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
}

.task-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.task-popup.active {
    display: flex;
}

.task-popup-inner {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.task-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 20px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
}
.task-popup-close:hover {
    color: #111;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.custom-select {
    appearance: none; /* ẩn mũi tên mặc định */
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white
        url('data:image/svg+xml;utf8,<svg fill="%2364748b" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>')
        no-repeat right 12px center;
    background-size: 16px 16px;
    padding-right: 36px; /* chừa chỗ cho icon */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    height: 42px;
    font-size: 15px;
    transition: 0.2s;
}

.aerp-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2563eb;
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: fadeInToast 0.3s ease;
}

.aerp-toast button {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
}

.aerp-toast button:hover {
    color: #fff;
    opacity: 1;
}

@keyframes fadeInToast {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
