/* ==========================================================================
   FilePortal — premium light UI
   ========================================================================== */
:root {
  --bg: #eef4f3;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --sidebar: #0a2329;
  --sidebar-2: #0f3138;
  --sidebar-text: #d3e6e4;
  --primary: #0d9488;
  --primary-600: #0f766e;
  --primary-50: #e6f6f4;
  --danger: #e03131;
  --danger-600: #c92a2a;
  --success: #16a34a;
  --warning: #f59e0b;
  --gold: #d9a03a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --c-blue: #2dd4bf; --c-violet: #8b5cf6; --c-green: #2fb58b; --c-red: #ef4444; --c-orange: #f5a524;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
p { margin: 0; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; flex: none; }
.icon-lg { width: 22px; height: 22px; flex: none; }
.icon-xl { width: 32px; height: 32px; flex: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, border-color .15s, color .15s, transform .05s;
  text-decoration: none !important; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn-primary {
  color: #fff; background: linear-gradient(180deg, #14b8a6 0%, var(--primary) 55%, var(--primary-600) 100%);
  box-shadow: 0 1px 2px rgba(13, 148, 136, .3), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { background: linear-gradient(180deg, #0f9a8e, var(--primary-600)); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #ec4040, var(--danger) 60%, var(--danger-600)); }
.btn-danger:hover { background: var(--danger-600); }
.btn-outline { color: var(--primary); background: #fff; border-color: #a6dcd5; }
.btn-outline:hover { background: var(--primary-50); }
.btn-ghost { color: var(--text-2); background: #fff; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.blue { color: var(--primary); }
.icon-btn.blue:hover { background: var(--primary-50); }
.icon-btn.red { color: var(--danger); }
.icon-btn.red:hover { background: #fdecec; }
.icon-btn.active { background: var(--primary-50); color: var(--primary); }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.label { font-weight: 600; font-size: 13.5px; color: #1f2937; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.input::placeholder, .textarea::placeholder { color: #9aa3b2; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
.input.is-invalid { border-color: var(--danger); }
.input-group { position: relative; }
.input-group .input { padding-right: 42px; }
.input-group .addon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8a94a6; pointer-events: none; width: 16px; height: 16px; }
.input-icon > .input { padding-left: 36px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.help { color: var(--muted); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }

/* ---------------------------------------------------------------- alerts / badges */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert ul { margin: 0; padding-left: 18px; }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 11px;
  font-weight: 700; letter-spacing: .02em; border: 1px solid; white-space: nowrap;
}
.badge-pdf { color: #d92d20; background: #fef3f2; border-color: #fecdca; }
.badge-excel { color: #12804a; background: #ecfdf3; border-color: #abefc6; }
.badge-image { color: #c4690b; background: #fff7ed; border-color: #fed7aa; }
.badge-video { color: #7a3fd1; background: #f5f0ff; border-color: #ddd0fb; }
.badge-word { color: #1d5fd6; background: #eef4ff; border-color: #b4e3dc; }
.badge-text, .badge-archive, .badge-other { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: #12804a; background: #ecfdf3; }
.status-inactive { color: #b42318; background: #fef3f2; }

/* ---------------------------------------------------------------- app layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar) 0%, #071a1f 100%); color: var(--sidebar-text);
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 22px; color: #fff; text-decoration: none !important; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand .icon { width: 28px; height: 28px; stroke-width: 1.5; }
.brand-name { font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: .01em; }
.nav { padding: 16px 10px; display: grid; gap: 4px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 14px; border-radius: 6px; color: var(--sidebar-text);
  font-weight: 500; font-size: 14px; text-decoration: none; transition: background .15s, color .15s;
}
.nav a .icon { width: 19px; height: 19px; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(180deg, #14b8a6, var(--primary)); color: #fff; box-shadow: 0 4px 14px rgba(13,148,136,.35); }
.nav-section { margin: 14px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7d8aa3; }
.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-foot .storage-mini { font-size: 12px; color: #9aa7bd; }
.sidebar-foot .bar { margin-top: 6px; background: rgba(255,255,255,.1); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border);
}
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search .input { height: 38px; background: var(--surface-2); border-color: var(--border); border-radius: 8px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.profile-btn:hover { background: var(--surface-2); }
.profile-btn .who { line-height: 1.2; }
.profile-btn .who strong { display: block; font-size: 13.5px; color: var(--text); }
.profile-btn .who span { font-size: 12px; color: var(--muted); }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; text-decoration: none; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.notif-menu { width: 340px; max-width: calc(100vw - 24px); padding: 0; }
.notif-menu header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f1f3f7; font-size: 13px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item .t { color: var(--muted); font-size: 12px; }

.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 8px; background: #fff; border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }

.backdrop { position: fixed; inset: 0; background: rgba(9, 15, 28, .45); z-index: 35; }
.menu-toggle { display: none; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 700; }
.card-body { padding: 14px 20px 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.mt { margin-top: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat { padding: 18px; display: grid; gap: 10px; align-content: start; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .tile { width: 38px; height: 38px; }
.stat .label { font-weight: 500; color: #374151; font-size: 14px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat .sub { font-size: 12px; color: var(--muted); }
a.stat { color: inherit; text-decoration: none; }
.tile { display: grid; place-items: center; border-radius: 9px; color: #fff; flex: none; width: 40px; height: 40px; }
.tile .icon { width: 20px; height: 20px; }
.tile-blue { background: linear-gradient(135deg, #6aa3ff, var(--c-blue)); }
.tile-violet { background: linear-gradient(135deg, #a78bfa, var(--c-violet)); }
.tile-green { background: linear-gradient(135deg, #4fd1a5, var(--c-green)); }
.tile-red { background: linear-gradient(135deg, #f87171, var(--c-red)); }
.tile-orange { background: linear-gradient(135deg, #fbbf24, var(--c-orange)); }
.tile-navy { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.tile-soft { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; margin-top: 20px; }
.dash-grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 28px; padding: 8px 0; flex-wrap: wrap; justify-content: center; }
.donut { position: relative; width: 180px; height: 180px; flex: none; }
.donut canvas { position: absolute; inset: 0; }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut .center strong { font-size: 24px; line-height: 1; }
.donut .center span { font-size: 12px; color: var(--muted); }
.legend { display: grid; gap: 12px; min-width: 160px; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.legend .sw { width: 9px; height: 9px; border-radius: 50%; }
.legend ul, ul.legend { list-style: none; margin: 0; padding: 0; }
.chart-box { position: relative; height: 240px; }

/* recent uploads list */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef1f6; }
.list-item:last-child { border-bottom: 0; }
.list-item .name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.list-item .meta { font-size: 12px; color: var(--muted); }
.list-item .aside { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.list-item a.name:hover { color: var(--primary); }
.thumb {
  width: 44px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); }
.ft-pdf { color: #e03131; background: #fff1f1; border-color: #ffd5d5; }
.ft-excel { color: #12804a; background: #ecfdf3; border-color: #c7f0d8; }
.ft-word { color: #1d5fd6; background: #eef4ff; border-color: #d3e2fd; }
.ft-image { color: #c4690b; background: #fff7ed; border-color: #fde3c4; }
.ft-video { color: #7a3fd1; background: #f5f0ff; border-color: #e5dbfc; }
.ft-text, .ft-archive, .ft-other { color: #475467; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: none; }
.activity .dot.red { background: var(--danger); } .activity .dot.green { background: var(--success); } .activity .dot.gray { background: #9aa5b8; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.quick-card { display: flex; align-items: center; gap: 14px; padding: 16px; color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c2e3de; }
.quick-card .tile { width: 44px; height: 44px; }
.quick-card strong { display: block; font-size: 14.5px; color: var(--text); }
.quick-card span { font-size: 12.5px; color: var(--muted); }
.quick-card .go { margin-left: auto; color: var(--text-2); }
.quick-card .go.boxed { border: 1px solid var(--border); border-radius: 6px; padding: 3px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .input, .filters .select { height: 36px; width: auto; }
.filters .grow { flex: 1 1 200px; min-width: 160px; }
.filters .input-icon { flex: 1 1 180px; }
.filters .input-icon .input { width: 100%; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: #fff; }
.view-toggle .icon-btn { width: 30px; height: 30px; }

/* ---------------------------------------------------------------- welcome banner */
.welcome {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 22px 26px; border-radius: var(--radius);
  background: linear-gradient(100deg, #dbe8ff 0%, #e8f0ff 45%, #f6efe4 100%); border: 1px solid #cdebe6; margin-bottom: 20px;
}
.welcome::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 460px; height: 260px; opacity: .55; pointer-events: none;
  background:
    radial-gradient(circle at 30% 60%, rgba(217,160,58,.45) 0 10px, transparent 11px),
    radial-gradient(circle at 46% 48%, rgba(217,160,58,.35) 0 16px, transparent 17px),
    radial-gradient(circle at 62% 62%, rgba(255,255,255,.9) 0 9px, transparent 10px),
    radial-gradient(circle at 74% 44%, rgba(217,160,58,.4) 0 13px, transparent 14px),
    radial-gradient(circle at 86% 60%, rgba(255,255,255,.85) 0 7px, transparent 8px),
    radial-gradient(ellipse at 60% 55%, rgba(217,160,58,.25), transparent 60%);
}
.welcome h2 { font-size: 20px; }
.welcome p { color: var(--text-2); margin-top: 2px; }
.welcome .tile { width: 52px; height: 52px; border-radius: 12px; }
.welcome .tile .icon { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: #374151; background: var(--surface-2); padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 13px; }
.table td { padding: 11px 12px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f4fbfa; }
.table .actions { display: flex; gap: 2px; justify-content: flex-start; }
.table .file-name { font-weight: 500; color: var(--text); max-width: 300px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.table .file-name:hover { color: var(--primary); }
.table .thumb { width: 38px; height: 30px; border-radius: 5px; }
.bar { height: 6px; border-radius: 999px; background: #edf1f7; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2dd4bf, var(--primary)); }
.bar.warn > span { background: linear-gradient(90deg, #f5a524, #ea580c); }
.bar.full > span { background: linear-gradient(90deg, #f87171, var(--danger)); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.pages { display: flex; gap: 4px; }
.pages a, .pages span { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border); color: var(--text-2); background: #fff; font-weight: 500; text-decoration: none; }
.pages a:hover { border-color: var(--primary); color: var(--primary); }
.pages .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pages .gap { border: 0; background: none; }
.pages .disabled { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- file grid */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; padding: 16px 20px 20px; }
.fcard { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s; }
.fcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c2e3de; }
.fcard .media { aspect-ratio: 4/3; display: grid; place-items: center; background: linear-gradient(180deg, #f7f9fc, #eef2f8); position: relative; overflow: hidden; color: inherit; }
.fcard .media img { width: 100%; height: 100%; object-fit: cover; }
.fcard .media .big-icon { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; border: 1px solid; }
.fcard .media .big-icon .icon { width: 28px; height: 28px; }
.fcard .media .play { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: rgba(15,23,42,.65); color: #fff; display: grid; place-items: center; }
.fcard .media .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(15,23,42,.75); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.fcard .media .badge { position: absolute; left: 8px; top: 8px; }
.fcard .body { padding: 10px 12px 4px; display: grid; gap: 2px; }
.fcard .body .name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.fcard .body .meta { font-size: 12px; color: var(--muted); }
.fcard .foot { display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding: 4px 8px 8px; margin-top: auto; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; padding: 16px 20px 20px; }
.gallery button.g-item { all: unset; cursor: pointer; display: block; border-radius: 10px; overflow: hidden; position: relative; aspect-ratio: 1; background: #eef2f8; border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
.gallery button.g-item:hover, .gallery button.g-item:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery button.g-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gallery .g-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g-cap { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; color: #fff; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.gallery .g-cap strong { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- empty state & skeleton */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .tile { margin: 0 auto 12px; width: 56px; height: 56px; border-radius: 14px; }
.empty .tile .icon { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.loading-bar { opacity: 0; transition: opacity .2s; }
body.is-loading .loading-bar { opacity: 1; }
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: linear-gradient(90deg, transparent, var(--primary), transparent); background-size: 50% 100%; animation: loadbar 1s linear infinite; }
@keyframes loadbar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
#file-results.htmx-request, #customer-rows.htmx-request, #audit-table.htmx-request { opacity: .55; transition: opacity .15s; }

/* ---------------------------------------------------------------- modal */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(9,15,28,.55); }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.confirm-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #fef2f2; color: var(--danger); margin-bottom: 12px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(6,10,20,.92); display: grid; grid-template-columns: 1fr 320px; }
.lightbox .stage { position: relative; display: grid; place-items: center; padding: 56px 72px; min-height: 0; }
.lightbox .stage video { max-width: 100%; max-height: calc(100vh - 112px); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #000; }
/* scale photos up to fill the stage, but never beyond 2x their real size (more just looks blurry);
   --nat-w is set from the image's natural width once it loads */
.lightbox .stage img { width: min(100%, calc(var(--nat-w, 100vw) * 2)); height: auto; max-height: calc(100vh - 112px); object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .side { background: #fff; padding: 22px; overflow: auto; }
.lightbox .close { position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255,255,255,.1); }
.lightbox .close:hover { background: rgba(255,255,255,.2); color: #fff; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--primary); border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: transform .15s; }
.nav-arrow:hover { transform: translateY(-50%) scale(1.06); text-decoration: none; }
.nav-arrow.prev { left: 16px; } .nav-arrow.next { right: 16px; }
.nav-arrow.disabled { opacity: .35; pointer-events: none; }

/* ---------------------------------------------------------------- preview page */
.preview { display: grid; grid-template-columns: 112px minmax(0, 1fr) 320px; gap: 18px; padding: 18px 22px 22px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.preview-head h1 { font-size: 22px; }
.strip { display: grid; gap: 12px; align-content: start; }
.strip a { display: grid; place-items: center; aspect-ratio: 1.15; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); color: var(--text-2); text-decoration: none; position: relative; font-size: 11px; text-align: center; padding: 0; }
.strip a .lbl { position: absolute; bottom: 4px; left: 4px; right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip a img { width: 100%; height: 100%; object-fit: cover; }
.strip a.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
.strip a:hover { border-color: #8fd3c9; }
.viewer { position: relative; min-height: 480px; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #f3f5f9, #e9edf4); display: grid; place-items: center; border: 1px solid var(--border); }
.viewer > img { width: min(100%, calc(var(--nat-w, 100vw) * 2)); height: auto; max-height: 72vh; object-fit: contain; }
.viewer > video { width: 100%; max-height: 72vh; background: #000; }
.viewer > iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.viewer .doc { align-self: stretch; justify-self: stretch; background: #fff; overflow: auto; max-height: 75vh; padding: 28px 34px; font-size: 14px; line-height: 1.7; }
.viewer pre.doc { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 0; line-height: 1.55; }
.viewer .sheet { align-self: stretch; justify-self: stretch; background: #fff; overflow: auto; display: flex; flex-direction: column; max-height: 75vh; }
.sheet-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.sheet-tabs a { padding: 4px 12px; border-radius: 6px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.sheet-tabs a.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.grid-table { border-collapse: collapse; font-size: 12.5px; }
.grid-table th, .grid-table td { border: 1px solid #e5e9f0; padding: 5px 9px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.grid-table th { background: #f3f6fa; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
.grid-table td.rn { background: #f8fafc; color: var(--muted); text-align: right; }
.no-preview { text-align: center; color: var(--muted); padding: 40px; }
.no-preview .big-icon { width: 84px; height: 84px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid; background: #fff; }
.no-preview .big-icon .icon { width: 42px; height: 42px; }
.details h2 { font-size: 17px; word-break: break-word; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 12px 10px; margin: 18px 0 22px; font-size: 13.5px; }
.dl dt { color: var(--text-2); font-weight: 500; }
.dl dd { margin: 0; color: var(--text); word-break: break-word; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 2px 8px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 500; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------------------------------------------------------- upload */
.dropzone {
  border: 2px dashed #a9d8d1; border-radius: 14px; background: linear-gradient(180deg, #f6fcfb, #eef9f7); padding: 40px 20px; text-align: center;
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: #e6f6f4; }
.dropzone .tile { margin: 0 auto 14px; width: 60px; height: 60px; border-radius: 16px; }
.dropzone .tile .icon { width: 30px; height: 30px; }
.dropzone h3 { font-size: 17px; }
.dropzone p { color: var(--muted); margin-top: 4px; }
.upload-list { list-style: none; margin: 0; padding: 0; }
.upload-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eef1f6; }
.upload-item:last-child { border-bottom: 0; }
.upload-item .name { font-weight: 600; font-size: 13.5px; }
.upload-item .meta { font-size: 12px; color: var(--muted); }
.upload-item .err { font-size: 12.5px; color: var(--danger); }
.upload-item .ok { font-size: 12.5px; color: var(--success); }
.upload-item .bar { margin-top: 6px; }
.upload-item .acts { display: flex; gap: 4px; align-items: center; }
.ext-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ext-list span { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn .25s ease; }
.toast.success { border-left-color: var(--success); } .toast.success .icon { color: var(--success); }
.toast.error { border-left-color: var(--danger); } .toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--primary); }
.toast .x { margin-left: auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #0b1322; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 64px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 60% 50% at 35% 72%, rgba(217,160,58,.42), transparent 70%),
    radial-gradient(ellipse 40% 30% at 30% 70%, rgba(255,232,180,.35), transparent 70%),
    radial-gradient(ellipse 70% 60% at 85% 15%, rgba(110,140,190,.35), transparent 70%),
    radial-gradient(ellipse 80% 70% at 100% 100%, rgba(40,60,100,.6), transparent 70%),
    linear-gradient(160deg, #1b2537 0%, #2a3346 40%, #1a2131 100%);
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 18% 62%, rgba(255,255,255,.75) 0 2px, transparent 3px),
    radial-gradient(circle at 40% 55%, rgba(255,255,255,.6) 0 1.5px, transparent 3px),
    radial-gradient(circle at 52% 80%, rgba(255,255,255,.55) 0 1.5px, transparent 3px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,.4) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.45) 0 1.5px, transparent 3px);
}
.auth-hero .gem-art { position: absolute; left: 14%; top: 34%; width: 52%; max-width: 380px; color: rgba(255, 226, 170, .75); filter: drop-shadow(0 20px 60px rgba(217,160,58,.45)); opacity: .9; }
.auth-hero .gem-art svg { width: 100%; height: auto; stroke-width: .6; }
.auth-hero h1 { color: #fff; font-size: 40px; font-weight: 600; line-height: 1.15; max-width: 420px; position: relative; letter-spacing: -.01em; }
.auth-hero p { color: rgba(255,255,255,.88); font-size: 17px; max-width: 360px; margin-top: 18px; position: relative; }
.features { margin-top: auto; display: flex; gap: 48px; position: relative; flex-wrap: wrap; }
.feature { text-align: center; font-size: 13px; color: rgba(255,255,255,.9); width: 96px; }
.feature .circle { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.feature .circle .icon { width: 22px; height: 22px; color: #fff; }
.c-blue { background: linear-gradient(135deg, #4e95ff, #1f6ff2); } .c-violet { background: linear-gradient(135deg, #a58bff, #7c5cf0); } .c-green { background: linear-gradient(135deg, #3fd39b, #16a37a); }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: linear-gradient(180deg, #e9edf4, #dfe5ee); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(15,23,42,.25); padding: 34px 30px 26px; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .gem { width: 44px; height: 44px; color: #b9781b; stroke-width: 1.6; }
.auth-logo .name { font-family: var(--serif); font-size: 38px; font-weight: 600; color: #111827; line-height: 1.05; margin-top: 4px; letter-spacing: .01em; }
.auth-logo .sub { color: var(--text-2); font-size: 15px; margin-top: 4px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; font-size: 13.5px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); margin: 22px 0 14px; font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border-strong); }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ---------------------------------------------------------------- error page */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-size: 64px; font-weight: 800; color: #c7d3e6; line-height: 1; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .dash-grid, .dash-grid-2 { grid-template-columns: 1fr; }
  .preview { grid-template-columns: minmax(0, 1fr) 300px; }
  .strip { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(auto-fill, 96px); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { min-height: 280px; padding: 36px 28px; }
  .auth-hero .gem-art { display: none; }
  .auth-hero h1 { font-size: 30px; }
  .features { margin-top: 28px; gap: 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .preview { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lightbox .side { max-height: 40vh; }
  .lightbox .stage { padding: 56px 12px 12px; }
  .lightbox .stage img { max-height: calc(60vh - 68px); }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .profile-btn .who, .topbar .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 21px; }
  .welcome::after { display: none; }
  .file-grid, .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 10px; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .dl { grid-template-columns: 96px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.upload-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .upload-layout { grid-template-columns: 1fr; } }

/* customer form sections & login-details panel */
.form-section { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-600); }
.form-section:not(:first-child) { margin-top: 10px; }

/* one-time login details panel */
.credential { max-width: 640px; margin: 0 0 20px; background: #fff; border: 1px solid #b4e3dc; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.cred-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(100deg, #e6f6f4, #f0faf8); border-bottom: 1px solid #cdebe6; }
.cred-head .tile { width: 38px; height: 38px; border-radius: 10px; }
.cred-head strong { display: block; font-size: 15px; color: var(--text); }
.cred-head .small { color: #b45309; font-weight: 500; }
.cred-head .icon-btn { margin-left: auto; }
.cred-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); margin: 0; }
.cred-grid dt, .cred-grid dd { padding: 11px 18px; border-bottom: 1px solid #eef1f6; margin: 0; }
.cred-grid dt { color: var(--text-2); font-weight: 600; font-size: 13px; display: flex; align-items: center; }
.cred-grid dd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cred-grid code { flex: 1; min-width: 0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; overflow-wrap: anywhere; }
.cred-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--surface-2); flex-wrap: wrap; }
.cred-foot .help { margin: 0; }

/* multi-customer picker */
.picker { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.picker-head { display: flex; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.picker-head .input { height: 34px; }
.picker-list { max-height: 260px; overflow-y: auto; padding: 6px; display: grid; gap: 4px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.picker-item:hover { background: #f0faf8; }
.picker-item input { position: absolute; opacity: 0; pointer-events: none; }
.picker-item .who { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.picker-item .who strong { font-size: 13.5px; font-weight: 600; }
.picker-item .who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .tick { color: #c5cfdd; display: grid; }
.picker-item.on { background: var(--primary-50); border-color: #a6dcd5; }
.picker-item.on .tick { color: var(--primary); }
.picker-item.locked { cursor: default; }
.picker-item:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.owner-tag { font-size: 11px; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 1px 8px; }
.picker-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.picker-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 12.5px; background: var(--surface-2); }
.picker-foot strong { color: var(--primary); }

/* sharing indicators */
.pill-admin { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #6d28d9; background: #f3efff; border: 1px solid #e2d8fd; border-radius: 999px; padding: 1px 8px; white-space: nowrap; vertical-align: middle; }
.audience { display: flex; align-items: center; gap: 6px; min-width: 0; }
.audience .more { font-size: 11.5px; font-weight: 600; color: var(--primary-600); background: var(--primary-50); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.access-list { display: flex; flex-wrap: wrap; gap: 6px; }
.access-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.access-chip .avatar { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------------------------------------------------------------- premium customer dashboard */
.hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 30px 34px; border-radius: 18px; margin-bottom: 22px; color: #fff; flex-wrap: wrap;
  background:
    radial-gradient(ellipse 45% 90% at 88% 30%, rgba(217,160,58,.35), transparent 70%),
    radial-gradient(ellipse 40% 80% at 8% 120%, rgba(13,148,136,.45), transparent 70%),
    linear-gradient(120deg, #0e1828 0%, #17284a 55%, #1d2f55 100%);
  box-shadow: 0 18px 40px rgba(14, 24, 40, .22);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 70% 20%, rgba(255,255,255,.8) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 78% 75%, rgba(255,255,255,.6) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 60%, rgba(255,230,180,.7) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 92% 50%, rgba(255,255,255,.5) 0 1px, transparent 2px);
}
.hero-main { position: relative; z-index: 1; max-width: 640px; }
.hero-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #cbd6ea; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 4px 10px; border-radius: 999px; }
.hero h1 { color: #fff; font-size: 28px; font-weight: 700; margin: 14px 0 6px; letter-spacing: -.01em; }
.hero p { color: #d3dcec; font-size: 15px; }
.hero p strong { color: #f3c879; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn-gold { color: #1b1305; background: linear-gradient(180deg, #f6d48b, #e0a948); box-shadow: 0 6px 18px rgba(224,169,72,.35); }
.btn-gold:hover { background: linear-gradient(180deg, #f8dc9d, #e6b257); }
.btn-glass { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.btn-glass:hover { background: rgba(255,255,255,.18); }
.hero-storage { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; padding: 16px 22px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(#f3c879 calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.ring > div { width: 72px; height: 72px; border-radius: 50%; background: #15233f; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring strong { font-size: 17px; color: #fff; }
.ring span { font-size: 11px; color: #9fb0cc; }
.hero-storage-text { display: grid; line-height: 1.3; }
.hero-storage-text .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #9fb0cc; }
.hero-storage-text strong { font-size: 22px; color: #fff; }
.muted-light { color: #b6c3da; font-size: 13px; }

.pstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pstat { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.pstat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--primary)); opacity: .9; }
.pstat:nth-child(1) { --accent: #8b5cf6; } .pstat:nth-child(2) { --accent: #2fb58b; } .pstat:nth-child(3) { --accent: #ef4444; } .pstat:nth-child(4) { --accent: #f5a524; }
.pstat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c8e4df; }
.pstat .tile { width: 46px; height: 46px; border-radius: 12px; }
.pstat .label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; }
.pstat .value { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.pstat .go { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); transition: background .15s, color .15s; }
.pstat:hover .go { background: var(--primary); color: #fff; }
.dash-grid-shared { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.card-shared { border-top: 3px solid #8b5cf6; }
.card-shared .card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-shared .card-head h2 .icon-sm { color: #7c3aed; }
@media (max-width: 1200px) { .dash-grid-shared { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero { padding: 24px; } .hero h1 { font-size: 23px; } }
@media (max-width: 520px) { .pstats { grid-template-columns: 1fr; } .hero-storage { width: 100%; } }

/* ---------------------------------------------------------------- interactive customer workspace */
.reveal { animation: fadeUp .45s ease both; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
kbd { font: 600 11px/1 Consolas, monospace; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: #fff; color: var(--text-2); }

.pstats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
button.pstat { font: inherit; text-align: left; cursor: pointer; width: 100%; }
.pstat .go { opacity: .7; }
.pstat.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow); }
.pstat.active .go { background: var(--accent); color: #fff; opacity: 1; }
.pstat:nth-child(5) { --accent: #0f766e; }
.pstat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.dash-grid-tools { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.dropzone-sm { display: flex; align-items: center; gap: 16px; padding: 22px; text-align: left; }
.dropzone-sm .tile { margin: 0; width: 50px; height: 50px; border-radius: 14px; flex: none; transition: transform .2s; }
.dropzone-sm:hover .tile, .dropzone-sm.over .tile { transform: translateY(-3px) scale(1.05); }
.dropzone-sm strong { font-size: 15px; }
.dropzone-sm p { margin: 2px 0 0; font-size: 13px; }

.storage-top { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.storage-big { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.ring-light { width: 84px; height: 84px; background: conic-gradient(var(--primary) calc(var(--p) * 1%), #e8edf5 0); }
.ring-light > div { width: 66px; height: 66px; background: #fff; }
.ring-light strong { color: var(--text); font-size: 15px; }
.ring-light span { color: var(--muted); }
.seg-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #edf1f7; gap: 2px; }
.seg-bar span { display: block; height: 100%; min-width: 3px; transition: filter .15s; }
.seg-bar span:hover { filter: brightness(1.1) saturate(1.2); }
.type-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
.type-legend li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.type-legend .sw { width: 9px; height: 9px; border-radius: 3px; }
.type-legend strong { min-width: 64px; text-align: right; }

/* interactive polish shared by all pages */
.table tbody tr { position: relative; }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.fcard .media img, .thumb img { transition: transform .3s ease; }
.fcard:hover .media img, .table tr:hover .thumb img { transform: scale(1.06); }
.btn { position: relative; overflow: hidden; }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(13,148,136,.3); }

@media (max-width: 1200px) { .pstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-grid-tools { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ================================================================ health theme: brand + login */
.logo-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; color: #fff;
  background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 55%, #0f766e 100%); box-shadow: 0 6px 16px rgba(13,148,136,.4); }
.logo-tile .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.logo-lg { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 10px; }
.logo-lg .icon { width: 30px; height: 30px; }
.brand { height: 72px; gap: 12px; }
.brand .logo-tile .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--font); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand-tag { font-size: 10.5px; font-weight: 500; color: #8fc9c2; letter-spacing: .02em; line-height: 1.25; margin-top: 2px; }
.nav a.active { background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 6px 16px rgba(13,148,136,.35); }
.nav a:hover { background: rgba(94, 234, 212, .08); }
.topbar-title { display: grid; line-height: 1.2; min-width: 0; margin-right: 8px; }
.topbar-title strong { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.topbar-title span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.topbar .search { margin-left: auto; }
.topbar-right { margin-left: 14px; }
@media (max-width: 640px) { .topbar-title span { display: none; } .topbar .search { display: none; } }

/* login */
.auth { background: #062a2b; }
.auth-hero {
  padding: 40px 56px 44px; gap: 26px;
  background:
    radial-gradient(ellipse 55% 45% at 78% 42%, rgba(94,234,212,.28), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 95%, rgba(52,211,153,.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 95% 0%, rgba(20,184,166,.25), transparent 70%),
    linear-gradient(155deg, #04302f 0%, #075450 45%, #0b6b63 100%);
}
.auth-hero::before {
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.auth-brand { position: relative; display: flex; align-items: center; gap: 12px; }
.auth-brand strong { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.auth-brand small { display: block; font-size: 12px; color: #a7ddd5; }
.auth-copy { position: relative; }
.auth-hero h1 { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; max-width: 480px; }
.auth-hero h1 span { background: linear-gradient(90deg, #5eead4, #a7f3d0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { margin-top: 14px; max-width: 440px; color: rgba(236, 253, 250, .85); font-size: 16px; }
.features { margin-top: 0; }
.c-blue { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.c-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.c-green { background: linear-gradient(135deg, #34d399, #059669); }

.wellness-art { position: relative; flex: 1; min-height: 300px; max-width: 560px; width: 100%; margin: 0 auto; }
.art-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, 78%);
  padding: 18px; border-radius: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
.art-panel-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #e6fffb; }
.art-badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(94,234,212,.18); color: #99f6e4; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.25); animation: pulse 1.8s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } }
.ecg { width: 100%; height: 64px; margin: 10px 0 6px; overflow: visible; }
.ecg path { fill: none; stroke: #5eead4; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 520; stroke-dashoffset: 520; animation: ecg 2.6s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(94,234,212,.7)); }
@keyframes ecg { 0% { stroke-dashoffset: 520; } 55%, 100% { stroke-dashoffset: 0; } }
.art-row { display: flex; align-items: center; gap: 16px; }
.art-ring { position: relative; width: 84px; height: 84px; flex: none; }
.art-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.art-ring circle { fill: none; stroke-width: 8; }
.art-ring .track { stroke: rgba(255,255,255,.14); }
.art-ring .fill { stroke: #5eead4; stroke-linecap: round; stroke-dasharray: 201; stroke-dashoffset: 44; }
.art-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.art-ring strong { font-size: 18px; color: #fff; }
.art-ring span { font-size: 10.5px; color: #a7ddd5; }
.art-bars { flex: 1; height: 70px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 6px; position: relative; padding-bottom: 16px; }
.art-bars span { display: block; height: var(--h); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #5eead4, rgba(94,234,212,.35));
  transform-origin: bottom; animation: grow .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes grow { from { transform: scaleY(0); } }
.art-bars small { position: absolute; left: 0; bottom: 0; font-size: 10.5px; color: #a7ddd5; }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 14px;
  background: rgba(255,255,255,.95); color: #0f2a2a; box-shadow: 0 14px 34px rgba(0,0,0,.22); animation: floaty 6s ease-in-out infinite;
}
.float-card > .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; color: #fff; }
.float-card strong { display: block; font-size: 13px; }
.float-card small { display: block; font-size: 11.5px; color: #5b7472; }
.fc-1 { left: 0; top: 4%; }
.fc-1 > .icon { background: linear-gradient(135deg, #f97316, #ea580c); }
.fc-2 { right: 0; top: 0; animation-delay: -1.5s; }
.fc-2 > .icon { background: linear-gradient(135deg, #22c55e, #15803d); }
.fc-3 { left: 2%; bottom: 2%; animation-delay: -3s; }
.fc-3 > .icon { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.fc-4 { right: 2%; bottom: 8%; animation-delay: -4.5s; }
.fc-4 > .icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
@keyframes floaty { 50% { transform: translateY(-8px); } }

.auth-panel { background: linear-gradient(180deg, #ecf6f4, #e1eeeb); }
.auth-logo .name { font-family: var(--font); font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: #0b2b2a; }
.auth-logo .sub { color: #3f6260; font-size: 14px; }
@media (max-width: 1100px) { .wellness-art .fc-3, .wellness-art .fc-4 { display: none; } }
@media (max-width: 960px) { .wellness-art { display: none; } .auth-hero { padding: 28px; } .auth-hero h1 { font-size: 30px; } }


/* ================================================================ customer profile (admin) */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 6px 12px 6px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2); background: #fff; border: 1px solid var(--border); text-decoration: none !important;
  transition: color .15s, border-color .15s, transform .15s; }
.back-link:hover { color: var(--primary-600); border-color: #a6dcd5; transform: translateX(-2px); }

.profile-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.profile-band { height: 92px; background:
  radial-gradient(ellipse 40% 120% at 85% 0%, rgba(94,234,212,.45), transparent 70%),
  radial-gradient(ellipse 30% 100% at 10% 100%, rgba(52,211,153,.35), transparent 70%),
  linear-gradient(120deg, #04302f, #075450 55%, #0b6b63); }
.profile-main { display: flex; align-items: flex-end; gap: 22px; padding: 0 26px; margin-top: -44px; flex-wrap: wrap; }
.profile-avatar { width: 96px; height: 96px; border-radius: 24px; display: grid; place-items: center; flex: none; font-size: 32px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2dd4bf, #0f766e); border: 4px solid #fff; box-shadow: 0 10px 24px rgba(13,148,136,.35); }
.profile-info { flex: 1; min-width: 240px; padding-top: 50px; }
.profile-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-title h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.profile-sub { color: var(--text-2); margin-top: 2px; }
.profile-meta { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.profile-meta li { display: inline-flex; align-items: center; gap: 6px; }
.profile-meta .icon-sm { color: var(--primary); }
.profile-storage { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.profile-storage .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.profile-storage strong { display: block; font-size: 20px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 26px 20px; margin-top: 16px; border-top: 1px solid var(--border); background: linear-gradient(180deg, #fbfdfd, #f6faf9); }
.profile-actions form { display: inline; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: #fdecec; color: var(--danger-600); }

.pstats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pstats-6 .pstat { padding: 14px; gap: 10px; }
.pstats-6 .pstat .tile { width: 40px; height: 40px; }
.pstats-6 .pstat .value { font-size: 22px; }
.pstats-6 .pstat:nth-child(1) { --accent: #8b5cf6; } .pstats-6 .pstat:nth-child(2) { --accent: #3b82f6; }
.pstats-6 .pstat:nth-child(3) { --accent: #0f766e; } .pstats-6 .pstat:nth-child(4) { --accent: #2fb58b; }
.pstats-6 .pstat:nth-child(5) { --accent: #ef4444; } .pstats-6 .pstat:nth-child(6) { --accent: #f5a524; }

/* sections */
.media-section { overflow: hidden; scroll-margin-top: 80px; }
.section-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.section-head .tile { width: 42px; height: 42px; border-radius: 12px; }
.section-head h2 { font-size: 17px; font-weight: 700; }
.section-head p { font-size: 12.5px; color: var(--muted); }
.section-head .btn { margin-left: auto; }
.section-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--muted); font-size: 14px; }
.see-more { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; font-weight: 600; font-size: 13px; border-top: 1px solid var(--border); background: var(--surface-2); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 18px 20px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: #eef4f3; text-decoration: none !important; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.photo:hover img { transform: scale(1.08); }
.photo-cap { position: absolute; inset: auto 0 0 0; padding: 26px 10px 9px; color: #fff; background: linear-gradient(transparent, rgba(4, 30, 30, .78));
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.photo:hover .photo-cap, .photo:focus-visible .photo-cap { opacity: 1; transform: none; }
.photo-cap strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-cap small { font-size: 11px; opacity: .85; }
.corner-pill { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #6d28d9; background: rgba(255,255,255,.92); box-shadow: 0 2px 6px rgba(0,0,0,.12); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 18px 20px; }
.vcard { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #fff; color: inherit; text-decoration: none !important;
  transition: transform .2s, box-shadow .2s; }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vthumb { position: relative; display: grid; place-items: center; aspect-ratio: 16/9; background: linear-gradient(135deg, #0a2329, #0f3138); overflow: hidden; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.vcard:hover .vthumb img { transform: scale(1.05); }
.vplaceholder { color: rgba(255,255,255,.35); }
.vplay { position: absolute; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(13,148,136,.85); box-shadow: 0 0 0 8px rgba(255,255,255,.18); transition: transform .2s; }
.vplay .icon { margin-left: 3px; }
.vcard:hover .vplay { transform: scale(1.1); }
.vdur { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; color: #fff; background: rgba(0,0,0,.7); }
.vbody { display: grid; gap: 3px; padding: 10px 12px 12px; }
.vbody strong { font-size: 13.5px; }
.vbody small { font-size: 12px; color: var(--muted); }
.vbody .pill-admin { justify-self: start; }

.doc-list { list-style: none; margin: 0; padding: 6px 12px 10px; }
.doc-row { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 12px; transition: background .15s; }
.doc-row + .doc-row { border-top: 1px solid #eef3f2; }
.doc-row:hover { background: #f4fbfa; }
.doc-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; border: 1px solid; }
.doc-main { flex: 1; min-width: 0; }
.doc-main > a { display: block; font-weight: 600; color: var(--text); }
.doc-main > a:hover { color: var(--primary-600); }
.doc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.doc-actions { display: flex; gap: 2px; flex: none; }

/* activity timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid #e3ecea; font-size: 13px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #9aa5b8; box-shadow: 0 0 0 3px #fff; }
.timeline li.green::before { background: var(--success); } .timeline li.red::before { background: var(--danger); }

/* clickable customer rows */
.row-link { cursor: pointer; }
.row-title { font-weight: 600; color: var(--text); }
.row-title:hover { color: var(--primary-600); }

@media (max-width: 1200px) { .pstats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .pstats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-main { padding: 0 16px; } .profile-actions { padding: 14px 16px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .doc-actions .icon-btn:first-child { display: none; }
}

/* live camera capture */
.cam-stage { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.cam-stage.live { background: #000; border-style: solid; }
.cam-stage video { width: 100%; height: 100%; object-fit: contain; }
.cam-stage.mirror video { transform: scaleX(-1); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: .8; }
.cam-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.shot-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shot { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.shot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.shot .icon-btn { position: absolute; top: 6px; right: 6px; background: #fff; }
.shot-state { padding: 6px 8px; font-size: 12px; min-height: 28px; }
.shot.done { border-color: var(--success); }
.shot.error { border-color: var(--danger); }
.shot .err { color: var(--danger); }
.cam-modes { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cam-modes button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; }
.cam-modes button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.cam-modes button:disabled { cursor: not-allowed; opacity: .6; }
.cam-rec { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cam-rec .dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: cam-blink 1s steps(2, start) infinite; }
@keyframes cam-blink { to { visibility: hidden; } }
.shot video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }

/* customer online / offline status */
.presence-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9aa5b8; flex: none; }
.presence-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }
.avatar-presence { position: relative; }
.avatar-presence .presence-dot { position: absolute; right: -2px; bottom: -2px; box-shadow: 0 0 0 2px #fff; }
.avatar-presence .presence-dot.online { box-shadow: 0 0 0 2px #fff; }
.presence-on { color: var(--success); font-weight: 600; }
.presence-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .9); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.presence-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.presence-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.presence-item:hover { background: var(--surface-2); text-decoration: none; }
.presence-item .who { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.presence-item .who strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence-item .who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.presence.online { color: var(--success); font-weight: 600; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

/* action buttons on image / video gallery tiles */
.g-cell { position: relative; min-width: 0; }
.g-cell .g-item { width: 100%; box-sizing: border-box; }
.g-acts { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.g-acts .icon-btn { background: rgba(255, 255, 255, .95); box-shadow: 0 1px 3px rgba(15, 23, 42, .25); }
.g-acts .icon-btn:hover { background: #fff; }.is-locked, .is-locked:hover { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }

/* user types, permissions and approvals */
.status-pending { color: #b54708; background: #fffaeb; }
.status-approved { color: #12804a; background: #ecfdf3; }
.status-rejected { color: #b42318; background: #fef3f2; }
.status-cancelled { color: #475467; background: #f2f4f7; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.type-card { display: grid; gap: 10px; padding: 18px; color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.type-card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.type-card p { color: var(--muted); font-size: 13px; margin: 0; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chips span { font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.perm-item:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.perm-item input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--primary); }
.perm-item strong { display: block; font-size: 13.5px; }
.perm-item small { color: var(--muted); font-size: 12px; }
.perm-item.locked { cursor: default; opacity: .75; }
.eff-yes { color: var(--success); font-weight: 600; } .eff-no { color: var(--muted); }
.request-note { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }