/* ===== Tuấn's Cloud Storage — giao diện kiểu Google Drive ===== */
:root {
  --blue: #1a73e8;
  --blue-hover: #1b66c9;
  --blue-light: #e8f0fe;
  --blue-text: #1967d2;
  --text: #202124;
  --text-2: #5f6368;
  --border: #dadce0;
  --hover: #f1f3f4;
  --hover-2: #e8eaed;
  --bg: #fff;
  --shadow-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --radius: 8px;
  --topbar-h: 64px;
  --sidebar-w: 256px;
  --green: #1e8e3e;
  --red: #d93025;
  --yellow: #f9ab00;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.material-icons { font-size: 20px; vertical-align: middle; line-height: 1; }
.gsans { font-family: "Google Sans", Roboto, Arial, sans-serif; }
.hidden { display: none !important; }

/* ---------- Flash & toast ---------- */
#flash-stack { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 3000; }
.flash {
  background: #323232; color: #fff; padding: 12px 20px; border-radius: 6px;
  margin-bottom: 8px; box-shadow: var(--shadow-2); font-size: 14px;
}
.flash-error { background: var(--red); }
.flash-success { background: var(--green); }
.toast {
  position: fixed; bottom: 24px; left: 24px; background: #323232; color: #fff;
  padding: 14px 20px; border-radius: 6px; font-size: 14px; z-index: 3000;
  box-shadow: var(--shadow-2); opacity: 0; transform: translateY(12px);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 420px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ============ APP LAYOUT (Drive / Admin) ============ */
.app-body { overflow: hidden; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  background: var(--bg); z-index: 100;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px; min-width: 220px;
  font-family: "Google Sans", Roboto, sans-serif; font-size: 20px; color: var(--text-2);
}
.topbar .brand .logo { font-size: 30px; }
.topbar .brand b { color: var(--text); font-weight: 500; }
.search-wrap { flex: 1; max-width: 720px; }
.search-box {
  display: flex; align-items: center; gap: 10px; background: var(--hover);
  border-radius: 8px; padding: 0 14px; height: 48px; transition: background .15s, box-shadow .15s;
}
.search-box:focus-within { background: #fff; box-shadow: var(--shadow-1); }
.search-box .material-icons { color: var(--text-2); }
.search-box input { flex: 1; border: none; background: transparent; outline: none; font-size: 16px; color: var(--text); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border: none; background: transparent; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
}
.icon-btn:hover { background: var(--hover-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 500;
  cursor: pointer; user-select: none; font-size: 16px;
}

.layout { display: flex; height: 100vh; padding-top: var(--topbar-h); }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; padding: 12px 12px 0; display: flex; flex-direction: column; overflow-y: auto; }
.new-btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 0 22px 0 16px; height: 56px;
  border-radius: 16px; border: none; background: #fff; box-shadow: var(--shadow-1);
  font-family: "Google Sans", Roboto, sans-serif; font-size: 14px; font-weight: 500; color: #3c4043;
  margin: 8px 8px 16px; align-self: flex-start;
}
.new-btn:hover { box-shadow: var(--shadow-2); background: #fafafb; }
.new-btn .material-icons { color: var(--blue); font-size: 22px; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav li {
  display: flex; align-items: center; gap: 18px; height: 40px; padding: 0 18px 0 24px;
  border-radius: 0 20px 20px 0; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
}
.nav li:hover { background: var(--hover); }
.nav li.active { background: var(--blue-light); color: var(--blue-text); }
.nav li.active .material-icons { color: var(--blue-text); }
.nav li .material-icons { color: var(--text-2); }
.nav .divider { height: 1px; background: var(--border); margin: 8px 16px; border-radius: 0; }
.nav .label { font-size: 11px; color: var(--text-2); padding: 8px 24px 4px; text-transform: uppercase; letter-spacing: .6px; }

.storage { margin-top: auto; padding: 16px 24px 20px; font-size: 13px; color: var(--text-2); }
.storage .bar { height: 4px; background: var(--hover-2); border-radius: 4px; margin: 8px 0; overflow: hidden; }
.storage .bar > div { height: 100%; background: var(--blue); border-radius: 4px; width: 0; transition: width .4s; }
.storage .bar.full > div { background: var(--red); }
.storage .row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.storage .sys { margin-top: 14px; }
.storage-sub { font-size: 11px; color: var(--text-2); margin-top: 3px; opacity: .85; }

/* ---------- Main panel ---------- */
.main { flex: 1; background: #fff; border-top-left-radius: 16px; border-left: 1px solid var(--hover); margin-left: 0;
  display: flex; flex-direction: column; overflow: hidden; }
.main-inner { background: var(--hover); border-top-left-radius: 16px; margin: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.crumbbar { display: flex; align-items: center; padding: 8px 16px; gap: 4px; }
.crumbs { display: flex; align-items: center; gap: 2px; font-family: "Google Sans", Roboto, sans-serif; font-size: 22px; color: var(--text); flex: 1; flex-wrap: wrap; }
.crumbs .crumb { padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.crumbs .crumb:hover { background: var(--hover-2); }
.crumbs .crumb.current { cursor: default; }
.crumbs .sep { color: var(--text-2); font-size: 20px; }
.view-toggle { display: flex; gap: 2px; }
.content { flex: 1; overflow-y: auto; padding: 8px 16px 40px; }

.section-title { font-size: 14px; font-weight: 500; color: var(--text-2); margin: 12px 6px 8px; }

/* Grid view */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card {
  background: #fff; border: 1px solid transparent; border-radius: 12px; padding: 0; cursor: pointer;
  overflow: hidden; transition: background .1s, box-shadow .1s; position: relative;
}
.card:hover { background: #f0f4f9; }
.card.selected { background: var(--blue-light); border-color: #d2e3fc; }
.card .card-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; }
.card .card-head .ficon { font-size: 20px; }
.card .name { flex: 1; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .thumb {
  height: 140px; margin: 0 12px 12px; border-radius: 8px; background: var(--hover) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--text-2); overflow: hidden;
}
.card .thumb .material-icons { font-size: 56px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .menu-dot { opacity: 0; }
.card:hover .menu-dot, .card.selected .menu-dot { opacity: 1; }
.folder-card .card-head { padding: 14px 8px 14px 16px; }
.folder-card .ficon { color: #5f6368; }

/* List view */
.list { display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden; }
.list .lhead, .list .lrow { display: grid; grid-template-columns: 1fr 160px 120px 48px; align-items: center; gap: 8px; padding: 0 16px; height: 44px; }
.list .lhead { color: var(--text-2); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--hover-2); position: sticky; top: 0; background:#fff; }
.list .lrow { border-bottom: 1px solid #f5f5f5; cursor: pointer; font-size: 14px; }
.list .lrow:hover { background: var(--hover); }
.list .lrow.selected { background: var(--blue-light); }
.list .lrow .nm { display: flex; align-items: center; gap: 14px; overflow: hidden; }
.list .lrow .nm .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .lrow .col-2, .list .lrow .col-3 { color: var(--text-2); font-size: 13px; }
.list .lhead .menu-dot { visibility: hidden; }

.menu-dot { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; display: inline-flex; align-items:center; justify-content:center; color: var(--text-2); }
.menu-dot:hover { background: var(--hover-2); }
.star-on { color: var(--yellow) !important; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 70%; color: var(--text-2); text-align: center; }
.empty .material-icons { font-size: 72px; opacity: .5; margin-bottom: 12px; }
.empty p { margin: 4px 0; font-size: 15px; }

/* ---------- Context menu ---------- */
.ctx-menu {
  position: fixed; background: #fff; border-radius: 8px; box-shadow: var(--shadow-2);
  padding: 8px 0; min-width: 220px; z-index: 2500; font-size: 14px;
}
.ctx-menu .item { display: flex; align-items: center; gap: 16px; padding: 9px 20px; color: var(--text); cursor: pointer; }
.ctx-menu .item:hover { background: var(--hover); }
.ctx-menu .item .material-icons { font-size: 20px; color: var(--text-2); }
.ctx-menu .sep { height: 1px; background: var(--hover-2); margin: 6px 0; }
.ctx-menu .danger { color: var(--red); }
.ctx-menu .danger .material-icons { color: var(--red); }

/* Dropdown (avatar / new) */
.dropdown { position: fixed; background: #fff; border-radius: 8px; box-shadow: var(--shadow-2); padding: 8px 0; min-width: 240px; z-index: 2500; }
.dropdown .item { display: flex; align-items: center; gap: 16px; padding: 11px 20px; font-size: 14px; cursor: pointer; }
.dropdown .item:hover { background: var(--hover); }
.dropdown .item .material-icons { color: var(--text-2); }
.dropdown .sep { height: 1px; background: var(--hover-2); margin: 6px 0; }
.dropdown .acct { padding: 12px 20px; border-bottom: 1px solid var(--hover-2); margin-bottom: 6px; }
.dropdown .acct b { display:block; font-size: 14px; }
.dropdown .acct span { font-size: 12px; color: var(--text-2); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2600; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 8px; box-shadow: var(--shadow-2); width: 440px; max-width: 92vw; overflow: hidden; }
.modal.lg { width: 560px; }
.modal h3 { margin: 0; padding: 22px 24px 8px; font-family: "Google Sans", Roboto, sans-serif; font-weight: 400; font-size: 22px; }
.modal .body { padding: 8px 24px 8px; }
.modal .body p { color: var(--text-2); font-size: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field .hint { font-size: 12px; color: var(--text-2); margin-top: 4px; }

.btn { height: 40px; padding: 0 24px; border-radius: 6px; border: none; font-weight: 500; font-size: 14px; font-family: "Google Sans", Roboto, sans-serif; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); box-shadow: var(--shadow-1); }
.btn-text { background: transparent; color: var(--blue); }
.btn-text:hover { background: var(--blue-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--hover); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* Share link box */
.link-box { display: flex; gap: 8px; align-items: center; background: var(--hover); border-radius: 6px; padding: 8px 8px 8px 14px; }
.link-box input { flex: 1; border: none; background: transparent; font-size: 13px; outline: none; color: var(--text); }
.toggle-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.switch { position: relative; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #bdc1c6; border-radius: 20px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider:before { transform: translateX(16px); }

/* Move dialog folder list */
.folder-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--hover-2); border-radius: 6px; }
.folder-list .frow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; font-size: 14px; }
.folder-list .frow:hover { background: var(--hover); }
.folder-list .frow.sel { background: var(--blue-light); }
.folder-list .frow .material-icons { color: var(--text-2); }

/* ---------- Upload panel (tiến trình chi tiết) ---------- */
.up-panel { position: fixed; right: 24px; bottom: 24px; width: 384px; max-width: 92vw; background: #fff; border-radius: 10px 10px 0 0; box-shadow: var(--shadow-2); z-index: 2400; overflow: hidden; }
.up-panel .up-head { background: #28292b; color: #fff; display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 18px; font-size: 14px; font-family: "Google Sans", Roboto; }
.up-panel .up-head .ttl { flex: 1; }
.up-panel .up-head .material-icons { cursor: pointer; font-size: 20px; opacity: .85; border-radius: 50%; padding: 2px; }
.up-panel .up-head .material-icons:hover { opacity: 1; background: rgba(255,255,255,.12); }
.up-list { max-height: 320px; overflow-y: auto; background: #fff; }
.up-list.collapsed { display: none; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #f1f3f4; }
.up-item:last-child { border-bottom: none; }
.up-icon { flex-shrink: 0; }
.up-body { flex: 1; min-width: 0; }
.up-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-track { position: relative; height: 6px; background: var(--hover-2); border-radius: 4px; margin: 7px 0 5px; overflow: hidden; }
.up-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; transition: width .2s; }
.up-fill.srv { background: #bcd5ff; }            /* lên máy chủ (nhạt, đi trước) */
.up-fill.cloud { background: var(--blue); }      /* lên cloud/Telegram (đậm, theo sau) */
.up-fill.err { background: var(--red) !important; }
.up-meta { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-state { font-size: 20px; flex-shrink: 0; color: var(--text-2); }
.up-state.spin { color: transparent; }
.up-state.spin::after {
  content: ""; width: 15px; height: 15px; box-sizing: border-box;
  border: 2px solid var(--hover-2); border-top-color: var(--blue);
  border-radius: 50%; animation: up-spin .8s linear infinite;
}
.up-state.ok { color: var(--green); }
.up-state.err { color: var(--red); }
.up-state.cancel { color: var(--text-2); }
.up-state.retry { color: var(--yellow); }
.up-state.paused { color: var(--text-2); }
@keyframes up-spin { to { transform: rotate(360deg); } }
/* vùng phải: icon trạng thái + cụm nút (⏸/▶ và ✕) */
.up-right { position: relative; width: 60px; height: 26px; flex-shrink: 0; }
.up-right .up-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; transition: opacity .12s; }
.up-ctrls { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; gap: 1px; opacity: 0; transition: opacity .12s; }
.up-pause, .up-cancel { border: none; background: transparent; border-radius: 50%; color: var(--text-2); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.up-pause .material-icons, .up-cancel .material-icons { font-size: 18px; }
.up-pause:hover, .up-cancel:hover { background: var(--hover-2); }
/* đang tải & hover, hoặc đang tạm dừng -> hiện nút, ẩn icon trạng thái */
.up-item:hover .up-ctrls, .up-item.paused .up-ctrls { opacity: 1; }
.up-item:hover .up-state, .up-item.paused .up-state { opacity: 0; }
/* trạng thái kết thúc -> chỉ hiện icon, ẩn nút (kể cả khi hover) */
.up-item.done .up-ctrls { display: none; }
.up-item.done .up-state { opacity: 1 !important; }
.up-cancelall { font-size: 12px; cursor: pointer; opacity: .85; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.up-cancelall:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* Drag overlay */
.drag-over::after {
  content: "Thả tệp vào đây để tải lên"; position: fixed; inset: var(--topbar-h) 0 0 var(--sidebar-w);
  background: rgba(26,115,232,.08); border: 3px dashed var(--blue); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--blue-text);
  font-family: "Google Sans", Roboto; z-index: 2000; pointer-events: none;
}

/* Preview modal */
.preview-back { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 2700; display: flex; flex-direction: column; }
.preview-top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; color: #fff; }
.preview-top .pname { flex: 1; font-size: 16px; }
.preview-top .icon-btn { color: #fff; }
.preview-top .icon-btn:hover { background: rgba(255,255,255,.15); }
.preview-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 20px; }
.preview-stage img, .preview-stage video { max-width: 92%; max-height: 88%; border-radius: 6px; box-shadow: var(--shadow-2); }
.preview-stage .fallback { color: #fff; text-align: center; }
.preview-stage .fallback .material-icons { font-size: 96px; opacity: .8; }

/* ============ AUTH / SETUP / SHARE ============ */
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f8fafd; padding: 24px; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 40px; width: 420px; max-width: 94vw; box-shadow: var(--shadow-1); }
.auth-card .logo-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 8px; }
.auth-card .logo-row .logo { font-size: 36px; }
.auth-card h1 { font-family: "Google Sans", Roboto; font-weight: 500; font-size: 24px; text-align: center; margin: 4px 0 2px; }
.auth-card .sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.auth-card .field input { padding: 13px 14px; }
.auth-card .btn-primary { width: 100%; margin-top: 8px; height: 44px; }
.setup-card { width: 560px; }
.setup-card .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.copyright { margin-top: 22px; color: var(--text-2); font-size: 12px; text-align: center; }
.err-box { background: #fce8e6; color: #c5221f; padding: 12px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.ok-box { background: #e6f4ea; color: #137333; padding: 12px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.section-card h2 { font-family:"Google Sans",Roboto; font-weight:500; font-size:16px; margin: 0 0 4px; }

/* Share page */
.share-card { width: 480px; text-align: center; }
.share-card .ficon { font-size: 64px; color: var(--blue); }
.share-card .fname { font-size: 18px; font-weight: 500; margin: 10px 0 2px; word-break: break-word; }
.share-card .fsize { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.share-card .btn-primary { width: 100%; height: 46px; }

/* ============ ADMIN ============ */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: calc(var(--topbar-h) + 24px) 28px 60px; width: 100%; }
.admin-wrap h1 { font-family: "Google Sans", Roboto; font-weight: 500; font-size: 26px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin: 20px 0 28px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.stat .k { color: var(--text-2); font-size: 13px; }
.stat .v { font-size: 26px; font-family: "Google Sans", Roboto; font-weight: 500; margin-top: 6px; }
table.users { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table.users th, table.users td { text-align: left; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--hover-2); }
table.users th { color: var(--text-2); font-weight: 500; background: #fafafb; }
table.users tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge.admin { background: var(--blue-light); color: var(--blue-text); }
.badge.user { background: var(--hover-2); color: var(--text-2); }
.badge.on { background: #e6f4ea; color: #137333; }
.badge.off { background: #fce8e6; color: #c5221f; }
.row-actions { display: flex; gap: 4px; }
.mini-bar { height: 5px; width: 110px; background: var(--hover-2); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.mini-bar > div { height: 100%; background: var(--blue); }
.settings-card { background:#fff; border:1px solid var(--border); border-radius:12px; padding: 22px 24px; margin-bottom: 20px; }
.settings-card .head { display:flex; align-items:center; gap:10px; margin-bottom: 6px; }
.settings-card .head .material-icons { color: var(--blue); }
.settings-card .head h2 { margin: 0; }
.status-pill { display:inline-flex; align-items:center; gap:6px; font-size:13px; padding:4px 10px; border-radius: 20px; }
.status-pill.ok { background:#e6f4ea; color:#137333; }
.status-pill.no { background:#fce8e6; color:#c5221f; }
.log-console { background:#1e1e1e; color:#d4d4d4; font-family: ui-monospace, Menlo, Consolas, monospace; font-size:12px; line-height:1.55; padding:12px 14px; border-radius:8px; max-height:340px; overflow:auto; white-space:pre-wrap; word-break:break-word; margin-top:14px; }
.log-console .ok { color:#4ec9b0; }
.log-console .error { color:#f48771; }
.log-console .warn { color:#dcdcaa; }
.log-console .certbot { color:#9cdcfe; }
.log-console .info { color:#d4d4d4; }
.back-link { display:inline-flex; align-items:center; gap:6px; color: var(--text-2); margin-bottom: 8px; font-size: 14px; }

/* nút hamburger & lớp phủ drawer chỉ dùng trên mobile */
.hamburger { display: none; }
.scrim { display: none; }

@media (max-width: 820px) {
  /* ---- topbar gọn lại ---- */
  .topbar { padding: 0 6px; gap: 2px; }
  .hamburger { display: inline-flex; }
  .topbar .brand { min-width: auto; gap: 6px; }
  .topbar .brand .gsans { display: none; }     /* ẩn chữ, giữ logo cloud */
  .topbar a.icon-btn { display: none; }         /* icon admin -> dùng menu avatar */
  .topbar .spacer { display: none; }            /* nhường chỗ cho ô tìm kiếm */
  .search-box { height: 42px; padding: 0 10px; }
  .search-box input { font-size: 15px; }

  /* ---- sidebar -> ngăn kéo trượt từ trái ---- */
  .layout { padding-top: var(--topbar-h); }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: 272px; max-width: 84vw;
    background: #fff; z-index: 200; transform: translateX(-105%);
    transition: transform .25s ease; box-shadow: var(--shadow-2); padding-top: 12px;
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.45);
    z-index: 150; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }

  /* ---- vùng nội dung ---- */
  .main { border-left: none; }
  .main-inner { border-radius: 0; }
  .content { padding: 8px 10px 60px; }
  .crumbs { font-size: 18px; }

  /* menu 3 chấm luôn hiện (cảm ứng không hover được) */
  .card .menu-dot, .card.selected .menu-dot, .lrow .menu-dot { opacity: 1; }

  /* lưới nhỏ hơn */
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .card .thumb { height: 108px; }

  /* danh sách: ẩn cột "Sửa đổi" cho gọn */
  .list .lhead, .list .lrow { grid-template-columns: 1fr 86px 40px; padding: 0 10px; }
  .list .lhead > :nth-child(2), .list .lrow > :nth-child(2) { display: none; }

  /* panel upload full-width, modal & admin gọn */
  .up-panel { right: 6px; left: 6px; width: auto; }
  .modal { width: 94vw; }
  .admin-wrap { padding-left: 12px; padding-right: 12px; }
  .stat-row { gap: 10px; }
  .drag-over::after { left: 0; font-size: 18px; }
}
