@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --glass: #ffffff;
  --glass-border: #e5eaf3;
  --glass-hover: #eef4ff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-bg: #eef4ff;
  --success: #16a34a;
  --success-bg: #e8f8ee;
  --danger: #dc2626;
  --danger-bg: #fef0f0;
  --warning: #ea580c;
  --warning-bg: #fdf1e9;
  --radius: 12px;
  --radius-lg: 20px;
  --sidebar-w: 236px;
  --shadow-card: 0 2px 6px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 14px 32px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top left, #eef5ff 0%, #f7f9fc 55%, #ffffff 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, #94a3b8 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 380px;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.15),
    0 8px 20px rgba(15, 23, 42, 0.08) !important;
}

/* ===== Full-bleed hero login (ảnh phủ toàn màn hình, card nổi bên phải) ===== */
.login-split {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
@media (max-width: 900px) {
  .login-split .brand-panel { display: none; }
  .form-panel { position: relative !important; width: 100% !important; background: var(--bg); }
}

.brand-panel {
  position: absolute; inset: 0;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #060810;
  z-index: 0;
}
.brand-illustration {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  object-position: 15% center;
  z-index: 0;
}
.brand-panel::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 12, 30, 0.6) 0%, rgba(3, 12, 30, 0.25) 40%, rgba(3, 12, 30, 0.15) 65%, rgba(3, 12, 30, 0.35) 100%),
    linear-gradient(135deg, rgba(7, 24, 58, 0.3), rgba(3, 12, 30, 0.4));
  z-index: 1;
}
.brand-panel::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.15), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.10), transparent 35%);
  pointer-events: none;
  z-index: 1;
}
.brand-header { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }
.brand-shield { width: 52px; height: 52px; flex-shrink: 0; object-fit: contain; }
.brand-header .org-name { font-size: 15px; font-weight: 600; line-height: 1.35; color: #f1f5f9; }
.brand-header .org-sub { font-size: 11px; color: #94a3b8; letter-spacing: 0.03em; margin-top: 2px; }

.brand-mid { position: relative; z-index: 2; margin: 40px 0; max-width: 56%; }
.brand-mid .divider { width: 40px; height: 2px; background: #4d8dff; margin-bottom: 16px; border-radius: 2px; }
.brand-mid h2 { font-size: 32px; font-weight: 700; line-height: 1.2; margin: 0 0 16px; color: #f1f5f9; }
.brand-mid h2 .accent { color: #93b4fb; display: block; }
.brand-mid p { font-size: 14px; color: #94a3b8; line-height: 1.6; max-width: 380px; }

.brand-features {
  position: relative; z-index: 2;
  display: flex; gap: 28px; flex-wrap: wrap;
}
.brand-features .feature { display: flex; align-items: center; gap: 10px; }
.brand-features .feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 0.5px solid rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-features .feature-text .t { font-size: 13px; font-weight: 500; color: #f1f5f9; }
.brand-features .feature-text .s { font-size: 11px; color: #94a3b8; }

.form-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(460px, 42%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 48px;
  z-index: 3;
}
.form-panel .form-inner { width: 100%; max-width: 380px; }
.form-panel .logo-circle {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--accent-bg); border: 0.5px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; padding: 12px; overflow: hidden;
}
.form-panel h1.page-title { text-align: center; font-size: 22px; }
.form-panel p.page-sub { text-align: center; }

.input-icon-wrap { position: relative; margin-bottom: 14px; }
.input-icon-wrap input { padding-left: 40px; margin-bottom: 0; }
.input-icon-wrap .field-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #64748b; display: flex; pointer-events: none;
}
.input-icon-wrap .toggle-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; color: var(--text-muted);
  cursor: pointer; display: flex;
}

.form-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.form-divider .line { flex: 1; height: 0.5px; background: var(--glass-border); }
.form-divider span { font-size: 12px; color: var(--text-muted); }

.footer-copy { text-align: center; font-size: 12px; color: #64748b; opacity: 0.75; margin-top: 24px; line-height: 1.6; }

.glass {
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.glass.hoverable:hover {
  border-color: #c7d7fb;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card { padding: 1.5rem; }

h1.page-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
p.page-sub { font-size: 13px; font-weight: 400; color: var(--text-secondary); margin: 0 0 20px; }

label { font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select {
  width: 100%;
  height: 38px;
  border: 1px solid #d8e1f0;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
  margin-bottom: 14px;
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: #a3aebd; }
input:focus, select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }

button {
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: #ffffff;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.15s ease, border-color 0.15s ease;
}
button:hover { background: var(--glass-hover); border-color: #c7d7fb; }
button.primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff; border: none; width: 100%; height: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.3);
}
button.danger { background: var(--danger); color: #fff; border: none; }
button.success { background: var(--success); color: #fff; border: none; }
button.sm { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error-msg { color: var(--danger); font-size: 13px; margin: -6px 0 12px; display: none; }
.toast-msg { font-size: 13px; margin: -6px 0 12px; display: none; }
.toast-msg.success { color: var(--success); }
.toast-msg.error { color: var(--danger); }

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--glass-border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; margin-bottom: 24px; }
.sidebar .brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.sidebar .brand .org-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text-primary); }
.sidebar .brand .org-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  height: 44px;
  padding: 0 10px 0 11px; border-radius: var(--radius);
  color: var(--text-secondary); text-decoration: none; font-size: 13px;
  border-left: 4px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); transition: color 0.2s ease; }
.sidebar nav a:hover { background: #f1f5f9; color: var(--text-primary); }
.sidebar nav a:hover svg { color: var(--accent); }
.sidebar nav a.active {
  background: #eff6ff; color: var(--accent-strong); font-weight: 600; border-left-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 2px 8px rgba(37, 99, 235, 0.12);
}
.sidebar nav a.active svg { color: var(--accent); }
.sidebar .user-box {
  border-top: 1px solid var(--glass-border); padding-top: 14px; margin-top: 14px;
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 10px;
}
.sidebar .user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(37,99,235,0.35);
}
.sidebar .user-box .email { color: var(--text-primary); font-size: 12.5px; margin-bottom: 2px; word-break: break-all; font-weight: 500; }
.sidebar button.link { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 11.5px; padding: 0; }

.main { flex: 1; padding: 28px 32px; max-width: 1180px; position: relative; animation: pageFadeIn 0.35s ease; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Header watermark toà nhà UEd (5-8% opacity, không che nội dung) ===== */
.main > * { position: relative; z-index: 1; }

/* ===== System status bar ===== */
.status-bar {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  padding: 12px 16px; margin-bottom: 22px; font-size: 12px;
}
.status-bar .status-item {
  display: flex; align-items: center; gap: 6px; color: var(--text-secondary);
  padding: 4px 10px; border-radius: 999px; background: var(--bg);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-muted);
}
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); animation: pulseDot 2s infinite; }
.status-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.status-dot.down { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-bg); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  padding: 18px; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.05) !important;
  border: 1px solid rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.stat-card.hoverable:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.15) !important;
}
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-card .stat-icon svg { width: 18px; height: 18px; }
.stat-icon.blue { background: #eaf1ff; color: var(--accent); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: #d97706; }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; }
.stat-value { font-size: 27px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }

.badge { font-size: 11px; padding: 3px 10px; border-radius: 999px; display: inline-block; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #c2410c; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #f1f5f9; color: var(--text-secondary); }
.badge-accent { background: var(--accent-bg); color: var(--accent-strong); }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--glass-border);
}
.list-row .name { font-size: 13px; }
.list-row .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-row .actions { display: flex; gap: 6px; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.room-card { border-radius: var(--radius-lg); padding: 16px; border: 1px solid var(--glass-border); }
.room-card.active { border-color: #fecaca; background: linear-gradient(135deg, var(--danger-bg), #ffffff); }
.room-card.waiting { border-color: #bfdbfe; }
.room-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.room-name { font-size: 13.5px; font-weight: 600; margin: 0; }
.room-meta { font-size: 12px; margin: 0 0 3px; color: var(--text-muted); }
.room-card.active .room-meta { color: #b91c1c; }
.room-card .actions { display: flex; gap: 6px; margin-top: 12px; }
.room-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 10px 0; font-size: 12px; }
.room-detail-grid .dl { color: var(--text-muted); }
.room-detail-grid .dv { color: var(--text-primary); }

.live-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.live-dot.green { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); animation: pulseDot 2s infinite; }
.live-dot.blue { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.live-dot.red { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

.section-title { font-size: 15px; font-weight: 600; margin: 28px 0 12px; }
.hint { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 10px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead th {
  text-align: left; color: var(--text-secondary); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.02em;
  padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--glass-border);
}
table.data-table thead th:first-child { border-top-left-radius: var(--radius-lg); }
table.data-table thead th:last-child { border-top-right-radius: var(--radius-lg); }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--glass-border); }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:nth-child(even) { background: #fbfcfe; }
table.data-table tbody tr { transition: background 0.15s ease; }
table.data-table tbody tr:hover { background: #f8fbff; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { background: transparent; border: 1px solid var(--glass-border); }
.tabs button.active { background: var(--accent-bg); color: var(--accent-strong); border-color: transparent; }

.countdown-big { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.duration-btn.active { background: var(--accent); color: #fff; border-color: transparent; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.35);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box { width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; }

.toast-notif {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  padding: 12px 18px; border-radius: var(--radius); font-size: 13px;
  max-width: 320px; font-weight: 500; box-shadow: var(--shadow-hover);
}

.notif-count-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ===== Phiên bản trình chiếu màn hình lớn / TV 75" (>=1920px) ===== */
@media (min-width: 1920px) {
  .main { max-width: 1600px; padding: 40px 56px; }
  .stat-grid { gap: 20px; margin-bottom: 36px; }
  .stat-card { padding: 26px; }
  .stat-value { font-size: 36px; }
  .stat-label { font-size: 14px; }
  .stat-card .stat-icon { width: 46px; height: 46px; }
  .stat-card .stat-icon svg { width: 22px; height: 22px; }
  .section-title { font-size: 19px; }
  table.data-table { font-size: 15px; }
  table.data-table td, table.data-table th { padding: 14px 16px; }
  .badge { font-size: 13px; padding: 4px 12px; }
  .sidebar { width: 280px; }
  .room-card { padding: 22px; }
  .room-name { font-size: 16px; }
}
