:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131414;
  --bg-2: #191a1a;
  --panel: #1f201f;
  --panel-2: #272827;
  --panel-3: #313231;
  --line: #353635;
  --line-soft: #242524;
  --text: #edeeea;
  --muted: #9a9d94;
  --muted-2: #6d6f68;
  --brand: #69804a;          /* olive (tối hơn 1 chút) */
  --brand-600: #76904f;      /* hover */
  --brand-700: #54693a;
  --brand-200: #a6c081;      /* xanh nhạt cho chữ/icon nhấn */
  --brand-soft: rgba(125, 149, 85, .16);
  --cream: #ead9b5;
  --green: #8fb46e;
  --green-soft: rgba(143, 180, 110, .16);
  --blue: #6fb3c9;
  --blue-soft: rgba(111, 179, 201, .14);
  --amber: #d7b25a;
  --amber-soft: rgba(215, 178, 90, .16);
  --teal: #6fbfa3;
  --teal-soft: rgba(111, 191, 163, .14);
  --pink: #c98f63;           /* nhấn ấm (chọn ảnh) hợp tông kem */
  --red: #d96b5e;
  --slate: #9aa68c;
  --slate-soft: rgba(154, 166, 140, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .3);
  --radius: 14px;
  --radius-lg: 20px;
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f4;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f4f5f2;
  --panel-3: #eaece7;
  --line: #e3e6e0;
  --line-soft: #eef0ec;
  --text: #1f2418;
  --muted: #5f6857;
  --muted-2: #8b9282;
  --brand: #6d8150;          /* olive đậm hơn cho nền sáng */
  --brand-600: #5c6e43;      /* hover tối hơn */
  --brand-700: #4d5c38;
  --brand-200: #4d5c38;
  --brand-soft: rgba(109, 128, 80, .14);
  --cream: #ead9b5;
  --green: #5e7d3e;
  --green-soft: rgba(94, 125, 62, .14);
  --blue: #3f7e93;
  --blue-soft: rgba(63, 126, 147, .12);
  --amber: #a9802f;
  --amber-soft: rgba(169, 128, 47, .14);
  --teal: #3f8c72;
  --teal-soft: rgba(63, 140, 114, .12);
  --pink: #b5703f;
  --red: #c0503f;
  --slate: #6e7860;
  --slate-soft: rgba(110, 120, 96, .12);
  --shadow: 0 16px 44px rgba(80, 70, 40, .16);
  --shadow-sm: 0 6px 16px rgba(80, 70, 40, .1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; font-family: inherit; color: inherit; }
::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ============ Theme toggle ============ */
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px;
  cursor: pointer; font-weight: 600; font-size: 14px;
  transition: background .18s, border-color .18s, transform .12s, opacity .18s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--muted-2); background: var(--panel-3); }
.btn.soft { background: var(--brand-soft); color: var(--brand-200); border-color: rgba(125,149,85,.25); }
.btn.soft:hover { background: rgba(125,149,85,.22); }
.btn.danger { background: rgba(244,63,94,.12); color: #fb7185; border-color: rgba(244,63,94,.25); }
.btn.danger:hover { background: rgba(244,63,94,.2); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.on { background: var(--brand); color: #fff; border-color: transparent; }

.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; color: var(--muted);
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); border-color: var(--muted-2); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Inputs ============ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted-2); line-height: 1.4; }
.opt { font-size: 11px; font-weight: 500; color: var(--muted-2); }
input, textarea, select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  outline: none; color: var(--text); transition: border-color .18s, box-shadow .18s;
}
input, select { height: 44px; padding: 0 14px; }
textarea { padding: 12px 14px; min-height: 90px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%238b93a1' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}

/* segmented */
.seg { display: inline-flex; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.active { background: var(--brand); color: #fff; }

/* toggle */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: var(--line); transition: background .18s; position: relative; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* ============ Login ============ */
.screen { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(125,149,85,.18), transparent 55%),
    radial-gradient(700px 500px at 100% 110%, rgba(56,189,248,.10), transparent 55%),
    var(--bg);
}
.login-card { width: min(420px, 100%); padding: 36px 32px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .logo { width: 46px; height: 46px; border-radius: 13px; flex: none; }
.login-brand strong { display: block; font-size: 17px; font-weight: 800; }
.login-brand small { color: var(--muted); font-size: 12.5px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.login-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.login-card .field + .field { margin-top: 14px; }
.login-card .btn { margin-top: 20px; }
.login-note { margin-top: 16px; font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.5; }
.spinner { width: 42px; height: 42px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ App shell ============ */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; padding: 22px 16px;
  background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px;
}
img.logo { object-fit: contain; background: #efece5; padding: 2px; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.sb-brand .logo { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.sb-brand strong { font-size: 15px; font-weight: 800; line-height: 1.1; }
.sb-brand small { font-size: 11px; color: var(--muted); }
.sb-nav { display: flex; flex-direction: column; gap: 3px; }
.sb-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px;
  color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, color .15s;
}
.sb-nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-nav a:hover { background: var(--panel-2); color: var(--text); }
.sb-nav a.active { background: var(--panel-3); color: var(--text); }
.sb-nav a .sb-badge { margin-left: auto; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; display: inline-grid; place-items: center; }
.sb-foot { margin-top: auto; }
/* Thẻ thùng rác */
.tcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; opacity: .9; }
.tcard .acard-cover { filter: grayscale(.4) brightness(.8); }
.tcard-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tcard-body strong { font-size: 15.5px; }
.tcard-body small { color: var(--muted); font-size: 12.5px; }
.tcard-acts { display: flex; gap: 8px; margin-top: 4px; }
.tcard-acts .btn { flex: 1; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.sb-user .av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex: none; }
.sb-user .meta { overflow: hidden; }
.sb-user .meta strong { display: block; font-size: 13px; }
.sb-user .meta small { font-size: 11px; color: var(--muted); }
.sb-user button { margin-left: auto; }

.app-main { padding: 28px clamp(20px, 3vw, 40px) 60px; min-width: 0; }
.page { display: none; }
.page.active { display: block; animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Page header ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 640px; }
.badge-private { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-200); }
.badge-private svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ============ Filter bar ============ */
.toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 22px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.filter-chip:hover { color: var(--text); border-color: var(--muted-2); }
.filter-chip.active { background: var(--brand); color: #fff; border-color: transparent; }
.filter-chip .cnt { opacity: .85; }
.filters .sort { margin-left: auto; }
.toolbar .tip { margin: 13px 2px 0; font-size: 12.5px; color: var(--muted-2); }

/* ============ Albums grid ============ */
.section-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.section-card > h2 { margin: 0 0 18px; font-size: 16px; font-weight: 700; }
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.section-head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-head-row h2 { margin: 0; }
.section-head-row .grow { flex: 1; }
/* Albums dạng danh sách */
.albums-grid.listv { display: flex; flex-direction: column; gap: 10px; }
.albums-grid.listv .acard { flex-direction: row; align-items: stretch; }
.albums-grid.listv .acard-cover { width: 120px; flex: none; padding-top: 0; }
.albums-grid.listv .acard-body { flex: 1; min-width: 0; }
/* Tiến độ dạng thẻ */
.prog-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.prog-cards .prog-row { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; }
.prog-cards .prog-row .pf { display: flex; flex-direction: column; gap: 5px; }
.prog-cards .prog-row .pf::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted-2); font-weight: 700; }
.prog-cards .prog-row .pf input, .prog-cards .prog-row .pf select { width: 100%; height: 44px; }
.prog-cards .prog-row .dl-cell { width: 100%; }
.prog-cards .prog-row .lnk { width: 100%; height: 44px; border-radius: 10px; }
.prog-cards .prog-row .lnk::after { content: "Copy link gửi khách"; font-size: 13px; font-weight: 600; margin-left: 8px; }

.acard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .18s, transform .18s; }
.acard:hover { border-color: #353b47; transform: translateY(-2px); }
.acard-cover { position: relative; padding-top: 62.5%; background: var(--panel-2); overflow: hidden; cursor: pointer; }
.acard-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acard-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); font-size: 34px; }
.acard-title { cursor: pointer; }
.acard-title:hover { color: var(--brand-200); }
.acard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.acard-top { display: flex; align-items: center; gap: 8px; }
.acard-top .icon-btn { width: 34px; height: 34px; }
.acard-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.acard-client { font-size: 13px; color: var(--muted); margin-top: -4px; }
.acard-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--panel-3); border: 1px solid var(--line); font-size: 12px; color: var(--muted); cursor: pointer; }
.tag-link:hover { color: var(--text); border-color: var(--muted-2); }
.tag-link svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tag-link.add { color: var(--brand-200); border-color: rgba(125,149,85,.25); background: var(--brand-soft); }

.acard-progress { }
.acard-progress .lab { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.acard-progress .lab .edit { margin-left: 2px; cursor: pointer; color: var(--muted-2); }
.acard-progress .lab .edit:hover { color: var(--text); }
.bar { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--red)); transition: width .3s; }
.acard-foot { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 11px; }

/* status pill + dropdown */
.status { position: relative; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.st-draft { color: var(--slate); background: var(--slate-soft); }
.st-waiting { color: var(--blue); background: var(--blue-soft); }
.st-choosing { color: var(--amber); background: var(--amber-soft); }
.st-done { color: var(--green); background: var(--green-soft); }
.st-editing { color: var(--brand-200); background: var(--brand-soft); }
.st-ready { color: var(--teal); background: var(--teal-soft); }
.st-delivered { color: var(--green); background: var(--green-soft); }
.status-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 190px; padding: 6px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.status-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); text-align: left; }
.status-menu button:hover { background: var(--panel-2); }
.status-menu .dot { width: 8px; height: 8px; border-radius: 50%; }

/* card "..." menu */
.acard-top .grow { flex: 1; }
.popmenu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 170px; padding: 6px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.popmenu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); text-align: left; }
.popmenu button:hover { background: var(--panel-2); }
.popmenu button.danger { color: #fb7185; }
.popmenu svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* empty state */
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .ico { font-size: 42px; }
.empty strong { font-size: 17px; color: var(--text); }

/* placeholder page */
.placeholder { display: grid; place-items: center; gap: 12px; text-align: center; padding: 90px 20px; color: var(--muted); }
.placeholder .ico { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-200); }
.placeholder .ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.placeholder strong { font-size: 18px; color: var(--text); }

/* ============ Tiến độ hậu kỳ ============ */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; font-weight: 600; font-size: 14px; }
.banner svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.banner.alert { background: rgba(217,107,94,.14); border: 1px solid rgba(217,107,94,.35); color: var(--red); }
.banner.ok { background: var(--green-soft); border: 1px solid var(--line); color: var(--text); }
.banner.ok svg { color: var(--green); }

.prog-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.prog-tools select { width: auto; height: 40px; }
.prog-tools input[type="date"] { width: auto; height: 40px; }
.prog-head, .prog-row { display: grid; grid-template-columns: 2fr 1.2fr 1.4fr 1.5fr 1.3fr 44px; gap: 14px; align-items: center; }
.prog-row .who { cursor: pointer; min-width: 0; }
.prog-row .who:hover strong { color: var(--brand-200); }
.prog-head { padding: 0 14px 12px; font-size: 12px; color: var(--muted-2); font-weight: 700; border-bottom: 1px solid var(--line); }
.prog-row { padding: 14px; border-bottom: 1px solid var(--line-soft); border-radius: 12px; transition: background .15s; }
.prog-row:last-child { border-bottom: 0; }
.prog-row:hover { background: var(--panel-2); }
.prog-row .who strong { display: block; font-size: 14.5px; }
.prog-row .who small { color: var(--muted); font-size: 12.5px; }
.prog-row .pf { display: block; min-width: 0; }
.prog-row .pf::before { display: none; }      /* nhãn ẩn trên desktop */
.prog-row input[type="date"], .prog-row input[type="number"] { height: 38px; padding: 0 10px; font-size: 13px; }
.prog-row select { height: 38px; padding: 0 30px 0 12px; font-size: 13px; }
.prog-row .lnk { justify-self: center; }
.dl-cell { display: flex; flex-direction: column; gap: 4px; }
.dl-cell small { color: var(--muted-2); font-size: 11.5px; }

.deadline-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.deadline-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dl-over { color: #fb7185; background: rgba(244,63,94,.14); animation: pulseRed 1.6s ease-in-out infinite; }
.dl-soon { color: var(--amber); background: var(--amber-soft); }
.dl-ok { color: var(--green); background: var(--green-soft); }
.dl-none { color: var(--muted); background: var(--panel-3); }
@keyframes pulseRed { 0%,100% { box-shadow: 0 0 0 0 rgba(244,63,94,.0); } 50% { box-shadow: 0 0 0 5px rgba(244,63,94,.16); } }

@media (max-width: 760px) {
  .prog-tools select, .prog-tools input[type="date"] { flex: 1; min-width: 130px; }
  .prog-head { display: none; }
  .prog-row { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; background: var(--panel-2); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; }
  .prog-row .pf { display: flex; flex-direction: column; gap: 5px; }
  .prog-row .pf::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted-2); font-weight: 700; }
  .prog-row .pf input, .prog-row .pf select { width: 100%; height: 44px; }
  .prog-row .dl-cell { width: 100%; }
  .prog-row .deadline-badge { width: fit-content; }
  .prog-row .lnk { width: 100%; height: 44px; border-radius: 10px; }
  .prog-row .lnk::after { content: "Copy link gửi khách"; font-size: 13px; font-weight: 600; margin-left: 8px; }
}

/* ============ Chi tiết album ============ */
.detail-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-top .grow { flex: 1; }
.detail-top .detail-title strong { display: block; font-size: 18px; font-weight: 800; }
.detail-top .detail-title small { color: var(--muted); font-size: 12.5px; }
.detail-body { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.detail-side { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; position: sticky; top: 20px; }
.side-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .08em; color: var(--muted-2); font-weight: 700; margin: 4px 6px 10px; }
.add-set { background: none; border: 0; color: var(--brand-200); font-weight: 700; font-size: 12px; cursor: pointer; letter-spacing: 0; }
.add-set:hover { color: #cdbcff; }
.cover-box { position: relative; border-radius: 14px; overflow: hidden; margin-bottom: 16px; padding-top: 66.6%; background: var(--panel-2); border: 1px solid var(--line); }
.cover-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-change { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(0,0,0,.4); color: #fff; border: 0; cursor: pointer; opacity: 0; transition: opacity .15s; font-weight: 600; font-size: 13px; }
.cover-box:hover .cover-change, .cover-change.show { opacity: 1; }
.cover-change svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
/* popup đổi ảnh bìa */
.cover-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.cover-pick-grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .1s; }
.cover-pick-grid img:hover { border-color: var(--brand); transform: scale(1.03); }
.crop-frame { width: 100%; max-width: 460px; margin: 0 auto; aspect-ratio: 16/10; border-radius: 12px; background-size: cover; background-position: 50% 50%; background-repeat: no-repeat; cursor: grab; border: 1px solid var(--line); touch-action: none; user-select: none; }
.crop-frame:active { cursor: grabbing; }
/* nút phụ trong set row (rename/xoá) */
.set-edit, .set-del { flex: none; width: 26px; height: 26px; border-radius: 6px; border: 0; cursor: pointer; background: var(--panel-2); color: var(--muted); display: grid; place-items: center; }
.set-item:hover .set-edit, .set-item:hover .set-del { background: var(--panel); }
.set-edit:hover { background: var(--brand) !important; color: #fff; }
.set-del:hover { background: #c0503f !important; color: #fff; }
.set-edit svg, .set-del svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Banner ảnh bìa cho khách — bo góc, thẳng lề với lưới ảnh */
.client-cover { position: relative; width: 100%; height: min(46vh, 440px); overflow: hidden; border-radius: 18px; margin: 4px 0 18px; }
.client-cover img { width: 100%; height: 100%; object-fit: cover; display: block; animation: coverIn 1s ease both; }
@keyframes coverIn { from { transform: scale(1.06); } to { transform: scale(1); } }
.cover-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,14,.25) 0%, transparent 30%, rgba(10,11,14,.5) 75%, rgba(10,11,14,.92) 100%); }
.cover-info { position: absolute; left: clamp(18px, 4vw, 56px); bottom: clamp(22px, 4vw, 48px); z-index: 1; max-width: 80%; }
.cover-info h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 60px); font-weight: 800; line-height: 1.05; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.cover-stats { display: flex; flex-direction: column; gap: 2px; color: rgba(255,255,255,.82); font-size: 15px; }
.cover-stats #cc-sel { color: #fff; font-weight: 700; }
.cover-guide { position: absolute; right: clamp(18px, 4vw, 48px); bottom: clamp(22px, 4vw, 48px); z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px; border: 0; cursor: pointer; background: rgba(0,0,0,.45); color: #fff; font-weight: 600; font-size: 14px; backdrop-filter: blur(8px); transition: background .15s, transform .1s; }
.cover-guide:hover { background: rgba(0,0,0,.65); }
.cover-guide:active { transform: scale(.96); }
.cover-guide svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.set-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px 9px 12px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.set-item:hover { background: var(--panel-2); color: var(--text); }
.set-item.active { background: var(--panel-3); color: var(--text); }
.set-item .set-label { flex: 1; min-width: 0; }
.set-item .cnt { font-size: 12px; color: var(--muted-2); background: var(--bg-2); padding: 2px 9px; border-radius: 99px; flex: none; }
.set-item.active .cnt { color: var(--text); }
.set-dl { flex: none; width: 28px; height: 28px; border-radius: 7px; border: 0; background: var(--panel-3); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s; }
.set-item:hover .set-dl { background: var(--panel); }
.set-dl:hover { background: var(--brand) !important; color: #fff; }
.set-dl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.detail-main { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
.detail-grid-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-grid-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.detail-grid-head .grow { flex: 1; }
.seg.mini { padding: 3px; gap: 2px; }
.seg.mini button { padding: 6px 10px; display: grid; place-items: center; }
.seg.mini svg { display: block; }

/* List view */
.detail-grid.list-view { display: flex; flex-direction: column; gap: 6px; }
.drow { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; transition: border-color .15s; }
.drow:hover { border-color: var(--muted-2); }
.drow.sel { border-color: var(--pink); }
.drow img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; flex: none; }
.drow .nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .ext { font-size: 10px; font-weight: 700; color: var(--muted-2); background: var(--bg-2); padding: 2px 7px; border-radius: 6px; flex: none; }
.drow .hrt { color: var(--pink); flex: none; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.dthumb { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; transition: transform .12s, border-color .15s; }
.dthumb:hover { transform: translateY(-2px); border-color: var(--muted-2); }
.dthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dthumb.sel { border-color: var(--pink); }
.dthumb.picking { outline: 2px dashed var(--brand); outline-offset: 2px; cursor: copy; }
.dtag { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.6); font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #fff; }
.dheart { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--pink); display: grid; place-items: center; font-size: 12px; color: #fff; }
@media (max-width: 760px) { .detail-body { grid-template-columns: 1fr; } .detail-side { position: static; } }

/* ============ Modal ============ */
.modal { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 24px; background: rgba(0,0,0,.6); backdrop-filter: blur(5px); }
.modal.open { display: grid; }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.modal-card.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--panel); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ============ Client picker ============ */
.client-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px clamp(16px,4vw,40px); background: var(--bg-2); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.client-top .logo { width: 34px; height: 34px; border-radius: 10px; }
.client-top strong { font-size: 15px; font-weight: 800; }
.client-top small { display: block; color: var(--muted); font-size: 12px; }
.client-wrap { width: min(1200px, 100%); margin: 0 auto; padding: 26px clamp(16px,4vw,40px) 80px; }
.client-intro h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; }
.client-intro p { margin: 0; color: var(--muted); }

/* toolbar */
.cbar { position: sticky; top: 64px; z-index: 20; display: flex; flex-direction: column; gap: 12px; margin: 18px 0 10px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(12px); transition: transform .28s ease, opacity .28s ease; }
.cbar.hide { transform: translateY(-130%); opacity: 0; pointer-events: none; }
.cbar .grow { flex: 1; }
.ctabs { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; flex: none; transition: background .15s, color .15s; }
.ctab:hover { color: var(--text); }
.ctab.active { background: var(--brand); color: #fff; border-color: transparent; }
.ctab .cn { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.12); }
.ctab.active .cn { background: rgba(255,255,255,.25); }
.ctab:active, .cfolder:active, .icon-btn:active { transform: scale(.95); }
.icon-btn, .ctab, .cfolder { transition: background .15s, color .15s, border-color .15s, transform .1s ease; }
.cbar-row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cbar-desc { margin: 0; color: var(--muted-2); font-size: 13px; }
.cbar-row3 { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.cpager { display: inline-flex; align-items: center; gap: 8px; }
.cpager #cpage-cur { min-width: 76px; text-align: center; font-weight: 600; color: var(--text); }
.cpager .icon-btn { width: 32px; height: 32px; }
.cmeta { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cmeta .cprogress { width: 160px; }
.count-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-200); font-weight: 800; font-size: 13px; white-space: nowrap; }
.count-pill b { font-size: 16px; }
.cprogress { width: 120px; height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.cprogress > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-200)); transition: width .3s; }
#cl-sort { font-size: 11px; font-weight: 800; letter-spacing: .02em; }

/* hàng công cụ xem (tải / sắp xếp / Masonry · List) */
.viewbar { display: flex; align-items: center; gap: 8px; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); }
.viewbar .grow { flex: 1; }
.viewbar .seg { flex: none; }
.viewbar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.viewbar .seg svg { fill: none; stroke: currentColor; stroke-width: 2; }

/* folder tabs kiểu gạch chân */
.cfolders { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.cfolders::-webkit-scrollbar { display: none; }
.cfolder { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; flex: none; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.cfolder:hover { color: var(--text); }
.cfolder.active { color: var(--text); border-bottom-color: var(--brand); }
.cfolder .fn { font-size: 11px; font-weight: 800; color: var(--muted-2); background: var(--panel-3); padding: 2px 8px; border-radius: 99px; }
.cfolder.active .fn { color: var(--brand-200); background: var(--brand-soft); }
.cfolder .fdl { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--muted); }
.cfolder .fdl:hover { background: var(--brand); color: #fff; }
.cfolder .fdl svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }

.cinfo { margin: 0 2px 14px; color: var(--muted-2); font-size: 13px; }
.grid-empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 15px; }
/* fade khi đổi trang/lọc/chế độ xem */
#photo-grid { animation: gridFade .25s ease; }
@keyframes gridFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Lưới ảnh — 3 chế độ ===== */
.pcard { position: relative; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1.5px solid transparent; transition: border-color .2s ease, box-shadow .2s ease; }
.pcard > img { width: 100%; height: auto; display: block; cursor: zoom-in; object-fit: cover; background: var(--panel); opacity: 0; transition: opacity .4s ease; }
.pcard > img.loaded { opacity: 1; }
.pcard.skel > img { min-height: 120px; }
.pcard.skel { background: linear-gradient(100deg, var(--panel) 28%, var(--panel-3) 50%, var(--panel) 72%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pcard.s-selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pcard.s-later { border-color: var(--amber); }
.pcard.s-skipped { opacity: .55; }

/* thanh điều khiển: tên 60% · Chọn 30% · ⋯ 10% */
.pbar { display: flex; align-items: center; gap: 5px; padding: 6px 7px; background: var(--panel-2); }
.pbar .fname { flex: 6; min-width: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .choosebtn { flex: 3; min-width: 0; padding: 7px 4px; border: 0; border-radius: 7px; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; transition: background .15s, transform .1s; }
.pbar .choosebtn:active { transform: scale(.94); }
.pbar .choosebtn.on { background: #22c55e; }
.pbar .choosebtn.pop { animation: chosePop .3s ease; }
.pmore { flex: 1; position: relative; display: flex; justify-content: flex-end; }
.more-btn { width: 28px; height: 28px; flex: none; border: 0; border-radius: 7px; background: var(--panel-3); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .1s; }
.more-btn:hover { background: var(--line); color: var(--text); }
.more-btn:active { transform: scale(.9); }
.more-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.pmenu { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 20; min-width: 150px; padding: 5px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.pmenu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); text-align: left; }
.pmenu button:hover { background: var(--panel-2); }
.pmenu button.on { color: var(--amber); }
.pmenu button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }

/* Masonry — sát hơn, nhiều ảnh hơn */
.photo-grid.masonry { column-count: 4; column-gap: 6px; }
.photo-grid.masonry .pcard { display: inline-block; width: 100%; margin: 0 0 6px; break-inside: avoid; }
/* Danh sách */
.photo-grid.list { display: flex; flex-direction: column; gap: 6px; }
.photo-grid.list .pcard { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; background: var(--panel-2); }
.photo-grid.list .pcard > img { width: 46px; height: 46px; flex: none; border-radius: 8px; min-height: 0; }
.photo-grid.list .pbar { flex: 1; min-width: 0; padding: 0; background: none; }
@keyframes chosePop { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }

.scroll-top { position: fixed; bottom: 22px; right: 22px; z-index: 35; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-3); color: var(--text); cursor: pointer; display: none; place-items: center; box-shadow: var(--shadow-sm); }
.scroll-top.show { display: grid; }
.scroll-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; background: rgba(0,0,0,.9); padding: 22px; }
#note-modal { z-index: 85; }  /* nổi trên lightbox để ghi chú ngay khi đang xem ảnh */
/* Khung ghi chú đè trên ảnh */
.lb-note-box { position: absolute; left: 10px; right: 10px; bottom: 64px; z-index: 3; display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(20,16,8,.82); border: 1px solid rgba(251,191,36,.4); backdrop-filter: blur(8px); animation: lbFade .2s ease; }
.lb-note-box .lb-note-ico { flex: none; font-size: 15px; line-height: 1.4; }
.lb-note-text { flex: 1; min-width: 0; color: #fde9b8; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.lb-note-mini { flex: none; width: 28px; height: 28px; border-radius: 7px; border: 0; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; transition: background .15s, transform .1s; }
.lb-note-mini:hover { background: rgba(255,255,255,.28); }
.lb-note-mini:active { transform: scale(.9); }
.lb-note-mini svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.lightbox.open { display: grid; animation: lbFade .18s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lightbox.open .lb-stage { animation: lbZoom .28s cubic-bezier(.22,.9,.28,1) both; }
@keyframes lbZoom { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lb-img-wrap img { transition: opacity .2s ease; }
.lb-img-wrap img.lb-slide-r { animation: lbSlideR .26s cubic-bezier(.22,.9,.28,1); }
.lb-img-wrap img.lb-slide-l { animation: lbSlideL .26s cubic-bezier(.22,.9,.28,1); }
@keyframes lbSlideR { from { transform: translateX(42px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes lbSlideL { from { transform: translateX(-42px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.guide-step { display: flex; gap: 14px; align-items: flex-start; }
.guide-step + .guide-step { margin-top: 14px; }
.guide-step .gn { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; }
.guide-step strong { display: block; margin-bottom: 2px; }
.guide-step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.guide-step b { color: var(--text); }
.lb-stage { max-width: min(1100px, 96vw); max-height: 92vh; }
.lb-img-wrap { position: relative; display: flex; }
.lb-img-wrap img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 14px; cursor: pointer; }
/* thanh trên: tên ảnh + copy + vị trí (overlay góc trên) */
.lb-topbar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 3; display: flex; align-items: center; gap: 8px; }
.lb-topbar .grow { flex: 1; }
.lb-name { max-width: 60vw; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; backdrop-filter: blur(6px); }
.lb-pos { padding: 6px 10px; border-radius: 99px; background: rgba(0,0,0,.55); color: rgba(255,255,255,.85); font-size: 12px; backdrop-filter: blur(6px); }
/* thanh dưới: nút thao tác (overlay đáy ảnh) */
.lb-acts { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; }
.lb-acts .grow { flex: 1; }
.lb-mini { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; cursor: pointer; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); transition: background .15s, transform .1s; }
.lb-mini:hover { background: rgba(0,0,0,.72); }
.lb-mini:active { transform: scale(.9); }
.lb-mini svg { width: 18px; height: 18px; }
.lb-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 99px; border: 0; cursor: pointer; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); transition: background .15s, transform .1s; }
.lb-pill svg { width: 16px; height: 16px; }
.lb-pill:active { transform: scale(.96); }
.lb-pill.primary { background: var(--brand); }
.lb-pill.primary.on { background: #22c55e; }
.lb-pill.on { background: var(--amber); color: #1a1a1a; }
.lb-pill:disabled { opacity: .55; cursor: not-allowed; background: rgba(0,0,0,.5); }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; background: rgba(0,0,0,.4); color: #fff; transition: background .15s, transform .12s; z-index: 4; }
.lb-nav:hover { background: rgba(0,0,0,.6); }
.lb-nav:active { transform: translateY(-50%) scale(.94); }
.lb-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.lb-prev { left: clamp(6px, 2vw, 24px); } .lb-next { right: clamp(6px, 2vw, 24px); }
.lb-close { position: fixed; top: clamp(10px, 2vw, 20px); right: clamp(10px, 2vw, 20px); width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; z-index: 5; }
.lb-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; }

/* summary */
.summary-list { padding: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; max-height: 300px; overflow: auto; font-size: 13.5px; }
.summary-list .r { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.summary-list .r:last-child { border: 0; }
.summary-list .nm { font-weight: 600; }
.summary-list .nt { color: var(--muted); font-style: italic; text-align: right; }

/* ============ Toast ============ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); padding: 12px 20px; border-radius: 99px; background: #fff; color: #111; font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .28s; z-index: 90; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .25s; width: 248px; }
  .sidebar.open { transform: translateX(0); }
  .app-main { padding-top: calc(74px + env(safe-area-inset-top, 0px)); padding-left: 16px; padding-right: 16px; }
  .mobile-bar { display: flex !important; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .page-head { margin-top: 4px; margin-bottom: 18px; }
  .page-head h1 { font-size: 22px; }
}
.mobile-bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 40; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.sb-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 861px) { .sb-overlay { display: none !important; } }
@media (max-width: 1100px) { .photo-grid.masonry { column-count: 3; } .photo-grid.grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .photo-grid.masonry { column-count: 2; column-gap: 6px; }
  .photo-grid.masonry .pcard { margin-bottom: 6px; }
  .photo-grid.grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .client-top { padding: 10px 14px; }
  .client-wrap { padding: 14px 10px 70px; }
  .cbar { top: 54px; padding: 10px 12px; gap: 10px; margin: 14px 0 8px; }
  .ctab { padding: 8px 12px; font-size: 12.5px; }
  .cprogress { width: 70px; }
  .cbar-row1 .btn.primary { padding: 0 14px; min-height: 40px; }
}
@media (max-width: 560px) {
  .albums-grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .cmeta { align-items: flex-start; }
}
