:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.75);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --success-color: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body {
    background: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
    background-size: cover; background-attachment: fixed;
    color: var(--text-primary); min-height: 100vh; overflow-x: hidden;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border); border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.hidden { display: none !important; }
.active { display: flex; }
.w-full { width: 100%; }
.mb-4 { margin-bottom: 16px; }

/* ======== ĐĂNG NHẬP ======== */
#login-screen { height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { padding: 40px; width: 420px; text-align: center; animation: fadeIn 0.5s ease-out; }
.login-card h2 { margin-bottom: 10px; font-weight: 600; font-size: 1.8em; }
.login-card p { color: var(--text-secondary); margin-bottom: 25px; font-size: 0.95em; }

/* ======== THÀNH PHẦN CƠ BẢN ======== */
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.85em; color: var(--text-secondary); font-weight: 500; }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
    width: 100%; padding: 12px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.25); color: var(--text-primary); font-size: 0.95em; outline: none; transition: all 0.3s ease;
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3); }
textarea { resize: vertical; min-height: 80px; }

.btn-primary, .btn-secondary {
    padding: 12px 24px; border-radius: 8px; border: none; font-size: 0.95em; font-weight: 500; cursor: pointer; transition: 0.3s;
    display: inline-flex; justify-content: center; align-items: center; text-align: center;
}
.btn-primary { background: var(--accent-color); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.2); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }

/* ======== DASHBOARD SIDEBAR ======== */
#dashboard-screen { display: flex; height: 100vh; animation: fadeIn 0.4s ease-out; }
.sidebar { width: 300px; margin: 16px 0 16px 16px; padding: 24px; display: flex; flex-direction: column; }
.logo { margin-bottom: 30px; }
.logo h3 { font-size: 1.6em; background: linear-gradient(135deg, #60a5fa, #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.menu-sections { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.menu-sections::-webkit-scrollbar { display: none; }
.menu-box h4 { color: var(--text-secondary); font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; }

#category-list { list-style: none; margin-bottom: 12px; }
#category-list li {
    padding: 10px 14px; margin-bottom: 6px; border-radius: 8px; cursor: pointer; transition: 0.2s;
    display: flex; justify-content: space-between; align-items: center; font-size: 0.95em; background: rgba(255,255,255,0.02);
}
#category-list li:hover { background: rgba(255,255,255,0.08); }
.cat-count { background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 12px; font-size: 0.8em; color: var(--text-secondary); }

.add-category { display: flex; gap: 8px; }
.btn-icon, .btn-text { background: transparent; border: none; cursor: pointer; transition: 0.2s; }
.btn-icon { background: rgba(255,255,255,0.1); color: var(--text-secondary); border-radius: 8px; width: 44px; font-size: 1.4em; }
.btn-icon:hover { background: rgba(255,255,255,0.25); color: white; }
.btn-text { color: var(--text-secondary); }
.btn-text:hover { color: white; }

.user-info { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--panel-border); margin-top: 10px; }
.user-info .btn-text:last-child { color: var(--danger-color); }
.user-info .btn-text:last-child:hover { color: #f87171; text-decoration: underline; }

/* ======== DASHBOARD MAIN ======== */
.main-content { flex: 1; padding: 16px; display: flex; flex-direction: column; overflow-y: auto; }
.topbar { padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center;}
.stats { color: var(--text-secondary); font-size: 0.95em; }
.stats span { color: #60a5fa; font-weight: 600; font-size: 1.2em; margin: 0 4px; }

.content-wrapper { display: flex; flex-direction: column; gap: 20px; }
.add-link-section, .links-display-section { padding: 24px; }
.add-link-section h3 { margin-bottom: 20px; font-weight: 600; font-size: 1.2em;}

.form-row { display: flex; gap: 16px; align-items: flex-end;}
.flex-2 { flex: 2; } .flex-1 { flex: 1; }

.checkbox-group {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 16px; background: rgba(0,0,0,0.2); border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); max-height: 200px; overflow-y: auto;
}
.checkbox-item {
    display: flex; align-items: center; gap: 8px; font-size: 0.95em; cursor: pointer; background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 6px; transition: 0.2s;
}
.checkbox-item:hover { background: rgba(255,255,255,0.1); }
.checkbox-item input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent-color); }

.warnings-container {
    background: var(--warning-bg); border-left: 4px solid var(--warning-color); padding: 16px; border-radius: 0 8px 8px 0; margin-bottom: 20px; animation: slideIn 0.3s ease-out;
}
.warnings-container h4 { color: var(--warning-color); margin-bottom: 8px; font-size: 0.95em; }
.warning-item { font-size: 0.9em; color: #fca5a5; margin-bottom: 6px; line-height: 1.4; }
.form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.filter-bar { display: flex; gap: 16px; margin-bottom: 20px; }

/* Bảng dữ liệu theo nhóm (Mới) */
.month-group { margin-bottom: 30px; animation: fadeIn 0.4s; }
.month-group-header {
    background: rgba(59, 130, 246, 0.2); padding: 10px 16px; border-radius: 8px 8px 0 0; font-weight: 600; color: #93c5fd; font-size: 1.1em;
}
.table-container { border-radius: 0 0 8px 8px; border: 1px solid rgba(255,255,255,0.05); overflow-x: auto;}
.modern-table { width: 100%; border-collapse: collapse; text-align: left; background: rgba(0,0,0,0.1); }
.modern-table th { padding: 14px 16px; color: var(--text-secondary); font-weight: 600; font-size: 0.85em; text-transform: uppercase; background: rgba(0,0,0,0.2); }
.modern-table td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.95em; line-height: 1.5; }
.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background: rgba(255,255,255,0.04); }

.tag { display: inline-block; padding: 4px 10px; border-radius: 20px; background: rgba(59, 130, 246, 0.15); color: #93c5fd; font-size: 0.8em; margin: 3px 3px 3px 0; border: 1px solid rgba(59, 130, 246, 0.2); }
.url-text { max-width: 350px; overflow-wrap: break-word; word-break: break-all; color: #e2e8f0; display: block; }
.date-text { color: var(--text-secondary); font-size: 0.9em; white-space: nowrap; }

.btn-small { padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 0.85em; transition: 0.2s; margin-right: 4px;}
.btn-small:hover { background: rgba(255,255,255,0.1); color: white;}
.btn-danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.btn-danger:hover { background: var(--danger-color); color: white; border-color: transparent;}
.btn-edit { color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
.btn-edit:hover { background: var(--accent-color); color: white; border-color: transparent;}

/* ======== MODALS ======== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center; z-index: 999;
}
.modal { width: 600px; max-width: 90vw; padding: 30px; animation: slideIn 0.3s; position: relative;}
.modal h3 { margin-bottom: 20px; font-size: 1.4em; border-bottom: 1px solid var(--panel-border); padding-bottom: 15px;}
.modal-actions { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--panel-border); display: flex; justify-content: flex-end; gap: 15px; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px;}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.pagination-container {
    display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px;
}
#page-info { font-weight: 500; font-size: 0.95em; color: var(--text-secondary); background: rgba(0,0,0,0.2); padding: 6px 16px; border-radius: 20px;}

.btn-stat {
    padding: 8px 16px; border-radius: 20px; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd; cursor: pointer; transition: 0.2s; font-size: 0.85em; font-weight: 500;
}
.btn-stat:hover { background: rgba(59, 130, 246, 0.25); }
.btn-stat.active { background: var(--accent-color); color: white; border-color: transparent; box-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }

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