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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e6f9f0, #c8f7dc, #b2f2d7);
    min-height: 100vh;
    color: #1f2937;
}

/* ===== HEADER ===== */
.header {
    padding: 20px;
    text-align: center;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header h1 { color: #047857; }
.header p { color: #065f46; }

/* ===== MENU ===== */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#menu {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

#menu a {
    padding: 8px 14px;
    background: #d1fae5;
    border-radius: 20px;
    text-decoration: none;
    color: #065f46;
    transition: 0.3s;
}

#menu a:hover {
    background: #34d399;
    color: #fff;
}

/* MOBILE MENU */
.menu-toggle {
    display: none;
    background: #10b981;
    color: white;
    border: none;
    font-size: 20px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* ===== LAYOUT ===== */
.container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

/* ===== CARD ===== */
.card {
    width: 100%;
    max-width: 1000px;
    padding: 30px;
    border-radius: 20px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeIn 0.6s ease;
}

.card h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #047857;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 15px; }

label { color: #065f46; }

input, select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border-radius: 10px;
    border: 1px solid #d1fae5;
    background: #f0fdf4;
}

/* ===== BUTTON ===== */
.btn {
    width: 100%;
    padding: 12px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn:hover {
    transform: scale(1.03);
}

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; margin-top: 20px; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

th, td { padding: 12px; text-align: center; }

th {
    background: #d1fae5;
    color: #065f46;
}

tr:nth-child(even) { background: #f0fdf4; }

/* ===== BADGE (CHUẨN GỌN) ===== */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* 🟢 Còn hạn */
.badge.conhan {
    background: #d1fae5;
    color: #065f46;
}

/* 🟡 Sắp hết */
.badge.saphet {
    background: #facc15;
    color: #000;
}

/* 🔴 Hỏng */
.badge.hong {
    background: #ef4444;
    color: #fff;
}

/* ===== ROW ===== */
.row-saphet { background: #fef3c7 !important; }
.row-hong { background: #fee2e2 !important; }

/* ===== GRID ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.item {
    background: #ecfdf5;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #d1fae5;
    transition: 0.3s;
}

.item:hover {
    transform: translateY(-5px);
    background: #d1fae5;
}

/* ===== AI ===== */
.ai-result {
    margin-top: 20px;
    background: #ecfdf5;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #d1fae5;
}

.menu-content {
    line-height: 1.8;
}

/* ===== CHATBOT ===== */
#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: white;
    border-radius: 15px;
    display: none;
    flex-direction: column;
}

.chat-header {
    background: #10b981;
    color: white;
    padding: 10px;
}

#chat-box {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.msg {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 10px;
}

.msg.user { background: #d1fae5; }
.msg.bot { background: #e5e7eb; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 15px;
    margin-top: 30px;
    background: rgba(255,255,255,0.5);
    color: #065f46;
}

/* ===== ALERT ===== */
.alert-box {
    background: #fef3c7;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* ===== ANIMATION ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px);}
    to { opacity: 1; transform: translateY(0);}
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    #menu {
        display: none;
        flex-direction: column;
        background: white;
        padding: 10px;
        border-radius: 10px;
    }

    #menu.show { display: flex; }
    .menu-toggle { display: block; }
    .grid { grid-template-columns: 1fr; }
}
.loader {
    border: 4px solid #d1fae5;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}