/* =============================================================
   LAKTA STUDIO — studio.css
   Design system imported from app.css (Purple / Lavender aesthetic)
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- Tokens -------------------------------------------------- */
:root {
  --bg:           #f5f3ff;
  --bg-card:      #ffffff;
  --bg-panel:     #eeeaf8;
  --border:       #d8d4e8;
  --border-hover: #c0bbd5;
  --ink:          #1a1a1a;
  --paper:        #f5f3ff;
  --panel:        #ffffff;
  --muted:        #8a86a0;
  --text-secondary: #5a5670;
  --line:         #d8d4e8;
  --accent:       #6B5CE7;
  --accent-light: #e8e4f8;
  --accent-dark:  #4a3cb8;
  --accent-2:     #c7c3ff;
  --ok:           #3aaa5b;
  --warn:         #a35d00;
  --red:          #d94040;
  --radius:       8px;
  --shadow:       0 16px 40px rgba(55, 45, 115, .12);
  --shadow-sm:    0 4px 12px rgba(55, 45, 115, .08);
}

/* --- Reset --------------------------------------------------- */
* { box-sizing: border-box; }
button, input, textarea, select { font: inherit; cursor: pointer; }

/* --- Base ---------------------------------------------------- */
body.studio-body,
body.public-body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(245, 243, 255, .97), rgba(255, 255, 255, .93)),
    url('../images/gradient.png') center / cover fixed;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; }
img, video { display: block; max-width: 100%; }

/* --- Admin Shell --------------------------------------------- */
.studio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.studio-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #13112a;
  color: white;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-right: 1px solid rgba(107, 92, 231, .22);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
  color: white;
  padding: .35rem .5rem;
}
.studio-brand img { width: 38px; height: 38px; border-radius: 50%; }

.studio-nav { display: grid; gap: .2rem; }

.studio-nav a {
  text-decoration: none;
  color: rgba(255,255,255,.62);
  padding: .65rem .85rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  border: 1px solid transparent;
}

.studio-nav a:hover,
.studio-nav a.is-active {
  background: rgba(107, 92, 231, .22);
  color: #c7c3ff;
  border-color: rgba(107, 92, 231, .3);
}

.studio-nav a.logout-link {
  color: rgba(255,255,255,.4);
  margin-top: .25rem;
  font-size: .82rem;
}
.studio-nav a.logout-link:hover { background: rgba(217, 64, 64, .18); color: #ffa0a0; border-color: rgba(217,64,64,.22); }

.studio-main { padding: clamp(1rem, 3vw, 2.5rem); }

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.studio-title h1,
.auth-card h1,
.portal-hero h1 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* --- Utility ------------------------------------------------- */
.eyebrow {
  margin: 0 0 .35rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
  font-weight: 700;
}

.muted { color: var(--muted); }

.grid { display: grid; gap: 1rem; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- Cards --------------------------------------------------- */
.card,
.auth-card,
.table-card,
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card { padding: 1.25rem; }
.help-card {
  display: grid;
  gap: .35rem;
  margin-bottom: 1rem;
}
.help-card p { margin: 0; color: var(--text-secondary); }
.table-title {
  padding: 1rem 1rem 0;
}
.upload-progress {
  display: grid;
  gap: .45rem;
}
.upload-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
  font-weight: 700;
}
.upload-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}

.metric {
  font-size: 2rem;
  font-weight: 900;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--ink);
  line-height: 1;
}

/* --- Buttons ------------------------------------------------- */
.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid #111;
  border-radius: var(--radius);
  background: #111;
  color: #fff;
  padding: .55rem .95rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  white-space: nowrap;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(107, 92, 231, .26);
  transform: translateY(-1px);
}

.button.secondary {
  background: white;
  color: var(--ink);
  border-color: var(--border);
}
.button.secondary:hover {
  color: var(--accent-dark);
  border-color: var(--border-hover);
  background: var(--accent-light);
  box-shadow: none;
  transform: none;
}

.button.accent { background: var(--accent); border-color: var(--accent); }
.button.accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 10px 22px rgba(107, 92, 231, .32); }

.button.danger { background: var(--red); border-color: var(--red); }
.button.danger:hover { background: #b53333; border-color: #b53333; box-shadow: 0 8px 18px rgba(217,64,64,.24); }

.button.warn-btn { background: #fff9ec; color: #7a4800; border-color: #ffe0a0; }
.button.warn-btn:hover { background: #ffe0a0; border-color: #e6b800; box-shadow: none; transform: none; }

.button.tiny { min-height: 30px; padding: .2rem .6rem; font-size: .78rem; }

/* --- Forms --------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: .4rem;
  font-weight: 700;
  font-size: .88rem;
  color: var(--ink);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .72rem .9rem;
  font: inherit;
  font-size: .9rem;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(107, 92, 231, .13);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

textarea { min-height: 140px; resize: vertical; }

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
}
.checks label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
}
.checks input { width: auto; accent-color: var(--accent); }

/* --- Tables -------------------------------------------------- */
.table-card { overflow: hidden; }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }

th, td {
  text-align: left;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: .72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  background: var(--bg-panel);
}

tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(107, 92, 231, .03); }

/* --- Flash Messages ----------------------------------------- */
.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  background: #edf9f0;
  color: #275d37;
  border: 1px solid #c8eacb;
  font-size: .9rem;
  font-weight: 500;
}

.flash.error { background: #fdecec; color: #8b1f1f; border-color: #f4caca; }

/* --- Auth Screen --------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(245, 243, 255, .96), rgba(255, 255, 255, .90));
}

.auth-card { width: min(460px, 100%); padding: 1.75rem; }
.auth-card img { width: 48px; height: 48px; border-radius: 50%; margin-bottom: 1rem; }

/* --- Portal (Client View) ------------------------------------ */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  background: rgba(245, 243, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.portal-main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.portal-cover {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.portal-card { overflow: hidden; text-decoration: none; transition: box-shadow .22s ease, transform .22s ease; }
.portal-card:hover { box-shadow: 0 20px 50px rgba(55, 45, 115, .16); transform: translateY(-3px); }
.portal-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.portal-card div { padding: 1rem; }

/* --- Gallery ------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-panel);
  cursor: pointer;
  padding: 0;
  aspect-ratio: 3/4;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease;
}
.gallery-item:hover { transform: scale(1.025); box-shadow: 0 12px 28px rgba(55,45,115,.18); }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; }
.gallery-item span {
  position: absolute;
  left: .45rem; bottom: .45rem;
  background: rgba(0,0,0,.7);
  color: white;
  padding: .2rem .45rem;
  border-radius: 999px;
  font-size: .75rem;
}

/* --- Lightbox ----------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.94);
  display: none;
  grid-template-rows: auto 1fr auto;
  color: white;
}
.lightbox.is-open { display: grid; }
.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1rem;
}
.lightbox-stage { display: grid; place-items: center; padding: .5rem; min-height: 0; }
.lightbox-stage img, .lightbox-stage video { max-width: 94vw; max-height: 76vh; border-radius: var(--radius); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: white; border: 0;
  transition: background .18s ease;
}
.lightbox-nav:hover { background: rgba(107, 92, 231, .5); }
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }

/* --- Modal --------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 26, 26, .42);
  z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fade-in .18s ease both;
}
.modal-backdrop.hidden { display: none !important; }

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(26, 26, 26, .22);
  animation: slide-up .22s cubic-bezier(.16,1,.3,1) both;
}

.modal-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  background: var(--bg-panel);
  position: sticky; top: 0; z-index: 2;
}
.modal-head h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.modal-body { padding: 1.25rem; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* --- Badges -------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  border-radius: 999px; padding: .22rem .65rem;
  font-size: .72rem; font-weight: 700;
  white-space: nowrap;
}
.badge.ok    { background: #edf9f0; color: #275d37; border: 1px solid #c8eacb; }
.badge.warn  { background: #fff9ec; color: #7a4800; border: 1px solid #ffe0a0; }
.badge.info  { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #c7c3ff; }
.badge.muted { background: var(--bg-panel); color: var(--muted); border: 1px solid var(--border); }
.badge.err   { background: #fdecec; color: #8b1f1f; border: 1px solid #f4caca; }

/* --- Table Search Bar --------------------------------------- */
.table-search {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.table-search input {
  max-width: 300px;
  min-height: 34px;
  padding: .35rem .75rem;
  font-size: .84rem;
}
.table-search .result-count { font-size: .8rem; color: var(--muted); margin-left: auto; }

/* --- Section heading inside a card -------------------------- */
.section-head {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  margin: 1.5rem 0 .85rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; font-size: .95rem; font-weight: 800; }

/* --- Detail view row (key/value pairs) ---------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: .55rem .75rem;
  font-size: .88rem;
}
.detail-grid dt { color: var(--text-secondary); font-weight: 700; padding-top: .1rem; }
.detail-grid dd { margin: 0; }

/* --- Action row in tables ----------------------------------- */
.row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.inline-visibility-form {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.inline-visibility-form select {
  min-width: 170px;
  padding: .45rem .65rem;
  font-size: .82rem;
}


/* --- Reveal animation for studio-main ----------------------- */
.studio-main > * {
  animation: reveal-soft .55s cubic-bezier(.16,1,.3,1) both;
}
@keyframes reveal-soft {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .studio-shell { grid-template-columns: 1fr; }
  .studio-sidebar { position: relative; height: auto; }
  .studio-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.two, .form-grid, .portal-hero, .project-grid { grid-template-columns: 1fr; }
  .studio-topbar, .portal-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .grid.cards { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Shared Lakta identity */
:root {
  --nav-bg: #f8f8f4;
  --nav-text: #111;
  --nav-border: rgba(17, 17, 17, .12);
}

.lakta-logo-mark,
.auth-logo,
.studio-brand-logo {
  display: block;
  color: currentColor;
  line-height: 0;
}

.lakta-logo-mark svg,
.auth-logo svg,
.studio-brand-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

.auth-logo {
  width: min(172px, 58vw);
  margin-bottom: 1rem;
}

.studio-brand-logo {
  width: 128px;
}

.studio-brand {
  align-items: center;
}

.studio-brand .studio-brand-logo + span {
  display: none;
}

.lakta-navbar.portal-header {
  min-height: 72px;
  padding: .85rem clamp(1rem, 4vw, 2.4rem);
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 8px 24px rgba(17, 17, 17, .05);
  backdrop-filter: none;
}

.portal-brand {
  width: clamp(118px, 13vw, 168px);
  min-width: 110px;
}

.lakta-navbar__private {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-right: auto;
  margin-left: 1rem;
  min-width: 0;
}

.lakta-navbar__private-label,
.lakta-navbar__private-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(17,17,17,.1);
  border-radius: 999px;
  padding: .25rem .7rem;
  background: #fff;
  color: #111;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}

.lakta-navbar__private-link:hover {
  border-color: #111;
}

.lakta-navbar__account {
  margin-left: auto;
}

/* =============================================================
   LAKTA PREMIUM REFRESH
   Public-aligned Studio and delivery portal finish
   ============================================================= */

:root {
  --bg: #f4f4f1;
  --bg-card: #fff;
  --bg-panel: #f0f0ec;
  --border: rgba(17, 17, 17, .12);
  --border-hover: rgba(17, 17, 17, .28);
  --ink: #111;
  --paper: #f4f4f1;
  --panel: #fff;
  --muted: #74746d;
  --text-secondary: #54544d;
  --line: rgba(17, 17, 17, .12);
  --accent: #111;
  --accent-light: #ecebe4;
  --accent-dark: #000;
  --accent-2: #c7a96b;
  --ok: #2f7d4f;
  --warn: #9b6500;
  --red: #be3434;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(17, 17, 17, .08);
  --shadow-sm: 0 6px 18px rgba(17, 17, 17, .07);
}

body.studio-body,
body.public-body {
  background: #f4f4f1;
  color: var(--ink);
}

.studio-sidebar {
  background: #0d0d0d;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.studio-nav a:hover,
.studio-nav a.is-active {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-color: rgba(255, 255, 255, .14);
}

.card,
.auth-card,
.table-card,
.portal-card {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.button.accent,
.button:hover {
  background: #111;
  border-color: #111;
  color: #fff;
  box-shadow: 0 12px 26px rgba(17, 17, 17, .16);
}

.button.secondary:hover {
  color: #111;
  background: #f7f7f4;
  border-color: var(--border-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .08);
}

.table-card { overflow-x: auto; }
.table-card table { min-width: 760px; }

.client-cell,
.portal-user,
.client-intel {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.client-intel {
  align-items: flex-start;
}

.client-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(17, 17, 17, .16);
  font-size: .78rem;
  font-weight: 900;
  overflow: hidden;
}

.client-avatar.large {
  width: 76px;
  height: 76px;
  font-size: 1.25rem;
}

.client-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-log {
  display: grid;
  gap: .65rem;
}

.mini-log > div {
  display: grid;
  gap: .15rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafaf8;
}

.inline-stage-form {
  display: flex;
  align-items: end;
  gap: .6rem;
  flex-wrap: wrap;
}

.inline-stage-form label {
  min-width: 160px;
}

.checklist {
  display: grid;
  gap: .45rem;
}

.checklist label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
}

.portal-body {
  background: #f4f4f1;
}

.portal-header {
  min-height: 74px;
  padding: .85rem clamp(1rem, 4vw, 2.4rem);
  background: rgba(244, 244, 241, .86);
  border-bottom: 1px solid rgba(17, 17, 17, .1);
  backdrop-filter: blur(18px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: #111;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.portal-brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.portal-user {
  color: #111;
  font-size: .9rem;
  font-weight: 800;
  min-width: 0;
}

.portal-user > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.portal-main {
  width: min(1220px, calc(100% - 2rem));
  padding: 1.25rem 0 4rem;
}

.portal-hero.cinematic {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  min-height: clamp(420px, 56vw, 640px);
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: var(--radius);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, .42) 52%, rgba(0, 0, 0, .12)),
    var(--cover-image);
  background-size: cover;
  background-position: center;
  color: #fff;
  box-shadow: 0 24px 70px rgba(17, 17, 17, .16);
}

.portal-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .12), transparent 30%),
    linear-gradient(0deg, rgba(0, 0, 0, .48), transparent 42%);
  pointer-events: none;
}

.portal-hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  align-self: end;
  padding: clamp(1.25rem, 5vw, 3.25rem);
}

.portal-hero-content .eyebrow,
.portal-hero-content h1,
.portal-hero-content p {
  color: #fff;
}

.portal-hero-content h1 {
  margin: .25rem 0 .75rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  font-weight: 600;
  line-height: .96;
  max-width: 12ch;
}

.project-hero .portal-hero-content h1 {
  max-width: 15ch;
}

.portal-hero-content p {
  max-width: 700px;
  opacity: .86;
}

.portal-hero-meta,
.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.portal-hero-meta span,
.project-card-meta span {
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: .25rem .65rem;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: .78rem;
  font-weight: 800;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.portal-card.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  color: #111;
}

.project-card-image {
  display: block;
  aspect-ratio: 16 / 11;
  background-size: cover;
  background-position: center;
}

.portal-card h2 {
  margin: .25rem 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.05;
}

.project-card-meta {
  margin-top: .85rem;
}

.project-card-meta span {
  border-color: var(--border);
  background: #f6f6f2;
  color: #111;
}

.delivery-timeline,
.download-hub,
.gallery-section,
.portal-workflow {
  margin-top: 1rem;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .5rem;
}

.timeline-step {
  position: relative;
  display: grid;
  gap: .45rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.timeline-step span {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #deded7;
}

.timeline-step.is-done,
.timeline-step.is-active {
  color: #111;
}

.timeline-step.is-done span {
  background: #111;
}

.timeline-step.is-active span {
  background: var(--accent-2);
}

.download-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .65rem;
}

.download-list a {
  display: grid;
  gap: .2rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafaf8;
  text-decoration: none;
}

.download-list a:hover {
  border-color: #111;
}

.gallery-group + .gallery-group {
  margin-top: 1.25rem;
}

.gallery-group h3 {
  margin: .2rem 0 .75rem;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .85rem;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.gallery-media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 0;
  padding: 0;
  background: #111;
  cursor: zoom-in;
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-meta {
  display: grid;
  gap: .35rem;
  padding: .85rem;
}

.gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: space-between;
  margin-top: .25rem;
}

.favorite-button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #111;
  padding: .25rem .7rem;
  font-size: .78rem;
  font-weight: 900;
}

.favorite-button.is-active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.feedback-panel textarea {
  min-height: 120px;
}

.activity-feed {
  display: grid;
  gap: .6rem;
  margin-top: 1rem;
}

.activity-feed h3 {
  margin: 0;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.activity-feed > div {
  display: grid;
  gap: .15rem;
  padding: .7rem .8rem;
  border-left: 3px solid #111;
  background: #fafaf8;
}

.badge.info {
  background: #efefe9;
  color: #111;
  border-color: var(--border);
}

@media (max-width: 900px) {
  .portal-header {
    align-items: stretch;
    gap: .8rem;
  }

  .portal-actions {
    justify-content: space-between;
  }

  .portal-hero.cinematic {
    min-height: 480px;
  }

  .timeline-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
  }
}

@media (max-width: 600px) {
  .portal-main {
    width: min(100% - 1rem, 1220px);
    padding-top: .5rem;
  }

  .portal-hero.cinematic {
    min-height: 520px;
    background-image:
      linear-gradient(0deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .26)),
      var(--cover-image);
  }

  .portal-hero-content {
    padding: 1rem;
  }

  .portal-hero-content h1 {
    font-size: clamp(2rem, 14vw, 3.4rem);
  }

  .timeline-track,
  .download-list,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Final Lakta Studio repair overrides */
.lakta-navbar.portal-header {
  flex-direction: row;
  align-items: center;
  min-height: 72px;
  padding: .85rem clamp(1rem, 4vw, 2.4rem);
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 8px 24px rgba(17, 17, 17, .05);
  backdrop-filter: none;
}

.portal-brand {
  width: clamp(118px, 13vw, 168px);
  min-width: 110px;
  gap: 0;
}

.portal-brand .lakta-logo-mark {
  width: 100%;
}

.portal-brand .lakta-logo-mark svg {
  width: 100%;
}

.portal-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.portal-welcome-card,
.portal-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.portal-welcome-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.portal-welcome-card h1 {
  margin: .15rem 0 .2rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.portal-stat {
  display: grid;
  align-content: center;
  gap: .2rem;
  padding: 1rem;
  min-height: 96px;
}

.portal-stat span {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.portal-stat p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.portal-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card-image {
  position: relative;
  overflow: hidden;
}

.project-card-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(0deg, rgba(0,0,0,.52), transparent);
}

.project-card-image .badge {
  position: absolute;
  left: .75rem;
  bottom: .75rem;
  z-index: 1;
  background: rgba(255,255,255,.9);
}

.project-card-body {
  display: grid;
  gap: .25rem;
}

.project-card-meta strong {
  border: 1px solid #111;
  border-radius: 999px;
  padding: .25rem .65rem;
  color: #111;
  background: #fff;
  font-size: .78rem;
}

.portal-hero.cinematic {
  min-height: clamp(300px, 38vw, 460px);
}

.portal-hero-content h1 {
  font-size: clamp(2rem, 5.5vw, 4rem);
  max-width: 18ch;
}

.admin-media-selector label {
  min-width: min(360px, 80vw);
}

.admin-media-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.admin-media-hero h2 {
  margin: .15rem 0 .65rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.05;
}

.admin-media-badges,
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}

.admin-media-controls {
  display: grid;
  gap: .75rem;
}

.admin-media-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-upload-panel,
.admin-checklist-card,
.admin-media-library {
  box-shadow: var(--shadow-sm);
}

.upload-dropzone {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px dashed rgba(17,17,17,.24);
  border-radius: var(--radius);
  background: #fafaf8;
}

.checklist-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e4de;
  margin-bottom: .75rem;
}

.checklist-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #111;
}

.admin-checklist label {
  justify-content: flex-start;
  align-items: center;
  padding: .55rem 0;
}

.admin-checklist input {
  width: auto;
  flex: 0 0 auto;
}

.admin-media-library {
  margin-top: 1rem;
}

.admin-media-section + .admin-media-section {
  margin-top: 1.25rem;
}

.admin-media-section h3 {
  margin: .35rem 0 .8rem;
  font-size: .84rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .85rem;
}

.admin-media-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.admin-media-thumb {
  aspect-ratio: 4 / 3;
  background: #111;
}

.admin-media-thumb img,
.admin-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-media-meta {
  display: grid;
  gap: .45rem;
  padding: .85rem;
}

.admin-media-meta strong {
  line-height: 1.2;
}

@media (max-width: 900px) {
  .lakta-navbar.portal-header {
    flex-wrap: wrap;
    align-items: center;
  }
  .lakta-navbar__private {
    order: 3;
    width: 100%;
    margin: .2rem 0 0;
  }
  .portal-dashboard,
  .admin-media-hero,
  .admin-media-layout {
    grid-template-columns: 1fr;
  }
  .portal-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .lakta-navbar.portal-header {
    gap: .65rem;
  }
  .portal-brand {
    width: 120px;
  }
  .lakta-navbar__private-label {
    display: none;
  }
  .portal-user > span:last-child {
    max-width: 96px;
  }
  .portal-welcome-card {
    align-items: flex-start;
  }
  .portal-stats,
  .portal-project-grid,
  .admin-media-grid {
    grid-template-columns: 1fr;
  }
  .portal-stat {
    min-height: auto;
  }
  .portal-hero.cinematic {
    min-height: 320px;
  }
}

/* External media links: YouTube, Vimeo, Google Drive, Dropbox/direct URLs */
.admin-media-thumb iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox-stage iframe {
  width: min(94vw, 1180px);
  height: min(76vh, 664px);
  border: 0;
  border-radius: var(--radius);
  background: #000;
}

.external-media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: .35rem;
  text-align: center;
  color: #fff;
  background: radial-gradient(circle at top, rgba(255,255,255,.12), transparent 40%), #111;
}

.external-media-placeholder strong {
  font-size: .95rem;
}

.external-media-placeholder span {
  color: rgba(255,255,255,.7);
  font-size: .8rem;
}

/* Admin/client thumbnail and cover controls */
.cover-editor-form {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
}

.cover-editor-preview {
  aspect-ratio: 16 / 11;
  border-radius: calc(var(--radius) - 8px);
  background: #111 center / cover no-repeat;
  border: 1px solid rgba(17,17,17,.1);
}

.cover-editor-fields {
  display: grid;
  gap: .55rem;
}

.cover-editor-fields label,
.asset-poster-form label {
  font-size: .76rem;
}

.checks.compact {
  gap: .4rem;
}

.checks.compact label {
  font-size: .76rem;
  padding: .35rem .5rem;
}

.asset-poster-form {
  display: grid;
  gap: .45rem;
  padding: .6rem;
  border: 1px dashed rgba(17,17,17,.18);
  border-radius: calc(var(--radius) - 8px);
  background: #fafaf8;
}

.admin-media-thumb {
  position: relative;
  overflow: hidden;
}

.media-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  padding: .38rem .72rem;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  pointer-events: none;
}

.gallery-poster-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 600px) {
  .cover-editor-form {
    grid-template-columns: 1fr;
  }
}

.gallery-media {
  position: relative;
  overflow: hidden;
}
