/* Final layout and responsive pass */
html,body{max-width:100%;overflow-x:hidden}button,input,select,textarea{max-width:100%}.sidebar nav{min-width:0}.topbar,.hero-row,.section-head,.panel-head{gap:16px}.topbar>div:first-child,.hero-row>div:first-child,.section-head>div:first-child,.panel-head>div:first-child{min-width:0}.metric{min-width:0}.metric strong{overflow-wrap:anywhere}.table-wrap{width:100%}table{table-layout:auto}th,td{vertical-align:middle}td:first-child{min-width:145px}td:nth-child(2){min-width:120px}td:last-child{width:44px;text-align:center}
body.deploy-mode .storage-note small{color:#9fe0c0}

dialog{max-height:92vh;overflow:hidden}#leadForm,#deliverableForm{padding:26px;max-height:92vh;overflow-y:auto;overscroll-behavior:contain}.modal-head{position:sticky;top:-26px;z-index:3;background:#fff;padding-top:26px;padding-bottom:12px}.modal-actions{position:sticky;bottom:-26px;z-index:3;background:#fff;padding-bottom:26px}.form-grid>*{min-width:0}.form-grid textarea{resize:vertical}.production-card-head>div{min-width:0}.production-card h3,.production-card p{overflow-wrap:anywhere}.progress-meta{gap:10px}.progress-meta span:last-child{text-align:right}.workload-panel{align-self:start;position:sticky;top:20px}

@media(max-width:1050px) and (min-width:721px){.sidebar{width:220px}main{margin-left:220px}.nav-item{padding-inline:11px}.brand{padding-inline:6px}.production-layout{grid-template-columns:minmax(0,1fr) 240px}}

@media(max-width:720px){
  .sidebar{position:sticky;top:0;z-index:10;gap:8px;box-shadow:0 5px 20px rgba(10,15,22,.16)}.brand{font-size:17px;gap:8px}.brand-mark{width:34px;height:34px}.sidebar nav{gap:4px}.sidebar .nav-item{padding:10px 12px}.sidebar .nav-item span{font-size:18px}
  main{padding-bottom:36px}.topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;height:auto;min-height:116px;padding:19px 0;margin-bottom:32px;align-items:start}.topbar h1{font-size:22px}.top-actions{align-items:stretch;gap:8px}.top-actions .primary{white-space:nowrap}.search{height:36px}
  .hero-row,.section-head{align-items:flex-start}.section-head{flex-wrap:wrap}.section-head .filters{margin-left:auto}.section-head>.primary{margin-left:auto;white-space:nowrap}.metrics{gap:12px}.metric{min-height:100px}.panel{padding:18px}.follow-item{grid-template-columns:38px minmax(0,1fr) auto auto}.follow-item p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .table-wrap{padding:0;background:transparent;border:0;overflow:visible}table,tbody,tr,td{display:block;width:100%}thead{display:none}tbody{display:grid;gap:12px}tr{background:#fff;border:1px solid var(--line);border-radius:14px;padding:8px 16px;box-shadow:0 5px 18px rgba(35,34,45,.035)}td{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;align-items:center;min-width:0!important;width:auto!important;padding:10px 0;border-top:1px solid #f0eee9;text-align:left!important}td:first-child{border-top:0}td::before{font-size:9px;line-height:1.2;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}td:nth-child(1)::before{content:'Couple / Client'}td:nth-child(2)::before{content:'Wedding'}td:nth-child(3)::before{content:'Source'}td:nth-child(4)::before{content:'Interest'}td:nth-child(5)::before{content:'Stage'}td:nth-child(6)::before{content:'Budget'}td:nth-child(7)::before{content:'Follow-up'}td:nth-child(8)::before{content:'Actions'}td .row-action{justify-self:start}
  .production-card{padding:15px}.production-card-head{align-items:flex-start}.production-card-foot{display:block}.progress-meta{font-size:9px}.workload-panel{position:static}.modal-head{top:-20px;padding-top:20px}.modal-actions{bottom:-20px;padding-bottom:20px}#leadForm,#deliverableForm{padding:20px}.modal-actions{grid-template-columns:auto 1fr auto}.modal-actions .secondary{display:none}.modal-actions .primary{white-space:nowrap}
}

@media(max-width:520px){
  .sidebar{padding:12px}.brand span:last-child{display:none}.sidebar nav{margin-left:auto}.sidebar .nav-item{padding:9px 11px}.topbar{grid-template-columns:1fr}.top-actions{display:grid;grid-template-columns:1fr auto;flex-direction:unset}.search{display:flex;width:100%}.hero-row h2,.section-head h2{font-size:21px}.metrics{grid-template-columns:1fr}.roi-main{padding-inline:0}.roi-stats{gap:8px}.roi-stats div+div{padding-left:8px}.follow-item{grid-template-columns:36px minmax(0,1fr) auto}.follow-item .tag{display:none}.section-head .filters{width:100%;display:grid;grid-template-columns:1fr 1fr}.filters select{width:100%}.section-head>.primary{margin-left:0}.production-card-head{gap:8px}.status-pill{white-space:nowrap}.progress-meta{align-items:flex-end}.modal-actions{grid-template-columns:auto 1fr}.modal-actions .primary{grid-column:2}.danger-link{grid-column:1}.modal-actions span{display:none}dialog{width:calc(100vw - 20px)}
}

@media(max-width:720px){td .tag,td .date-chip{justify-self:start}}
