:root[data-theme="dark"] {
    --bg-primary: #0b0f19; --bg-secondary: #131a2c; --bg-card: #1a233a;
    --text-main: #f1f5f9; --text-muted: #94a3b8;
    --accent: #38bdf8; --accent-glow: rgba(56, 189, 248, 0.2);
    --border-color: rgba(255, 255, 255, 0.05);
    --sidebar-width: 68px; --sidebar-expand: 240px; --modal-bg: rgba(0, 0, 0, 0.7);
}
:root[data-theme="light"] {
    --bg-primary: #f8fafc; --bg-secondary: #ffffff; --bg-card: #f1f5f9;
    --text-main: #0f172a; --text-muted: #64748b;
    --accent: #0284c7; --accent-glow: rgba(2, 132, 199, 0.1);
    --border-color: rgba(0, 0, 0, 0.05);
    --sidebar-width: 68px; --sidebar-expand: 240px; --modal-bg: rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; transition: background-color 0.3s ease, color 0.3s ease; }
body { background-color: var(--bg-primary); color: var(--text-main); overflow-x: hidden; display: flex; }

.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); background-color: var(--bg-secondary); border-right: 1px solid var(--border-color); z-index: 100; overflow: hidden; display: flex; flex-direction: column; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar:hover { width: var(--sidebar-expand); box-shadow: 10px 0 30px rgba(0,0,0,0.2); }
.sidebar-brand { padding: 24px 20px; display: flex; align-items: center; gap: 15px; }
.brand-icon { font-size: 28px; color: var(--accent); }
.brand-text { font-family: 'Orbitron', sans-serif; font-weight: bold; font-size: 18px; opacity: 0; white-space: nowrap; transition: opacity 0.2s; }
.sidebar:hover .brand-text { opacity: 1; }
.sidebar-menu { display: flex; flex-direction: column; gap: 8px; padding: 10px; flex-grow: 1; }
.menu-item { display: flex; align-items: center; gap: 20px; padding: 14px; border-radius: 12px; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.menu-item i { font-size: 22px; }
.menu-text { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .menu-text { opacity: 1; }
.menu-item:hover, .menu-item.active { background-color: var(--accent-glow); color: var(--accent); }
.sidebar-footer { padding: 20px; display: flex; justify-content: center; }
.btn-theme { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; }
.btn-theme:hover { color: var(--accent); }

.main-container { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); min-height: 100vh; padding: 30px; }
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-title { font-family: 'Orbitron', sans-serif; font-size: 24px; font-weight: 700; color: var(--accent); }

.ai-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.app-view { display: none; }
.app-view.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.btn-primary { padding: 10px 20px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.95); }
.btn-icon { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 8px; padding: 8px; font-size: 20px; cursor: pointer; }
.btn-icon:hover { background: var(--accent-glow); color: var(--accent); }

.form-select, .form-input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-main); margin-top: 5px; outline: none; }
.form-select:focus, .form-input:focus { border-color: var(--accent); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.input-group { margin-bottom: 15px; display: flex; gap: 10px; align-items: center; }
.input-group input { flex: 1; padding: 10px 15px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-main); outline: none; }
.data-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.data-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; }
.shift-color-badge { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; }
.btn-delete { color: #ef4444; background: none; border: none; font-size: 18px; cursor: pointer; }

/* LỊCH LÀM VIỆC */
.calendar-container { padding: 0; overflow: hidden; }
.calendar-header-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 600; padding: 15px 0; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(100px, auto); }
.calendar-day { padding: 10px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); min-height: 120px; display: flex; flex-direction: column; cursor: pointer; transition: background 0.2s; }
.calendar-day:hover { background: var(--bg-card); }
.calendar-day.empty { background: var(--bg-primary); cursor: default; }
.day-number { font-weight: bold; font-size: 16px; margin-bottom: 8px; color: var(--text-muted); }
.calendar-day.today .day-number { color: var(--accent); background: var(--accent-glow); display: inline-block; padding: 2px 8px; border-radius: 12px; }

.shift-tag { font-size: 11px; font-weight: 600; padding: 4px 6px; border-radius: 4px; margin-bottom: 4px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); display: flex; justify-content: space-between; }
.task-tag { font-size: 11px; background: rgba(255,255,255,0.1); border: 1px dashed var(--border-color); padding: 3px 6px; border-radius: 4px; margin-bottom: 4px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot-tag { font-size: 11px; background: #ea4335; color: white; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-right: 4px; }
.trade-tag { font-size: 11px; background: #f59e0b; color: white; padding: 2px 6px; border-radius: 4px; margin-top: 4px; display: inline-block; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--modal-bg); z-index: 999; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(5px); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { width: 100%; max-width: 400px; transform: translateY(-20px); transition: 0.3s; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.btn-close-modal { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }

/* MODULE PRODUCTIVITY */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.input-group-col { display: flex; flex-direction: column; gap: 8px; }
.input-group-col label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.prod-input { font-size: 16px; font-weight: 600; text-align: center; }

input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0); }

/* MODULE DASHBOARD */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 10px; }
.kpi-card { display: flex; flex-direction: column; justify-content: center; padding: 20px; }
.kpi-title { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.kpi-value { font-family: 'Orbitron', sans-serif; font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.kpi-subtitle { font-size: 13px; color: var(--text-muted); margin-top: auto; }
.progress-container { width: 100%; height: 8px; background: var(--bg-primary); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); transition: width 0.5s ease; }

@media (max-width: 992px) { 
    .settings-grid, .kpi-grid { grid-template-columns: 1fr; }
    .calendar-grid { grid-auto-rows: minmax(80px, auto); }
}
@media (max-width: 768px) {
    .sidebar { width: 0; var(--sidebar-width): 0px; }
    .sidebar:hover { width: var(--sidebar-expand); }
    .main-container { margin-left: 0; width: 100%; padding: 15px; }
    .schedule-toolbar { flex-direction: column; gap: 15px; }
}
