@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800;9..40,900&family=DM+Mono:wght@300;400;500&display=swap');

:root{
  --bg-primary:#060810;
  --bg-secondary:#08100e;
  --panel-bg:rgba(10,12,15,.94);
  --panel-bg-strong:rgba(8,9,12,.90);
  --panel-bg-alt:rgba(14,15,19,.97);
  --panel-border:rgba(52,56,70,.32);
  --panel-border-soft:rgba(52,56,70,.22);
  --nav-bg:rgba(8,9,12,.92);
  --brand-orange:#f97316;
  --orange-dim:rgba(249,115,22,.12);
  --orange-border:rgba(249,115,22,.32);
  --orange-glow:0 0 0 1px rgba(249,115,22,.14), 0 18px 36px rgba(249,115,22,.12);
  --accent-glow:0 0 0 1px rgba(249,115,22,.14), 0 18px 36px rgba(249,115,22,.12);
  --surface-glow:0 20px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.035);
  --card-glow:0 18px 36px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.025);
  --sync-nav-width:88px;
  --sync-nav-link-width:66px;
  --sync-nav-link-height:82px;
  --sync-nav-logo-size:66px;
  --sync-shell-max-width:1920px;
  --sync-shell-padding:10px;
  --sync-shell-gap:10px;
  --sync-font-body:'DM Sans', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --sync-font-mono:'DM Mono', "SF Mono", "Menlo", "Consolas", monospace;
}

body.production-shell-page{
  background:var(--bg-primary);
  color:var(--text, #dde5f5);
  font-family:var(--sync-font-body);
  position:relative;
}

body.production-shell-page::before,
body.production-shell-page::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
}

body.production-shell-page::before{
  background:
    radial-gradient(ellipse at -8% -12%, rgba(251,100,50,.22) 0%, rgba(200,60,20,.09) 34%, transparent 58%),
    radial-gradient(ellipse at 100% -10%, rgba(249,115,22,.10) 0%, rgba(180,70,6,.04) 36%, transparent 62%),
    radial-gradient(ellipse at 34% 104%, rgba(249,115,22,.06) 0%, transparent 58%),
    radial-gradient(ellipse at 88% 106%, rgba(245,158,11,.09) 0%, transparent 56%);
  filter:blur(14px);
}

body.production-shell-page::after{
  opacity:.07;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat:repeat;
  background-size:200px;
  mix-blend-mode:overlay;
  z-index:9998;
}

.app-content{
  width:100%;
  min-width:0;
  max-width:var(--sync-shell-max-width);
  margin:0 auto;
  box-sizing:border-box;
}

.app,
.sync-app{
  width:100%;
  min-width:0;
  max-width:var(--sync-shell-max-width);
  margin:0 auto;
  padding:var(--sync-shell-padding);
  gap:var(--sync-shell-gap);
  box-sizing:border-box;
  position:relative;
  z-index:1;
}

.sync-app{
  grid-template-columns:var(--sync-nav-width) var(--sync-content-cols, 1fr 1fr .92fr);
}

.nav,
.sync-nav{
  width:var(--sync-nav-width);
  min-width:var(--sync-nav-width);
  max-width:100%;
  height:100%;
  min-height:0;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  flex-direction:column;
  padding:8px 0 10px;
  border-radius:20px;
  background:var(--nav-bg);
  border:1px solid var(--panel-border);
  box-shadow:0 18px 36px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.03);
  backdrop-filter:blur(20px);
}

body.page-producer .nav{
  width:100%;
  min-width:0;
}

.nav-logo{
  width:var(--sync-nav-logo-size);
  height:var(--sync-nav-logo-size);
  margin-bottom:12px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  background:
    radial-gradient(circle at 50% 35%, rgba(249,115,22,.18), rgba(249,115,22,0) 55%),
    linear-gradient(180deg, rgba(18,14,10,.98), rgba(10,8,6,.98));
  border:1px solid rgba(249,115,22,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 0 0 1px rgba(249,115,22,.08),
    0 16px 30px rgba(249,115,22,.16);
  color:inherit;
  cursor:pointer;
  text-decoration:none;
  transition:border-color .18s, box-shadow .18s, transform .18s;
}

.nav-logo:hover,
.nav-logo.active{
  border-color:rgba(249,115,22,.50);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 0 1px rgba(249,115,22,.12),
    0 18px 34px rgba(249,115,22,.22);
  transform:translateY(-1px);
}

.nav-logo::after{
  content:"";
  position:absolute;
  inset:8px;
  border-radius:14px;
  border:1px solid rgba(249,115,22,.10);
  pointer-events:none;
}

.nav-logo-mark{
  display:flex;
  align-items:center;
  justify-content:center;
  filter:drop-shadow(0 0 8px rgba(249,115,22,.35));
}

.nav-logo-img{
  display:block;
  width:42px;
  height:42px;
  object-fit:contain;
  filter:drop-shadow(0 0 8px rgba(249,115,22,.35));
}

.nav-primary,
.nav-bottom{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

.nav-bottom,
.sync-nav .nav-bottom{
  margin-top:auto;
  padding-top:16px;
  position:relative;
}

.nav-bottom::before{
  content:"";
  position:absolute;
  top:6px;left:18px;right:18px;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(60,65,80,.55), transparent);
  opacity:.8;
}

.nav-link,
.sync-nav-link,
.page-settings-toggle{
  width:var(--sync-nav-link-width);
  min-width:var(--sync-nav-link-width);
  border-radius:16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:7px;
  flex-shrink:0;
  text-decoration:none;
}

.nav-link,
.sync-nav-link{
  height:var(--sync-nav-link-height);
  padding:10px 6px 8px;
  border:1px solid transparent;
  background:transparent;
  color:#6f7f9f;
  font-family:var(--sync-font-mono);
  transition:background .18s,color .18s,border-color .18s,transform .18s,box-shadow .18s;
}

.nav-link:hover,
.sync-nav-link:hover{
  background:rgba(249,115,22,.07);
  color:#e8d8c8;
  transform:translateY(-1px);
}

.nav-link.active,
.sync-nav-link.active{
  color:#fb923c;
  border-color:rgba(249,115,22,.32);
  background:
    linear-gradient(180deg, rgba(249,115,22,.13), rgba(249,115,22,.05)),
    linear-gradient(180deg, rgba(20,12,6,.96), rgba(13,8,4,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 0 0 1px rgba(249,115,22,.08),
    0 14px 26px rgba(249,115,22,.14);
}

.nav-link.secondary,
.sync-nav-link.secondary{
  opacity:.72;
}

.nav-link.secondary:hover,
.sync-nav-link.secondary:hover{
  opacity:.96;
}

.nav-link-icon{
  width:30px;
  height:30px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:currentColor;
  line-height:1;
  border:1px solid rgba(104,122,160,.22);
  background:linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

.nav-link-icon svg{
  width:18px;
  height:18px;
  display:block;
  stroke:currentColor;
  fill:none;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.nav-link.active .nav-link-icon,
.sync-nav-link.active .nav-link-icon{
  border-color:rgba(249,115,22,.28);
  box-shadow:0 0 14px rgba(249,115,22,.18), inset 0 1px 0 rgba(255,255,255,.03);
}

.nav-link-label{
  font-size:8px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  line-height:1.05;
  max-width:calc(var(--sync-nav-link-width) - 10px);
  overflow-wrap:normal;
  word-break:normal;
  font-family:var(--sync-font-mono);
}

.topbar,
.sync-topbar{
  min-height:60px;
  background:var(--panel-bg-strong);
  border:1px solid var(--panel-border);
  border-radius:18px;
  box-shadow:var(--surface-glow);
  backdrop-filter:blur(20px);
}

.topbar{
  display:grid;
  grid-template-columns:minmax(220px,.8fr) minmax(0,1fr) auto;
  align-items:center;
  gap:18px;
  padding:7px 16px;
}

.topbar-title{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:18px;
  align-self:center;
}

.sync-topbar-title{
  min-width:0;
  flex:0 1 280px;
  display:flex;
  align-items:center;
}

.topbar-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
}

.sync-topbar-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
}

.topbar-name,
.sync-topbar-name{
  font-family:var(--sync-font-body);
  font-size:20px;
  font-weight:700;
  letter-spacing:-.03em;
  color:var(--text, #dde5f5);
}

.topbar-meta,
.sync-topbar-meta{
  font-size:13px;
  color:var(--muted, #5c6b8a);
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.topbar-meta span,
.sync-topbar-meta span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.topbar-center{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  align-self:center;
}

.topbar-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  min-width:0;
  align-self:center;
}

.topbar .live-spine{
  margin-left:0;
  min-width:min(560px, 52vw);
}

.topbar .live-spine-cell,
.sync-live-spine-cell{
  background:linear-gradient(180deg, rgba(10,11,14,.96), rgba(7,8,11,.96));
  border-color:rgba(52,56,70,.38);
  border-radius:14px;
}

.sync-topbar{
  padding:7px 16px;
}

.sync-topbar .sync-live-spine{
  margin-left:auto;
}

body.production-shell-page .sync-topbar,
body.production-shell-page .sync-card{
  background:var(--panel-bg-strong);
  border-color:var(--panel-border);
  box-shadow:var(--surface-glow);
  backdrop-filter:blur(20px);
}

body.page-foh .topbar{
  grid-template-columns:minmax(180px,.72fr) minmax(340px,1fr) auto;
}

body.page-foh .topbar .live-spine{min-width:min(520px,44vw)}

body.page-lighting .topbar{
  grid-template-columns:minmax(180px,.72fr) minmax(340px,1fr) auto;
}

body.page-lighting .topbar .live-spine{min-width:min(520px,44vw)}

body.page-pm .topbar{
  grid-template-columns:minmax(210px,.72fr) minmax(320px,1fr) auto;
}

body.page-pm .topbar .live-spine{min-width:min(500px,40vw)}

body.page-pm .trt-pill,
body.page-foh .room-pill{
  margin-left:0;
}

@media(max-width:1080px) and (min-width:769px){
  :root{
    --sync-nav-width:76px;
    --sync-nav-link-width:58px;
    --sync-nav-link-height:74px;
    --sync-nav-logo-size:58px;
    --sync-shell-padding:7px;
    --sync-shell-gap:7px;
  }

  .sync-app{
    grid-template-columns:var(--sync-nav-width) var(--sync-content-cols-tablet, 1fr 1fr .78fr);
  }

  .nav,
  .sync-nav{
    padding:8px 0 10px;
    border-radius:18px;
  }

  .nav-primary,
  .nav-bottom{
    gap:6px;
  }

  .nav-link-icon{
    width:27px;
    height:27px;
    font-size:18px;
    border-radius:11px;
  }

  .nav-link-label{
    font-size:8px;
    letter-spacing:.08em;
  }

  .topbar,
  .sync-topbar{
    min-height:46px;
    border-radius:16px;
    padding:8px 10px;
    gap:8px;
  }

  .topbar{
    grid-template-columns:minmax(150px,.8fr) minmax(0,1fr) auto;
  }

  .topbar-title{gap:10px}
  .topbar-name,
  .sync-topbar-name{font-size:18px}
  .topbar-meta,
  .sync-topbar-meta{font-size:10px;gap:4px}
  .topbar-row{gap:6px}
  .topbar .live-spine{min-width:132px}
}

@media(max-width:768px){
  :root{
    --sync-nav-width:76px;
    --sync-nav-link-width:58px;
    --sync-nav-link-height:74px;
    --sync-nav-logo-size:58px;
    --sync-shell-padding:7px;
    --sync-shell-gap:7px;
  }

  .sync-app{
    grid-template-columns:var(--sync-nav-width) var(--sync-content-cols-mobile, 1fr 1fr);
  }

  .sync-app{
    grid-template-columns:var(--sync-nav-width) 1fr;
  }

  .nav,
  .sync-nav{
    grid-row:1 / -1;
    flex-direction:column;
    padding:8px 0 10px;
    border-radius:18px;
  }

  .nav-primary,
  .nav-bottom{
    gap:6px;
  }

  .topbar,
  .sync-topbar{
    min-height:88px;
    border-radius:16px;
    padding:8px 10px;
    gap:7px;
  }

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

  .topbar-title,
  .topbar-center,
  .topbar-row{
    width:100%;
  }

  .topbar-title{
    align-items:flex-start;
    flex-direction:column;
    gap:6px;
  }

  .topbar-name,
  .sync-topbar-name{font-size:18px}
  .topbar-meta,
  .sync-topbar-meta{font-size:10px;gap:4px}
  .topbar-row{flex-wrap:wrap;justify-content:flex-start}
  .topbar .live-spine{width:100%;min-width:0}

  .sync-topbar,
  .sync-col,
  .sync-col-left,
  .sync-col-mid,
  .sync-col-right,
  .sync-col-span,
  .sync-home-main{
    grid-column:2;
  }

  .sync-home-main{
    grid-template-columns:1fr;
  }

  .sync-home-main > :first-child{
    grid-column:auto;
  }
}
