/* ═══ STUDIOHAUS PORTAL — Files (admin) ═══
   Monochrome: core.css tokens only, no accent colour. Radii 8 / 12 / 16. */

.fx {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: var(--s-8, 32px);
  align-items: start;
  min-height: calc(100vh - 56px);
}

/* ── Sidebar: projects ── */
.fx-side {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  background: var(--bg-card);
  overflow: hidden;
}
.fx-upload-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 16px 0;
  width: calc(100% - 32px);
}
.fx-side-head {
  padding: 16px 16px 10px;
  font-size: var(--fs-xs, 11px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-40);
}
.fx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  padding: 0 10px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-input);
  color: var(--text-40);
  transition: border-color 0.15s;
}
.fx-search:focus-within { border-color: var(--border-hover); color: var(--text-60); }
.fx-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm, 13px);
}
.fx-search input::placeholder { color: var(--text-40); }
.fx-list { overflow-y: auto; padding: 0 6px 10px; flex: 1; }
.fx-side-empty { padding: 12px 10px; font-size: var(--fs-sm, 13px); color: var(--text-40); }

.fx-proj-row {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-sm, 8px);
  transition: background 0.15s;
}
.fx-proj-row:hover { background: var(--bg-card-hover); }
.fx-proj-row.is-active { background: var(--bg-card-hover); }
.fx-caret {
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--text-40);
  cursor: pointer;
  border-radius: var(--radius-sm, 8px);
}
.fx-caret svg { transition: transform 0.18s ease; }
.fx-proj.is-open .fx-caret svg { transform: rotate(90deg); }
.fx-caret:hover { color: var(--text); }
.fx-caret--none { flex-basis: 12px; cursor: default; }
.fx-proj-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 8px 8px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.fx-proj-title, .fx-proj-client, .fx-bk-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-proj-title { font-size: var(--fs-sm, 13px); color: var(--text); }
.fx-proj-client { font-size: var(--fs-xs, 11px); color: var(--text-40); }
.fx-bks { padding: 2px 0 6px 28px; display: flex; flex-direction: column; gap: 1px; }
.fx-bk {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm, 8px);
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  min-width: 0;
}
.fx-bk:hover { background: var(--bg-card-hover); }
.fx-bk.is-active { background: var(--bg-card-hover); }
.fx-bk-date { font-size: var(--fs-xs, 11px); color: var(--text-40); }
.fx-bk-title { font-size: var(--fs-sm, 13px); color: var(--text-60); }
.fx-bk.is-active .fx-bk-title { color: var(--text); }
.fx-bk-note { padding: 6px 8px; font-size: var(--fs-xs, 11px); color: var(--text-40); }

/* ── Main ── */
.fx-main { min-width: 0; }
.fx-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: var(--fs-sm, 13px);
}
.fx-crumb {
  border: 0;
  background: none;
  padding: 2px 0;
  font: inherit;
  color: var(--text-40);
  cursor: pointer;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
button.fx-crumb:hover { color: var(--text); }
.fx-crumb[aria-current="page"] { color: var(--text); cursor: default; }
.fx-crumb-sep { color: var(--text-20); }

.fx-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.fx-title {
  margin: 0;
  font-size: var(--fs-2xl, 28px);
  font-weight: var(--fw-semi, 600);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}
.fx-sub {
  margin-top: 6px;
  font-size: var(--fs-sm, 13px);
  color: var(--text-40);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.fx-path {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-xs, 11px);
  color: var(--text-40);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  word-break: break-all;
}
.fx-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fx-icon-btn { display: inline-flex !important; align-items: center; gap: 6px; }
.fx-btn-link { text-decoration: none; display: inline-flex; align-items: center; }

.fx-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-card);
}
.fx-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-40);
  font: inherit;
  font-size: var(--fs-xs, 11px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fx-toggle button:hover { color: var(--text); }
.fx-toggle button.is-on { background: var(--bg-card-hover); color: var(--text); }

/* ── Shoots and folder cards ── */
.fx-shoot {
  padding: 22px 0 28px;
  border-top: 1px solid var(--border);
}
.fx-shoot:first-of-type { border-top: 0; padding-top: 0; }
.fx-shoot-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.fx-shoot-id { min-width: 0; }
.fx-shoot-date {
  font-size: var(--fs-xs, 11px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-40);
}
.fx-shoot-title {
  display: block;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  font-size: var(--fs-lg, 18px);
  font-weight: var(--fw-medium, 500);
  color: var(--text);
  cursor: pointer;
}
.fx-shoot-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-20); }
.fx-shoot-addr { margin-top: 2px; font-size: var(--fs-sm, 13px); color: var(--text-40); }

.fx-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  font-size: var(--fs-xs, 11px);
}
.fx-link--none { color: var(--text-40); }
.fx-link-status {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-40);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
}
.fx-link-status.is-live { color: var(--text); border-color: var(--border-hover); }
.fx-link-url {
  color: var(--text-60);
  text-decoration: none;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-link-url:hover { color: var(--text); }
.fx-link-more { color: var(--text-40); }

.fx-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.fx-folder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  background: var(--bg-card);
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.fx-folder:hover { background: var(--bg-card-hover); border-color: var(--border-hover); transform: translateY(-1px); }
.fx-folder:active { transform: translateY(0); }
.fx-folder-name { margin-top: 12px; font-size: var(--fs-md, 15px); font-weight: var(--fw-medium, 500); }
.fx-folder-meta { font-size: var(--fs-sm, 13px); color: var(--text-45); min-height: 18px; }
.fx-folder-note { font-size: var(--fs-xs, 11px); color: var(--text-40); line-height: 1.4; }
.fx-folder--skel { min-height: 196px; cursor: default; }

/* Folder illustration: tones of the text colour, so it follows the theme */
.fx-folder-svg { display: block; overflow: visible; }
.fx-folder-svg--lg { width: 96px; height: 74px; }
.fx-folder-svg--md { width: 72px; height: 56px; }
.fx-f-back { fill: var(--text); opacity: 0.16; }
.fx-f-sheet { fill: var(--text); opacity: 0.32; transition: transform 0.25s ease; }
.fx-f-front { fill: var(--text); opacity: 0.24; }
.fx-f-line { stroke: var(--text); stroke-width: 1; opacity: 0.12; fill: none; }
.fx-folder:hover .fx-f-sheet { transform: translateY(-4px); }

/* ── Table ── */
.fx-note {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  font-size: var(--fs-xs, 11px);
  line-height: 1.5;
  color: var(--text-45);
  background: var(--bg-card);
}
.fx-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  overflow: hidden;
}
.fx-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm, 13px); table-layout: auto; }
.fx-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: var(--fw-regular, 400);
  font-size: var(--fs-xs, 11px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-40);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  white-space: nowrap;
}
.fx-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-60);
  vertical-align: middle;
  white-space: nowrap;
}
.fx-table tr:last-child td { border-bottom: 0; }
.fx-table tbody tr { transition: background 0.12s; }
.fx-table tbody tr:hover { background: var(--bg-card-hover); }
.fx-table tr.is-off td { color: var(--text-40); }
.fx-c-name { width: 100%; max-width: 0; }
.fx-c-act { width: 1%; text-align: right; }
.fx-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--text);
  text-align: left;
}
button.fx-name { cursor: zoom-in; }
.fx-table tr.is-off .fx-name { color: var(--text-45); }
.fx-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-name-meta { display: none; }
.fx-mini {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-elevated);
}
.fx-ico {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-card-hover);
  color: var(--text-45);
}
.fx-ico--lg { width: 48px; height: 48px; flex-basis: 48px; border-radius: var(--radius-sm, 8px); }
.fx-ico--lg svg { width: 20px; height: 20px; }
.fx-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: none;
  color: var(--text-45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fx-dl:hover { color: var(--text); background: var(--bg-card-hover); border-color: var(--border); }
.fx-pill {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-40);
}

/* ── Grid ── */
.fx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.fx-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.15s;
}
.fx-tile:hover { border-color: var(--border-hover); }
.fx-tile.is-off { opacity: 0.6; }
.fx-tile-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  background: var(--bg-elevated);
  overflow: hidden;
}
button.fx-tile-media { cursor: zoom-in; }
.fx-tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
button.fx-tile-media:hover img { transform: scale(1.03); }
.fx-tile-foot { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; }
.fx-tile-text { flex: 1; min-width: 0; }
.fx-tile-name { font-size: var(--fs-sm, 13px); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-tile-meta { font-size: var(--fs-xs, 11px); color: var(--text-40); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Empty, loading ── */
.fx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 64px 24px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg, 16px);
}
.fx-empty .fx-folder-svg { margin-bottom: 8px; }
.fx-empty-title { font-size: var(--fs-md, 15px); color: var(--text); font-weight: var(--fw-medium, 500); }
.fx-empty-text { max-width: 420px; font-size: var(--fs-sm, 13px); line-height: 1.5; color: var(--text-40); word-break: break-word; }
.fx-empty .btn-secondary { margin-top: 8px; }

.fx-skel, .fx-skel-row, .fx-folder--skel {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: fx-shimmer 1.4s ease-in-out infinite;
}
.fx-skel { display: inline-block; width: 90px; height: 12px; border-radius: 6px; vertical-align: middle; }
.fx-skel--w40 { width: 40%; height: 16px; margin-bottom: 16px; }
.fx-skel-row { height: 44px; border-radius: var(--radius-sm, 8px); margin-bottom: 6px; }
@keyframes fx-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Viewer ── */
.fx-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.94);
  color: #f0f0f0;
  animation: fx-fade 0.15s ease-out;
}
@keyframes fx-fade { from { opacity: 0; } to { opacity: 1; } }
.fx-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 20px;
}
.fx-viewer-name {
  min-width: 0;
  font-size: var(--fs-sm, 13px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-viewer-name span { margin-left: 12px; color: rgba(255, 255, 255, 0.45); }
.fx-viewer-actions { display: flex; gap: 4px; }
.fx-viewer-btn, .fx-viewer-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}
.fx-viewer-btn { width: 36px; height: 36px; border-radius: var(--radius-sm, 8px); }
.fx-viewer-btn:hover, .fx-viewer-nav:hover { background: rgba(255, 255, 255, 0.14); }
.fx-viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 72px 24px;
}
.fx-viewer-stage img, .fx-viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.fx-viewer-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 999px;
}
.fx-viewer-nav--prev { left: 16px; }
.fx-viewer-nav--next { right: 16px; }

.fx .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Smaller screens ── */
@media (max-width: 1024px) {
  .fx { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .fx-c-who { display: none; }
}
@media (max-width: 768px) {
  .fx { display: block; min-height: 0; }
  /* Drill down: the shoot list is the screen; a shoot opens full screen
     with Back. The empty "pick a shoot" pane is not shown. */
  .fx-side { position: static; max-height: none; margin-bottom: 0; }
  .fx-list { max-height: none; }
  .fx--selected .fx-side { display: none; }
  .fx:not(.fx--selected) .fx-main { display: none; }
  .fx-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    margin: 0 0 8px -6px;
    padding: 0 10px 0 4px;
    border: none;
    background: none;
    color: var(--text-60);
    font-family: var(--font);
    font-size: var(--fs-md, 15px);
    cursor: pointer;
  }
  .fx-proj-name { min-height: 48px; }
  .fx-title { font-size: var(--fs-xl, 22px); }
  .fx-head { align-items: flex-start; }
  .fx-folders { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fx-folder { padding: 14px; }
  .fx-folder-svg--lg { width: 64px; height: 50px; }
  .fx-link-url { max-width: 180px; }
  .fx-c-size, .fx-c-date, .fx-c-who { display: none; }
  .fx-name-meta { display: block; margin: 2px 0 0 42px; font-size: var(--fs-xs, 11px); color: var(--text-40); }
  .fx-table td { padding: 8px 10px; }
  .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fx-dl { width: 40px; height: 40px; }
  .fx-viewer-stage { padding: 0 8px 72px; }
  .fx-viewer-nav { top: auto; bottom: 16px; margin-top: 0; }
  .fx-viewer-nav--prev { left: calc(50% - 56px); }
  .fx-viewer-nav--next { right: calc(50% - 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-folder, .fx-f-sheet, .fx-tile-media img, .fx-caret svg { transition: none; }
  .fx-skel, .fx-skel-row, .fx-folder--skel, .fx-viewer { animation: none; }
}

/* Upload button under each shoot's folders, and Book a shoot in an empty project */
.fx-shoot-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.fx-empty .btn-primary { margin-top: 16px; }
.fx-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.fx-empty-actions .btn-primary, .fx-empty-actions .btn-secondary { margin-top: 0; }

/* Remove (admin): tick boxes on rows and tiles, and the bar above the folder */
.fx-selbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px 8px 14px; border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--bg-card); }
.fx-selbar:empty { display: none; }
.fx-sel-count { margin-right: auto; font-size: var(--fs-sm, 13px); color: var(--text); }
.fx-table th.fx-c-sel, .fx-table td.fx-c-sel { width: 1%; padding-right: 0; }
.fx-check { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--brand-accent); }
.fx-table tbody tr.is-sel { background: var(--bg-card-hover); }
.fx-tile { position: relative; }
.fx-tile.is-sel { border-color: var(--text-45); }
.fx-tile-check { position: absolute; top: 8px; left: 8px; z-index: 1; display: flex; padding: 6px; border-radius: var(--radius-sm, 8px); background: rgba(0, 0, 0, 0.45); cursor: pointer; }
@media (max-width: 768px) {
  .fx-check { width: 20px; height: 20px; }
  .fx-selbar .btn-xs { min-height: 40px; }
}
