.casting-agenda-app{--bg:#fff;--bg2:#f6f7fb;--text:#0f172a;--muted:#64748b;--border:#e5e7eb;--accent:#7c3aed;background:var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;line-height:1.35;min-height:100vh}
html.dark .casting-agenda-app{--bg:#0b1020;--bg2:#111a33;--text:#e5e7eb;--muted:#94a3b8;--border:#24314f;--accent:#a78bfa}
.casting-agenda-app,.casting-agenda-app *,.casting-agenda-app *::before,.casting-agenda-app *::after{box-sizing:border-box}
.ca-main{max-width:1200px;margin:0 auto;padding:18px 16px}
.ca-shell-header{position:sticky;top:0;z-index:50;background:var(--bg);border-bottom:1px solid var(--border)}
.ca-shell-header__inner{max-width:1200px;margin:0 auto;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:12px 16px}
.ca-shell-home{text-decoration:none;color:inherit;display:flex;align-items:center;gap:10px}
.ca-site-title{margin:0;font-size:16px;line-height:1;font-weight:800}
.ca-page-title{margin:0;text-align:center;font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ca-shell-nav{display:flex;align-items:center;justify-content:flex-end;gap:14px;white-space:nowrap}
.caHeaderLink{text-decoration:none;color:var(--text);opacity:.9;font-weight:700}
.caHeaderLink:hover{opacity:1}
.caIconBtn{border:0;background:transparent;padding:8px;border-radius:999px;cursor:pointer;color:var(--text)}
.caIconBtn:hover{background:rgba(0,0,0,.06)}
html.dark .caIconBtn:hover{background:rgba(255,255,255,.08)}
.ca-auth{display:flex;justify-content:center}
.ca-form{max-width:520px;margin:0 auto;display:flex;flex-direction:column;gap:12px}
.ca-form--wide{max-width:860px}
.ca-form h2{margin:6px 0 8px}
.ca-form label{display:flex;flex-direction:column;gap:8px;font-weight:700}
.ca-form input,.ca-form textarea,.ca-form select{width:100%;padding:12px;border-radius:12px;border:1px solid var(--border);background:var(--bg2);color:var(--text);outline:none}
.ca-form small{color:var(--muted);font-weight:600}
.ca-btn{width:100%;padding:12px 14px;border-radius:12px;border:0;background:var(--accent);color:#fff;font-weight:800;cursor:pointer}
.ca-auth-links{display:flex;justify-content:space-between;gap:12px;margin-top:6px}
.ca-auth-links a{color:var(--text);opacity:.9;font-weight:700}
.ca-alert{padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:var(--bg2)}
.ca-alert--ok{border-color:rgba(16,185,129,.5)}
.ca-divider{height:1px;background:var(--border);margin:18px 0}
.ca-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.ca-field-full{grid-column:1 / -1}
.ca-status-grid{display:grid;grid-template-columns:1.2fr 2fr 1fr .6fr .8fr;gap:10px;align-items:center}
.ca-status-head{font-weight:800;color:var(--muted)}
.ca-status-key{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;opacity:.9}
.ca-color-field{display:flex;align-items:center;gap:10px}
.ca-color{width:44px;height:44px;padding:0;border:1px solid var(--border);background:var(--bg2);border-radius:12px;cursor:pointer}
.ca-color-text{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.page-layout{display:grid;grid-template-columns:280px 1fr 280px;gap:16px;align-items:start}
#sidebar,#doneColumn{background:var(--bg2);border:1px solid var(--border);border-radius:16px;padding:12px}
#main{min-width:0}
.ca-sidehead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.ca-sidehead-title{font-weight:900}
.ca-badge{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:24px;padding:0 8px;border-radius:999px;background:rgba(124,58,237,.12);color:var(--text);font-weight:900}
.ca-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.ca-list li{display:flex;justify-content:space-between;gap:10px}
.ca-muted{color:var(--muted);font-weight:700}
.ca-calhead{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:10px;margin-bottom:10px}
.ca-caltitle{text-align:center;font-weight:900}
.ca-calbtn{border:1px solid var(--border);background:var(--bg2);border-radius:12px;padding:10px;cursor:pointer;font-weight:900}
.ca-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;color:var(--muted);font-weight:800;margin-bottom:8px}
.ca-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.ca-cell{border:1px solid var(--border);background:var(--bg);border-radius:14px;min-height:96px;padding:10px;display:flex;flex-direction:column;gap:8px}
.ca-dim{opacity:.55}
.ca-cell-date{font-weight:900;color:var(--muted)}
.ca-cell-items{display:flex;flex-direction:column;gap:6px}
.ca-chip{display:block;text-decoration:none;color:var(--text);background:var(--bg2);border:1px solid var(--border);border-radius:999px;padding:6px 10px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ca-status-pill{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:999px;padding:2px 7px;margin-right:8px;font-size:11px;font-weight:900;line-height:1;opacity:.95;white-space:nowrap}
.ca-chip{transition:background .12s ease,border-color .12s ease,transform .12s ease}
.ca-chip:hover{background:rgba(124,58,237,.10);border-color:rgba(124,58,237,.30)}
.ca-chip:focus-visible{outline:3px solid rgba(124,58,237,.35);outline-offset:2px}
.ca-footer{margin-top:12px;border:1px solid var(--border);background:var(--bg2);border-radius:16px;padding:12px}
.ca-foothead{font-weight:900;margin-bottom:10px}
.ca-footer-row{display:flex;justify-content:space-between;gap:10px;padding:6px 0}
.ca-num{font-weight:900}
.ca-actions{margin-top:10px}
.ca-btn-link{display:inline-block;text-decoration:none;background:var(--accent);color:#fff;font-weight:900;padding:10px 12px;border-radius:12px}
@media (max-width:1020px){.page-layout{grid-template-columns:1fr}}

#sidebar,#doneColumn{min-width:0}
.ca-cell{min-width:0}
.ca-chip{min-width:0}
.ca-footer-row span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.ca-footer-row{align-items:center}


.ca-footer--full{grid-column:1/-1;margin-top:0}
.ca-footer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.ca-footblock{min-width:0}
.ca-list--compact li{padding:6px 0}
.ca-list--compact .ca-chip{padding:5px 9px;font-weight:800}
.ca-chip--cal{font-size:12px;padding:6px 8px;border-radius:12px;white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;line-height:1.15}
.ca-cell-items .ca-chip--cal{background:var(--bg2)}
.ca-cell-items .ca-chip--cal{box-shadow:0 1px 0 rgba(0,0,0,.06)}
.ca-chip--cal:hover{transform:translateY(-1px)}
@media (max-width:1100px){.page-layout{grid-template-columns:1fr}.ca-footer-grid{grid-template-columns:1fr}}


/* Theme integration (optional): when Casting Agenda App Theme is active it adds body.ca-has-app */
body.ca-has-app .casting-agenda-app .ca-main,body.ca-has-app .casting-agenda-app .ca-shell-header__inner{max-width:1400px}


.ca-mainform{padding:10px}
.ca-mainform .ca-form{max-width:none}
.ca-mainform h2{margin-top:0}
/* Ensure list rows stay single-line */
.ca-list li{align-items:center}
.ca-list li .ca-muted, .ca-list li strong{white-space:nowrap}

.caHeaderLink--primary{font-weight:900;border:1px solid var(--border);background:var(--bg2);padding:8px 10px;border-radius:12px}
.caHeaderLink--primary:hover{filter:brightness(0.98)}


/* Secondary badge (e.g., production count) */
.casting-agenda-app .ca-badge.ca-badge--secondary{opacity:.75;font-size:.85em;min-width:auto;padding:4px 10px;}
