:root {
  --bg: #08090b;
  --bg-soft: #0c0e12;
  --panel: #12151b;
  --panel-2: #181c24;
  --field: #0d1015;
  --text: #f4f0e8;
  --muted: #949aa5;
  --gold: #d8b36d;
  --gold-light: #f0d59f;
  --line: rgba(255,255,255,.1);
  --line-gold: rgba(216,179,109,.3);
  --red: #ee7064;
  --green: #45d590;
  --sidebar: 268px;
  --shadow: 0 28px 80px rgba(0,0,0,.38);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 80% 0, rgba(216,179,109,.05), transparent 30%), var(--bg-soft); font-family: var(--sans); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { color: #17120b; background: var(--gold); }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.login-screen { min-height: 100vh; padding: 25px; display: grid; place-items: center; background: radial-gradient(circle at 22% 18%, rgba(216,179,109,.18), transparent 27%), radial-gradient(circle at 84% 77%, rgba(216,179,109,.08), transparent 23%), #07080a; }
.login-screen::before { content: ""; position: fixed; inset: 0; opacity: .14; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 60px 60px; }
.login-card { position: relative; width: min(440px,100%); padding: 46px; background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 48%), var(--panel); border: 1px solid var(--line-gold); box-shadow: var(--shadow); }
.login-card::before { content: "ĐĂNG NHẬP QUẢN TRỊ"; display: block; margin-bottom: 30px; color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .22em; }
.admin-brand { display: inline-flex; align-items: baseline; gap: 9px; }
.admin-brand strong { font: 700 26px/1 var(--serif); letter-spacing: .13em; }
.admin-brand span { color: var(--gold); font-size: 8px; font-weight: 900; letter-spacing: .2em; }
.login-card > p { color: var(--muted); }
.login-card label { margin-top: 17px; }
label { display: grid; gap: 6px; }
label > span { color: #c6c9cf; font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
input, select, textarea { width: 100%; padding: 11px 12px; color: var(--text); border: 1px solid var(--line); background: var(--field); outline: none; color-scheme: dark; }
input, select { min-height: 45px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,179,109,.1); }
input[type="file"] { padding: 10px; }
button:disabled { cursor: not-allowed; opacity: .5; }
.primary-button, .outline-button, .danger-button { min-height: 43px; padding: 10px 17px; border: 1px solid transparent; font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; transition: .2s; }
.primary-button { color: #17120b; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(216,179,109,.17); }
.outline-button { color: #d8dae0; border-color: var(--line); background: transparent; }
.outline-button:hover:not(:disabled) { color: var(--gold-light); border-color: var(--gold); }
.danger-button { color: var(--red); background: rgba(238,112,100,.09); }
.login-card .primary-button { width: 100%; margin-top: 19px; }
.login-hint { padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); font-size: 11px; }
.back-link { display: block; margin-top: 22px; text-align: center; color: var(--muted); font-size: 11px; }
.form-message { min-height: 18px; margin: 10px 0 0; font-size: 11px; }
.form-message.success { color: var(--green); }
.form-message.error { color: var(--red); }

.admin-app { min-height: 100vh; }
.sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; width: var(--sidebar); padding: 31px 20px; color: white; background: linear-gradient(180deg, #0d0f13, #08090b); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar::after { content: "V"; position: absolute; left: -20px; bottom: 70px; color: rgba(255,255,255,.022); font: 700 210px/1 var(--serif); pointer-events: none; }
.sidebar-brand { position: relative; z-index: 1; padding: 5px 8px 29px; border-bottom: 1px solid var(--line); }
.admin-nav { position: relative; z-index: 1; display: grid; gap: 5px; margin-top: 25px; }
.admin-nav button { width: 100%; padding: 15px 12px; border: 0; color: #8f949e; background: transparent; display: flex; align-items: center; gap: 15px; text-align: left; transition: .2s; }
.admin-nav button b { color: var(--gold); font: 700 11px/1 var(--serif); }
.admin-nav button span { font-size: 11px; font-weight: 800; }
.admin-nav button:hover, .admin-nav button.active { color: white; background: linear-gradient(90deg, rgba(216,179,109,.14), rgba(255,255,255,.025)); box-shadow: inset 2px 0 var(--gold); }
.sidebar-bottom { position: relative; z-index: 1; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.sidebar-bottom a, .sidebar-bottom button { padding: 10px 12px; color: #9499a2; border: 0; background: transparent; text-align: left; font-size: 11px; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: var(--gold-light); }

.admin-main { margin-left: var(--sidebar); padding: 34px; }
.admin-topbar { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 31px; }
.admin-topbar p, .panel-heading p, .editor-heading p, .panel-kicker { margin: 0 0 7px; color: var(--gold); font-size: 8px; font-weight: 900; letter-spacing: .2em; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(69,213,144,.1); }
.admin-topbar h1 { margin: 0; font: 700 43px/1 var(--serif); }
.admin-topbar > div:last-child { display: flex; gap: 10px; }
.admin-pane { display: none; }
.admin-pane.active { display: block; animation: pane-in .26s ease-out; }
@keyframes pane-in { from { opacity: 0; transform: translateY(7px); } }

.stats-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(7,1fr); gap: 10px; }
.stat-card { position: relative; min-height: 128px; padding: 20px; overflow: hidden; background: linear-gradient(145deg, rgba(255,255,255,.025), transparent), var(--panel); border: 1px solid var(--line); }
.stat-card::after { content: ""; position: absolute; right: -22px; bottom: -22px; width: 70px; height: 70px; border: 1px solid var(--line-gold); border-radius: 50%; }
.stat-card span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 15px; font: 700 32px/1 var(--serif); }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 20px; }
.panel, .editor-form { padding: 24px; background: linear-gradient(145deg, rgba(255,255,255,.018), transparent 52%), var(--panel); border: 1px solid var(--line); box-shadow: 0 15px 45px rgba(0,0,0,.12); }
.panel-heading, .editor-heading { margin-bottom: 23px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.panel-heading h2, .editor-heading h2, .tool-card h2 { margin: 0; font: 700 29px/1.1 var(--serif); }
.bar-chart { display: grid; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 55px; gap: 12px; align-items: center; font-size: 10px; }
.bar-track { height: 9px; overflow: hidden; background: var(--field); }
.bar-value { height: 100%; background: linear-gradient(90deg, #9f7436, var(--gold-light)); box-shadow: 0 0 18px rgba(216,179,109,.2); }
.bar-row strong { text-align: right; }
.activity-list { max-height: 510px; overflow: auto; }
.activity-item { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--gold); border: 1px solid var(--line); background: var(--field); border-radius: 50%; }
.activity-item p { margin: 0; font-size: 11px; }
.activity-item small { color: var(--muted); }

.table-search { min-width: 260px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; }
th { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr { transition: .15s; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.table-profile { display: flex; align-items: center; gap: 11px; }
.table-profile img { width: 45px; height: 57px; object-fit: cover; background: var(--field); }
.table-profile strong, .table-profile small { display: block; }
.table-profile small { color: var(--muted); }
.status-pill, .visibility-pill, .hot-pill { display: inline-block; padding: 5px 8px; background: var(--field); border: 1px solid var(--line); font-size: 8px; font-weight: 900; }
.status-pill.available, .visibility-pill.on { color: var(--green); }
.status-pill.busy, .hot-pill { color: var(--gold-light); }
.status-pill.offline, .visibility-pill.off { color: var(--red); }
.row-actions { display: flex; gap: 5px; }
.row-actions button { padding: 7px 8px; color: #d4d6dc; border: 1px solid var(--line); background: var(--field); font-size: 9px; font-weight: 800; }
.row-actions button:hover { color: #17120b; border-color: var(--gold); background: var(--gold); }
.row-actions .delete { color: var(--red); }
.row-actions .delete:hover { color: white; border-color: var(--red); background: var(--red); }

.editor-form { padding: 0; }
.editor-heading { margin: 0; padding: 25px; border-bottom: 1px solid var(--line); }
.form-section { padding: 26px; border-bottom: 1px solid var(--line); }
.form-section h3 { margin: 0 0 19px; font: 700 20px/1.1 var(--serif); }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2,1fr); }
.form-grid.three { grid-template-columns: repeat(3,1fr); }
.form-grid.four { grid-template-columns: repeat(4,1fr); }
.form-grid .full { grid-column: 1/-1; }
.form-grid .span-two { grid-column: span 2; }
.check-label { padding-top: 24px; display: flex; align-items: center; gap: 9px; }
.check-label input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--gold); }
.check-label span { font-size: 10px; }
.form-actions { padding: 22px 25px; display: flex; align-items: center; gap: 12px; }
.gallery-preview { margin-top: 16px; display: grid; grid-template-columns: repeat(8,1fr); gap: 8px; }
.gallery-preview figure { position: relative; margin: 0; aspect-ratio: 3/4; background: var(--field); border: 1px solid var(--line); }
.gallery-preview img { width: 100%; height: 100%; object-fit: cover; }
.gallery-preview button { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; color: white; border: 0; background: rgba(190,48,38,.9); }
.upload-progress { margin-top: 10px; color: var(--muted); font-size: 11px; }
.split-layout { display: grid; grid-template-columns: minmax(300px,.7fr) 1.3fr; gap: 20px; }
.compact-form { display: grid; gap: 13px; align-content: start; }
.compact-form .panel-heading { margin-bottom: 5px; }
.compact-form .form-actions { padding: 8px 0 0; }
.contact-admin-list { display: grid; gap: 10px; }
.contact-admin-item { padding: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.012); display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.contact-admin-item h3 { margin: 0; font-size: 13px; }
.contact-admin-item p { margin: 3px 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.contact-admin-item .row-actions { align-items: center; }

.tools-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.tool-card { min-height: 310px; padding: 34px; display: grid; grid-template-columns: 65px 1fr; gap: 24px; align-content: start; }
.tool-card.warning { border-color: rgba(238,112,100,.22); }
.tool-icon { width: 60px; height: 60px; display: grid; place-items: center; color: var(--gold-light); border: 1px solid var(--line-gold); background: rgba(216,179,109,.06); font: 700 28px/1 var(--serif); }
.tool-card p:not(.panel-kicker) { max-width: 520px; color: var(--muted); font-size: 12px; }
.tool-card button { margin-top: 12px; }
.file-drop { margin-top: 18px; padding: 15px; border: 1px dashed var(--line-gold); background: rgba(216,179,109,.03); }
.file-drop input { margin-top: 8px; }

.admin-toast { position: fixed; z-index: 30; right: 25px; bottom: 25px; max-width: 340px; padding: 14px 18px; color: #17120b; background: var(--gold-light); box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); transition: .25s; pointer-events: none; font-size: 11px; font-weight: 800; }
.admin-toast.show { opacity: 1; transform: none; }

@media (max-width: 1320px) {
  .stats-grid { grid-template-columns: repeat(4,1fr); }
  .form-grid.four { grid-template-columns: repeat(2,1fr); }
  .gallery-preview { grid-template-columns: repeat(6,1fr); }
}

@media (max-width: 960px) {
  :root { --sidebar: 0px; }
  .sidebar { position: static; width: auto; padding: 18px; }
  .sidebar::after { display: none; }
  .sidebar-brand { padding-bottom: 18px; }
  .admin-nav { margin-top: 15px; display: flex; overflow: auto; }
  .admin-nav button { min-width: max-content; }
  .sidebar-bottom { display: none; }
  .admin-main { margin: 0; padding: 18px; }
  .admin-topbar { align-items: start; }
  .dashboard-grid, .split-layout, .tools-grid { grid-template-columns: 1fr; }
  .form-grid.three { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .admin-topbar { display: block; }
  .admin-topbar > div:last-child { margin-top: 18px; flex-wrap: wrap; }
  .admin-topbar h1 { font-size: 35px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .panel, .form-section { padding: 16px; }
  .panel-heading { display: block; }
  .table-search { min-width: 0; margin-top: 14px; }
  .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: 1; }
  .gallery-preview { grid-template-columns: repeat(4,1fr); }
  .form-actions { padding: 18px 16px; flex-wrap: wrap; }
  .bar-row { grid-template-columns: 85px 1fr 42px; }
  .login-card { padding: 31px 22px; }
  .tool-card { padding: 22px; grid-template-columns: 1fr; }
  .contact-admin-item { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   V9 - GIAO DIỆN QUẢN TRỊ DỄ ĐỌC
   Muốn tăng/giảm toàn bộ chữ: chỉnh font-size trong body.
   ========================================================= */
:root {
  --muted: #b1b7c2;
  --line: rgba(255,255,255,.14);
  --line-gold: rgba(216,179,109,.42);
  --sidebar: 284px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

body { font-size: 16px; line-height: 1.65; }
.login-card { width: min(490px,100%); padding: 50px; border-radius: var(--radius-lg); }
.login-card::before { margin-bottom: 27px; font-size: 11px; }
.admin-brand strong { font-size: 29px; }
.admin-brand span { font-size: 10px; }
.login-card > p { font-size: 15px; }
label { gap: 8px; }
label > span { font-size: 11px; }
input, select, textarea { padding: 13px 14px; border-radius: var(--radius-sm); font-size: 15px; }
input, select { min-height: 50px; }
.primary-button, .outline-button, .danger-button { min-height: 48px; padding: 11px 19px; border-radius: var(--radius-sm); font-size: 12px; }
.login-hint { padding: 14px; border-radius: var(--radius-sm); font-size: 13px; }
.back-link, .form-message { font-size: 13px; }

.sidebar { padding: 34px 22px; }
.admin-nav { gap: 7px; }
.admin-nav button { min-height: 52px; padding: 15px 14px; border-radius: var(--radius-sm); }
.admin-nav button b { font-size: 13px; }
.admin-nav button span { font-size: 13px; }
.sidebar-bottom a, .sidebar-bottom button { font-size: 13px; }
.admin-main { padding: 40px; }
.admin-topbar p, .panel-heading p, .editor-heading p, .panel-kicker { font-size: 10px; }
.admin-topbar h1 { font-size: 48px; }

.stats-grid { gap: 14px; }
.stat-card { min-height: 145px; padding: 23px; border-radius: var(--radius-md); }
.stat-card span { font-size: 10px; }
.stat-card strong { font-size: 37px; }
.dashboard-grid, .split-layout, .tools-grid { gap: 24px; }
.panel, .editor-form { padding: 28px; border-radius: var(--radius-md); }
.panel-heading h2, .editor-heading h2, .tool-card h2 { font-size: 33px; }
.bar-row { grid-template-columns: 145px 1fr 65px; font-size: 13px; }
.bar-track { height: 11px; border-radius: 999px; }
.activity-item { padding: 15px 0; grid-template-columns: 38px 1fr; gap: 12px; }
.activity-icon { width: 36px; height: 36px; }
.activity-item p { font-size: 13px; }
.activity-item small { font-size: 12px; }

.table-search { min-width: 300px; }
th, td { padding: 15px 12px; font-size: 13px; }
th { font-size: 10px; }
.table-profile img { width: 50px; height: 64px; border-radius: 8px; }
.table-profile small { font-size: 12px; }
.status-pill, .visibility-pill, .hot-pill { padding: 6px 9px; border-radius: 999px; font-size: 10px; }
.row-actions { gap: 7px; }
.row-actions button { min-height: 36px; padding: 8px 10px; border-radius: 8px; font-size: 11px; }

.editor-heading { padding: 29px; }
.form-section { padding: 30px; }
.form-section h3 { font-size: 24px; }
.form-grid { gap: 18px; }
.check-label span { font-size: 13px; }
.form-actions { padding: 25px 29px; }
.gallery-preview { gap: 10px; }
.gallery-preview figure { overflow: hidden; border-radius: var(--radius-sm); }
.upload-progress { font-size: 13px; }
.contact-admin-list { gap: 13px; }
.contact-admin-item { padding: 18px; border-radius: var(--radius-sm); }
.contact-admin-item h3 { font-size: 16px; }
.contact-admin-item p { font-size: 13px; }
.tool-card { padding: 38px; border-radius: var(--radius-md); }
.tool-card p:not(.panel-kicker) { font-size: 15px; }
.file-drop { border-radius: var(--radius-sm); }
.admin-toast { max-width: 390px; padding: 16px 20px; border-radius: var(--radius-sm); font-size: 13px; }

@media (max-width: 1320px) {
  .stats-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 960px) {
  .sidebar { padding: 20px; }
  .admin-nav button span { font-size: 13px; }
  .admin-main { padding: 22px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .admin-topbar h1 { font-size: 39px; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 125px; padding: 18px; }
  .stat-card strong { font-size: 32px; }
  .panel, .form-section { padding: 19px; }
  .panel-heading h2, .editor-heading h2, .tool-card h2 { font-size: 29px; }
  .bar-row { grid-template-columns: 100px 1fr 48px; font-size: 12px; }
  .login-card { padding: 36px 24px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 16px; }
  .admin-topbar > div:last-child { display: grid; grid-template-columns: 1fr; }
  .admin-topbar button { width: 100%; }
  .gallery-preview { grid-template-columns: repeat(3,1fr); }
}
