/* GS UI tuned to match quanly.tranganhbabystore.com layout proportions */
:root {
  --sidebar-w: 240px;
  --profile-bg: #0f172a;
  --bg-workspace: #f2f2f7;
  --card-bg: #ffffff;
  --text-main: #1c1c1e;
  --text-muted: #64748b;
  --nav-muted: #94a3b8;
  --blue: #007aff;
  --blue-soft: rgba(0,122,255,.10);
  --green: #22c55e;
  --green-soft: #dcfce7;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; font-size:15px; background:var(--bg-workspace); color:var(--text-main); }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; }
[hidden] { display:none!important; }

/* Login follows same clean admin feeling */
.login-screen { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg-workspace); padding:20px; }
.login-card { width:100%; max-width:380px; background:#fff; border-radius:16px; box-shadow:0 10px 30px rgba(15,23,42,.12); padding:32px 28px 24px; }
.login-brand { text-align:center; margin-bottom:24px; }
.login-logo { width:56px; height:56px; border-radius:50%; background:#e2e8f0; color:#0f172a; display:flex; align-items:center; justify-content:center; font-weight:800; margin:0 auto 12px; }
.login-logo.small { width:42px; height:42px; margin:0; border-radius:50%; background:#334155; color:#fff; }
.login-brand h1 { margin:0 0 4px; font-size:22px; color:#0f172a; }
.login-brand p { margin:0; font-size:13px; color:#64748b; }
.field { margin-bottom:14px; }
.field label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:#334155; }
.field input { width:100%; height:40px; border:1px solid #dbe1ea; border-radius:10px; padding:0 12px; background:#fff; font-size:14px; }
.field input:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(0,122,255,.12); }
.password-wrap { position:relative; }
.password-wrap input { padding-right:42px; }
.pw-toggle { position:absolute; right:4px; top:50%; transform:translateY(-50%); border:0; background:transparent; color:#64748b; padding:8px; }
.field-error { min-height:16px; color:var(--red); font-size:12px; margin-top:3px; }
.form-error { background:#fef2f2; border:1px solid #fecaca; color:#dc2626; padding:10px 12px; border-radius:10px; font-size:13px; margin-bottom:12px; }
.btn { border:0; border-radius:10px; height:38px; padding:0 16px; display:inline-flex; align-items:center; justify-content:center; font-size:14px; font-weight:600; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-primary:disabled { opacity:.55; cursor:not-allowed; }
.btn-secondary { background:#f1f5f9; color:#334155; }
.btn-block { width:100%; }
.login-footer { text-align:center; color:#64748b; font-size:12px; margin:16px 0 0; }

/* 1:1 shell */
.app-shell { min-height:100vh; display:block; background:var(--bg-workspace); }
.sidebar { width:var(--sidebar-w); position:fixed; left:0; top:0; bottom:0; background:#fff; color:#e2e8f0; border-right:1px solid #f1f5f9; z-index:40; display:flex; flex-direction:column; transition:transform .2s ease; }
.sidebar-brand { display:none; }
.sidebar-user { height:69px; background:var(--profile-bg); padding:12px 16px; display:flex; align-items:center; gap:12px; flex-shrink:0; }
.avatar { width:42px; height:42px; border-radius:50%; background:#334155; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:15px; }
.user-name { color:#fff; font-weight:700; font-size:14px; line-height:18px; }
.user-role { color:#cbd5e1; font-size:11px; line-height:16px; margin-top:1px; text-transform:uppercase; white-space:nowrap; }
.user-role::before { content:'👤 '; color:#38bdf8; }
.sidebar-nav { padding:8px 0; overflow-y:auto; flex:1; display:flex; flex-direction:column; }
.nav-group { margin:0 0 11px; }
.nav-group-title { padding:12px 16px 6px; color:#94a3b8; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; }
.nav-link { height:38px; padding:10px 16px; display:flex; align-items:center; gap:10px; color:#94a3b8; font-size:14px; font-weight:500; border-left:4px solid transparent; }
.nav-link:hover { background:#f8fafc; color:#64748b; }
.nav-link.active { background:var(--blue-soft); color:var(--blue); border-left-color:var(--blue); font-weight:600; }
.nav-icon { width:18px; text-align:center; font-size:15px; opacity:.95; }
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:39; }

.main-area { margin-left:var(--sidebar-w); min-height:100vh; background:var(--bg-workspace); }
.topbar { height:56px; background:#fff; display:flex; align-items:center; gap:12px; padding:0 20px; box-shadow:0 1px 3px rgba(0,0,0,.08); position:sticky; top:0; z-index:20; }
.hamburger { width:32px; height:32px; border:0; background:transparent; color:#64748b; font-size:20px; display:flex; align-items:center; justify-content:center; }
.page-title { margin:0; font-size:18px; line-height:56px; font-weight:700; color:#1c1c1e; flex:1; }
.topbar-right { display:flex; align-items:center; }
.topbar-branch { color:#64748b; background:#f1f5f9; border-radius:999px; padding:5px 10px; font-size:12px; }
.page-content { padding:20px; }
.bottom-nav { display:none; }

/* Dashboard cards match reference: icon block left, value/label right, 4 in a row */
.card-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-bottom:20px; }
.stat-card { height:86px; background:#fff; border-radius:12px; box-shadow:var(--shadow); border:1px solid rgba(15,23,42,.04); padding:16px; display:grid; grid-template-columns:42px 1fr; column-gap:12px; align-items:center; }
.stat-card::before { content:'📊'; width:42px; height:42px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:20px; background:#e0f2fe; color:var(--blue); grid-row:1 / span 3; }
.stat-card.accent::before { content:'✅'; background:#e0f2fe; color:var(--blue); }
.stat-card.green::before { content:'🕒'; background:var(--green-soft); color:var(--green); }
.stat-card.amber::before { content:'⚠️'; background:var(--amber-soft); color:var(--amber); }
.stat-card.red::before { content:'📦'; background:var(--red-soft); color:var(--red); }
.stat-label { color:#8a8f98; font-size:14px; line-height:18px; order:2; }
.stat-value { font-size:22px; line-height:26px; font-weight:800; color:var(--blue); order:1; }
.stat-sub { font-size:12px; line-height:16px; color:#8a8f98; order:3; }
.stat-card.green .stat-value { color:var(--green); }
.stat-card.amber .stat-value { color:var(--amber); }
.stat-card.red .stat-value { color:var(--red); }

.section-card, .checklist-item, .lesson-card, .placeholder-box { background:#fff; border-radius:12px; box-shadow:var(--shadow); border:1px solid rgba(15,23,42,.04); }
.section-card { padding:16px; margin-bottom:16px; }
.section-card h2 { margin:0 0 12px; font-size:17px; font-weight:700; }
.section-card h3 { margin:0 0 10px; font-size:15px; }
.progress-bar { height:8px; background:#edf2f7; border-radius:999px; overflow:hidden; }
.progress-bar-fill { height:100%; background:var(--blue); border-radius:999px; transition:width .2s; }
.empty-state { color:#64748b; font-size:13px; padding:12px 0; text-align:center; }
.pending-list { display:flex; flex-direction:column; gap:8px; }
.pending-row { min-height:38px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 12px; border-radius:10px; background:#fff; border:1px solid #eef2f7; font-size:14px; }
.pending-row .label { color:#334155; font-weight:500; }
.pending-row .tag { color:var(--amber); background:var(--amber-soft); padding:3px 9px; border-radius:999px; font-size:12px; font-weight:700; }

.checklist-item { padding:14px 16px; margin-bottom:12px; }
.checklist-item-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:9px; }
.checklist-item-title { font-size:15px; font-weight:700; color:#1e293b; }
.badge { border-radius:999px; padding:4px 10px; font-size:12px; font-weight:800; white-space:nowrap; }
.badge.submitted { color:#16a34a; background:#dcfce7; }
.badge.pending { color:#d97706; background:#fef3c7; }
.checklist-item-meta { color:#64748b; font-size:12px; margin-bottom:8px; }
.checklist-item-body { font-size:14px; }
.form-row { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; margin-top:10px; }
.form-row .field { flex:1; min-width:160px; margin-bottom:0; }
.custom-file { display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-height:42px; padding:8px 10px; border:1px dashed #cbd5e1; border-radius:10px; background:#f8fafc; }
.custom-file input[type=file] { position:absolute; opacity:0; width:1px; height:1px; overflow:hidden; }
.file-cta { background:#eaf3ff; color:var(--blue); font-weight:800; padding:7px 10px; border-radius:8px; font-size:13px; }
.file-name { color:#64748b; font-size:13px; }
.photo-links { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.photo-links a { font-size:12px; color:var(--blue); background:#eaf3ff; padding:4px 10px; border-radius:6px; }

.history-day { margin-bottom:14px; }
.history-day-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px; }
.history-day-head .date { font-weight:800; }
.history-items { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; }
.history-item { border:1px solid #eef2f7; border-radius:10px; padding:8px 10px; font-size:13px; display:flex; justify-content:space-between; gap:8px; }
.history-item .status.done { color:#16a34a; font-weight:700; }
.history-item .status.miss { color:#94a3b8; }
.lesson-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; }
.lesson-card { overflow:hidden; }
.lesson-thumb { height:96px; background:#eff6ff; display:flex; align-items:center; justify-content:center; font-size:30px; }
.lesson-body { padding:14px; }
.lesson-body h3 { margin:0 0 6px; font-size:15px; }
.lesson-body p { margin:0; font-size:13px; color:#64748b; }
.lesson-tag { display:inline-block; margin-top:9px; color:var(--blue); background:#eaf3ff; padding:4px 9px; border-radius:999px; font-size:12px; font-weight:700; }
.placeholder-box { padding:40px 20px; text-align:center; color:#64748b; }
.placeholder-box .big-icon { font-size:42px; margin-bottom:10px; }
.placeholder-box h2 { color:#1e293b; font-size:17px; margin:0 0 6px; }
.profile-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.profile-row { background:#f8fafc; border:1px solid #eef2f7; border-radius:10px; padding:12px; }
.profile-row .k { color:#64748b; font-size:12px; margin-bottom:4px; }
.profile-row .v { font-weight:700; }
.toast-container { position:fixed; top:16px; right:16px; display:flex; flex-direction:column; gap:8px; z-index:100; }
.toast { background:#0f172a; color:#fff; border-radius:10px; padding:10px 14px; box-shadow:0 6px 20px rgba(0,0,0,.14); font-size:13px; max-width:320px; }
.toast.error { background:#dc2626; }
.toast.success { background:#16a34a; }

@media (max-width:900px){
  .sidebar{transform:translateX(-100%)} .sidebar.open{transform:translateX(0)} .sidebar-overlay.show{display:block}
  .main-area{margin-left:0}.card-grid{grid-template-columns:repeat(2,1fr)}
  .bottom-nav{display:flex;position:sticky;bottom:0;z-index:20;background:#fff;border-top:1px solid #e5e7eb;justify-content:space-around;padding:7px 0 calc(7px + env(safe-area-inset-bottom))}
  .bottom-nav a{font-size:10px;color:#64748b;display:flex;flex-direction:column;align-items:center;gap:1px}.bottom-nav a.active{color:var(--blue)}
  .page-content{padding-bottom:80px}
}
@media (min-width:901px){ .hamburger{display:flex} }
@media (max-width:560px){
  .topbar{height:auto;min-height:54px;padding:8px 10px;gap:6px;flex-wrap:wrap;align-items:center}
  .topbar .hamburger{flex:0 0 32px}
  .page-title{font-size:16px;line-height:24px;min-width:0;flex:1 1 calc(100% - 44px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar-right{order:3;width:100%;display:flex;gap:6px;min-width:0;padding-left:38px}
  .topbar-branch-switch{width:100%;max-width:none;height:38px;font-size:13px}
  .topbar-right .topbar-branch{display:none}
  .page-content{padding:14px 12px 84px}.card-grid{grid-template-columns:1fr}.profile-grid{grid-template-columns:1fr}.stat-card{min-height:78px}
}
 .topbar-branch-switch{max-width:190px;padding:7px 10px;border:1px solid var(--border);border-radius:8px;background:#fff;color:#1e293b;font-weight:600}.admin-table-wrap{overflow:auto}.admin-table{width:100%;border-collapse:collapse;font-size:14px}.admin-table th,.admin-table td{padding:12px 10px;border-bottom:1px solid var(--border,#e5e7eb);text-align:left;vertical-align:top}.admin-table th{background:#f8fafc;color:#475569;font-size:12px;text-transform:uppercase}.admin-item{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid #eef2f7}.admin-item a{color:var(--accent,#2563eb);margin-left:8px}.btn-sm{padding:6px 10px;font-size:12px}@media(max-width:700px){.admin-filters{display:block}.admin-filters .field{margin-bottom:10px}.admin-item{display:block}.admin-item span{display:block;margin-bottom:4px}}
 .media-thumb{display:inline-block;width:72px;height:54px;object-fit:cover;border-radius:6px;border:1px solid #dbe3ee;vertical-align:middle;margin:3px}.video-thumb{height:auto;width:auto;padding:8px 10px;background:#eff6ff;text-decoration:none;font-weight:600}
