* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic', sans-serif; background: #f4f5f7; color: #222; }
.hidden { display: none !important; }
.banner { background: #e8659a; color: #fff; text-align: center; padding: 6px; font-weight: bold; letter-spacing: 0.1em; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #1b2a4a; color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.brand { font-weight: bold; font-size: 18px; line-height: 1.3; margin-bottom: 12px; }
.brand span { color: #f5a3c3; font-size: 14px; }
.userbox { background: #24365e; border-radius: 6px; padding: 8px 10px; font-size: 13px; word-break: break-all; }
.userbox .role { color: #f5a3c3; margin-top: 2px; }
.navbtn { background: transparent; color: #fff; border: 1px solid #3b4d76; border-radius: 6px; padding: 10px; text-align: left; cursor: pointer; font-size: 14px; }
.navbtn:hover:not(:disabled) { background: #2c3f6a; }
.navbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.note { margin-top: auto; font-size: 11px; color: #b6c0d8; line-height: 1.5; }
.content { flex: 1; padding: 24px 32px; max-width: 1000px; }
h1 { font-size: 22px; color: #1b2a4a; margin: 0 0 16px; }
h2 { font-size: 16px; color: #1b2a4a; margin: 22px 0 8px; border-left: 4px solid #e8659a; padding-left: 8px; }
.message { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.message.info { background: #e6ecf7; color: #1b2a4a; }
.message.ok { background: #e3f5e8; color: #1e6b3a; }
.message.error { background: #fdе7ef; background: #fde7ef; color: #b1234f; }
.readonly { background: #fff3cd; color: #7a5a00; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.hint { font-size: 12px; color: #666; margin: 4px 0 8px; }
.btn { display: inline-block; background: #fff; color: #1b2a4a; border: 1px solid #c9cfda; border-radius: 6px; padding: 8px 16px; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { background: #eef1f6; }
.btn.primary { background: #e8659a; color: #fff; border-color: #e8659a; }
.btn.primary:hover:not(:disabled) { background: #d4547f; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.devlogin { margin-top: 24px; padding: 14px; border: 1px dashed #e8659a; border-radius: 6px; background: #fff; }
.devlogin .btn { margin: 4px 6px 4px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid #e1e4ea; border-left: 5px solid #1b2a4a; border-radius: 8px; padding: 14px; }
.card h3 { margin: 0 0 6px; font-size: 16px; color: #1b2a4a; }
.meta { font-size: 12px; color: #555; margin: 2px 0 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
label { display: flex; flex-direction: column; font-size: 13px; color: #333; gap: 4px; }
label.inline { flex-direction: row; align-items: center; gap: 10px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #c9cfda; border-radius: 5px; background: #fff; }
input:disabled, select:disabled, textarea:disabled { background: #f0f1f4; color: #777; }
textarea { width: 100%; }
table.parts { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.parts th, table.parts td { border: 1px solid #e1e4ea; padding: 5px 6px; text-align: left; }
table.parts th { background: #e6ecf7; color: #1b2a4a; }
table.parts input[type='text'] { width: 100%; }
table.parts input[type='number'] { width: 90px; }
table.parts tr.inactive td { background: #f6f6f6; color: #999; }
.status { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
.status.on { background: #e3f5e8; color: #1e6b3a; }
.status.off { background: #eee; color: #888; text-decoration: line-through; }
.inactive-models { margin-top: 6px; }
.inactive-models .status { margin: 2px 6px 2px 0; }
table.parts td.assign { min-width: 260px; }
table.parts td.assign .capwrap { display: inline-flex; align-items: center; gap: 2px; margin: 0 10px 2px 0; font-size: 12px; }
table.parts td.assign .capwrap label.inline { margin: 0; }
table.parts td.assign input[type='number'] { width: 64px; padding: 3px 5px; }
table.parts td.assign label.inline { display: inline-flex; gap: 4px; margin: 0 10px 2px 0; font-size: 12px; }
table.parts td.assign .status { margin: 2px 6px 2px 0; }
.stepnote { font-size: 13px; font-weight: bold; color: #1b2a4a; margin: 0 0 10px; }
.stepnote:empty { display: none; }
.tablewrap { overflow-x: auto; margin-bottom: 8px; }
.tablewrap.conditions { max-height: 60vh; overflow: auto; }
table.conditions th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.conditions td { white-space: nowrap; }
table.conditions input[type='number'] { width: 110px; }
.eligible { margin-top: 20px; }
.eligible ul { font-size: 13px; color: #333; padding-left: 18px; }
.actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.savestatus { font-size: 12px; color: #666; }
.grid label.wide { grid-column: 1 / -1; }
h3 { font-size: 14px; color: #1b2a4a; margin: 16px 0 8px; }
table.studios { margin-bottom: 8px; }
table.studios td .btn { padding: 4px 10px; font-size: 12px; }
.pending { font-size: 13px; color: #555; padding-left: 18px; line-height: 1.8; }
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .content { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
}

.intake-access { margin: 24px 0; padding: 18px; background: #f5f7fb; border-radius: 8px; }
.intake-access input { width: 100%; }
.applications-table { min-width: 950px; }
.applications-table td { vertical-align: top; line-height: 1.7; }
.applications-table small { font-size: 10px; overflow-wrap: anywhere; }
