/* FileSync — giao diện theo nhận diện thương hiệu Viettel (đỏ #EE0033, Beau Sans Pro / Roboto) */
@font-face { font-family: 'Beau Sans Pro'; src: url('/static/fonts/BeauSansPro-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Beau Sans Pro'; src: url('/static/fonts/BeauSansPro-Semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Beau Sans Pro'; src: url('/static/fonts/BeauSansPro-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --vt-red: #EE0033; --vt-red-hover: #D6002E; --vt-red-active: #BE0029;
  --vt-gray-100: #F2F2F2; --vt-gray-400: #B5B4B4; --vt-gray-600: #44494D; --vt-black: #000; --vt-white: #fff;
  --font-head: 'Beau Sans Pro', Roboto, sans-serif;
  --font-body: Roboto, 'Beau Sans Pro', sans-serif;
  --r: 14px; --header-h: 64px; --side-w: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.6 var(--font-body); color: var(--vt-black); background: var(--vt-gray-100); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; line-height: 1.25; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: var(--vt-red); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--vt-red); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--vt-gray-600); } .small { font-size: 13px; }
.grow { flex: 1; } .row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; }

/* nút */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid transparent; border-radius: 10px; padding: 9px 16px; min-height: 40px;
  font-weight: 500; cursor: pointer; background: var(--vt-white); color: var(--vt-red); border-color: var(--vt-gray-400); transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { border-color: var(--vt-red); background: var(--vt-white); }
.btn.primary { background: var(--vt-red); color: #fff; border-color: var(--vt-red); }
.btn.primary:hover { background: var(--vt-red-hover); border-color: var(--vt-red-hover); }
.btn.primary:active { background: var(--vt-red-active); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--vt-gray-600); padding: 8px; min-width: 40px; justify-content: center; }
.btn.ghost:hover { background: var(--vt-gray-100); color: var(--vt-red); }
.btn.danger { color: var(--vt-red-active); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { min-height: 34px; padding: 5px 12px; font-size: 14px; }
a.btn { text-decoration: none; } a.btn.primary:hover { text-decoration: none; }

/* form */
label.f { display: block; margin-bottom: 14px; font-weight: 500; color: var(--vt-gray-600); font-size: 14px; }
label.f > span.hint { display: block; font-weight: 400; font-size: 12.5px; color: var(--vt-gray-600); opacity: .85; margin-top: 2px; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; margin-top: 5px; padding: 10px 12px; min-height: 42px; border: 1.5px solid var(--vt-gray-400); border-radius: 10px; background: #fff; color: #000; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--vt-red); }
input[type=checkbox], input[type=radio] { accent-color: var(--vt-red); width: 18px; height: 18px; margin: 0; }
.chk { display: flex; align-items: center; gap: 10px; font-weight: 400; color: #000; cursor: pointer; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } .grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 16px; }
.err { color: var(--vt-red-active); font-weight: 500; display: flex; gap: 8px; align-items: center; margin: 8px 0; }

/* bố cục */
#app { min-height: 100%; display: flex; flex-direction: column; }
header.top { height: var(--header-h); background: #fff; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--vt-gray-100); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 19px; color: #000; }
.brand img { height: 28px; width: auto; display: block; }
.brand .sep { width: 1px; height: 24px; background: var(--vt-gray-400); }
.shell { display: flex; flex: 1; min-height: 0; }
nav.side { width: var(--side-w); background: #fff; padding: 16px 12px; flex: none; border-right: 1px solid var(--vt-gray-100); position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); }
nav.side a, nav.bottom a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--vt-gray-600); font-weight: 500; text-decoration: none; position: relative; }
nav.side a:hover { background: var(--vt-gray-100); }
nav.side a.on { color: var(--vt-red); background: var(--vt-gray-100); }
nav.side a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--vt-red); }
nav.bottom { display: none; }
main { flex: 1; padding: 24px; min-width: 0; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card { background: #fff; border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.card > h3 { margin-bottom: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: #fff; border-radius: var(--r); padding: 18px 20px; position: relative; overflow: hidden; }
.tile .k { color: var(--vt-gray-600); font-size: 13.5px; }
.tile .v { font: 700 30px/1.2 var(--font-head); margin-top: 4px; }
.tile.hot { background: var(--vt-red); color: #fff; } .tile.hot .k { color: #fff; }

/* trạng thái (chỉ dùng màu nhận diện) */
.st { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: 14px; }
.st i { width: 10px; height: 10px; border-radius: 50%; background: var(--vt-gray-600); display: inline-block; }
.st.off { color: var(--vt-gray-600); } .st.off i { background: #fff; border: 2px solid var(--vt-gray-400); }
.st.err { color: var(--vt-red-active); } .st.err i { background: var(--vt-red); }
.st.on i { box-shadow: 0 0 0 3px rgba(68, 73, 77, .18); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--vt-gray-100); color: var(--vt-gray-600); font-size: 12.5px; font-weight: 500; }
.chip.red { background: var(--vt-red); color: #fff; }

/* explorer */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 500; }
.crumbs button { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--vt-gray-600); }
.crumbs button:hover { background: var(--vt-gray-100); color: var(--vt-red); } .crumbs .cur { color: #000; padding: 4px 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select { width: auto; margin: 0; min-width: 160px; } .toolbar input[type=text] { margin: 0; width: 220px; }
.files { background: #fff; border-radius: var(--r); overflow: hidden; }
.frow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 110px 150px 84px; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--vt-gray-100); }
.frow:last-child { border-bottom: 0; }
.frow.head { color: var(--vt-gray-600); font-size: 13px; font-weight: 500; background: #fff; }
.frow:not(.head):hover { background: #fafafa; } .frow.sel { background: var(--vt-gray-100); }
.fname { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname svg { color: var(--vt-gray-600); } .fname.dir svg { color: var(--vt-red); } .fname:hover span { color: var(--vt-red); }
.empty { padding: 48px 20px; text-align: center; color: var(--vt-gray-600); }
.drop { position: fixed; inset: 0; background: rgba(238, 0, 51, .92); color: #fff; z-index: 60; display: grid; place-items: center; font: 700 28px var(--font-head); }

/* bảng & nhật ký */
.table { width: 100%; border-collapse: collapse; } .table th { text-align: left; font-weight: 500; color: var(--vt-gray-600); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--vt-gray-100); }
.table td { padding: 10px; border-bottom: 1px solid var(--vt-gray-100); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; }
.log { font: 13px/1.5 Roboto, monospace; max-height: 420px; overflow: auto; }
.log div { padding: 5px 0; border-bottom: 1px solid var(--vt-gray-100); display: flex; gap: 12px; } .log .t { color: var(--vt-gray-600); flex: none; width: 70px; }
.log .warn { color: var(--vt-gray-600); font-weight: 500; } .log .error { color: var(--vt-red-active); font-weight: 500; }
.agent { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; }
.agent .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
pre.code { background: var(--vt-gray-600); color: #F2F2F2; padding: 14px; border-radius: 10px; overflow: auto; font-size: 13px; max-height: 260px; margin: 8px 0; user-select: all; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--vt-gray-600); color: #fff; padding: 11px 16px; border-radius: 10px; max-width: 360px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--vt-red); }
.bar { height: 6px; background: var(--vt-gray-100); border-radius: 4px; overflow: hidden; margin-top: 8px; } .bar > i { display: block; height: 100%; background: var(--vt-red); width: 0; transition: width .2s; }

/* đăng nhập: nền đỏ + hoạ tiết mảng + 1 khung hội thoại nghiêng 20° */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #fff; }
.login .hero { background: var(--vt-red); position: relative; overflow: hidden; display: grid; place-items: center; color: #fff; padding: 40px; }
.login .hero::before { content: ""; position: absolute; inset: 0; opacity: .1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cpath fill='%23fff' d='M20 12h40c8 0 14 6 14 14v24c0 8-6 14-14 14H36c-4 0-7 2-10 5l-8 8c1-6 1-9-1-12-4-2-6-6-6-11V26c0-8 6-14 14-14Z'/%3E%3C/svg%3E"); background-size: 96px; }
.frame { position: relative; width: min(440px, 80%); aspect-ratio: 1; transform: rotate(20deg); margin-right: -40px; }
.frame svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.frame .fill { fill: #fff; } .frame .stroke { fill: none; stroke: #fff; stroke-width: 2.5; }
.frame .txt { position: absolute; left: 14%; right: 24%; top: 22%; bottom: 36%; display: flex; flex-direction: column; justify-content: center; color: var(--vt-red); }
.frame .txt b { font: 700 clamp(26px, 3.4vw, 40px)/1.15 var(--font-head); } .frame .txt span { margin-top: 10px; font-size: 15px; color: var(--vt-gray-600); }
.login .form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); }
.login .form .brand { margin-bottom: 36px; } .login form { max-width: 380px; }

@media (max-width: 900px) {
  nav.side { display: none; }
  nav.bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--vt-gray-100); z-index: 30; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  nav.bottom a { flex: 1; flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 2px; text-align: center; }
  nav.bottom a.on { color: var(--vt-red); }
  main { padding: 16px 16px 92px; }
  header.top { padding: 0 16px; } #who { display: none; }
  .dl-agent .dl-label { display: none; } .dl-agent { padding: 8px 10px; min-width: 40px; justify-content: center; }
  .frow { grid-template-columns: 30px minmax(0, 1fr) 40px; padding: 10px 12px; } .frow .c-size, .frow .c-time { display: none; } .frow.head { display: none; }
  .frow .sub { display: block; }
  .login { grid-template-columns: 1fr; } .login .hero { min-height: 260px; padding: 28px; } .frame { width: 200px; margin: 0; } .frame .txt b { font-size: 20px; } .frame .txt span { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .toolbar input[type=text] { width: 100%; flex: 1; } .agent { grid-template-columns: 1fr; }
  .toasts { bottom: 80px; left: 16px; right: 16px; } .toast { max-width: none; }
}
.frow .sub { display: none; font-size: 12.5px; color: var(--vt-gray-600); }
