/* Interfaz de CampusPY: encabezado y editor de materias. */
.campus-preview-header{position:sticky;top:0;z-index:60;height:72px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 24px;background:var(--navy);color:#f3f7ff;border-bottom:1px solid #526680}
.campus-header-brand{display:flex;align-items:center;gap:12px;min-width:0}
.campus-preview-header .app-brand{font-size:20px;white-space:nowrap;gap:10px}
.campus-preview-header .app-brand img{width:36px;height:36px;border-radius:10px}
.campus-header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.campus-header-icon{display:grid;place-items:center;width:42px;height:42px;padding:0;border:1px solid #526680;border-radius:13px;background:#ffffff08;color:inherit;cursor:pointer}
.campus-preview-header+.shell{min-height:calc(100dvh - 72px)}
@media(min-width:701px){.campus-preview-header+.shell .sidebar{top:72px;height:calc(100dvh - 72px)}}
@media(max-width:700px){
  .campus-preview-header{height:66px;padding:10px 14px;gap:8px}
  .campus-header-brand{gap:9px}
  .campus-preview-header .app-brand{font-size:18px;gap:8px}
  .campus-preview-header .app-brand img{width:32px;height:32px}
  .campus-preview-header .mobile-menu-toggle{width:36px;height:40px;flex-basis:36px;font-size:23px;border:0}
  .campus-header-actions{gap:8px}
  .campus-header-icon{width:38px;height:40px;border-radius:12px}
  .campus-preview-header+.shell{min-height:calc(100dvh - 66px)}
  .campus-preview-header+.shell .sidebar{position:relative;display:block;height:0;padding:0;z-index:55}.campus-preview-header+.shell .sidebar .overline,.campus-preview-header+.shell .sidebar .side-bottom{display:none}.campus-preview-header+.shell .sidebar nav{top:0;left:0;right:0}
}
.design-subject-popover{--sheet-accent:#3568a8;--sheet-accent-soft:#e6effc;position:fixed;inset:0;margin:auto;width:min(600px,calc(100% - 40px));max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--line);border-radius:24px;overflow:hidden;color:var(--ink);box-shadow:0 24px 80px #0006}
.design-subject-popover[open]{display:flex;flex-direction:column}
.design-subject-popover::backdrop{background:#07111fbc;backdrop-filter:blur(4px)}
.subject-sheet-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 26px 20px;border-bottom:1px solid var(--line);flex-shrink:0}
.subject-sheet-eyebrow{font-size:9px;font-weight:800;letter-spacing:1.6px;color:var(--sheet-accent)}
.subject-sheet-header h2{font-size:26px;letter-spacing:-.8px;margin:8px 0 5px}
.subject-sheet-header p{font-size:13px;margin:0}
.subject-sheet-close{display:grid;place-items:center;flex:0 0 40px;height:40px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--muted)}
.subject-sheet-body{padding:22px 26px;overflow-y:auto;overscroll-behavior:contain;min-height:0}
.subject-form-section+ .subject-form-section{border-top:1px solid var(--line);margin-top:24px;padding-top:22px}
.subject-section-title{display:flex;align-items:center;gap:10px;margin-bottom:18px}
.subject-section-title>span{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:var(--soft);color:var(--muted);font-size:10px;font-weight:800}
.subject-section-title h3{font-size:16px;margin:0}
.subject-name-label{display:block;font-size:12px;font-weight:650}
.subject-name-label>span{color:var(--sheet-accent)}
.subject-name-label input{margin-top:9px;min-height:48px}
.design-subject-popover fieldset{border:0;padding:0;margin:0;min-width:0}
.design-subject-popover legend{font-size:12px;font-weight:650;margin-bottom:10px}
.design-subject-popover .subject-colors{margin-top:18px}
.subject-colors>div{display:flex;gap:14px;flex-wrap:wrap}
.subject-color-option{position:relative;display:grid;place-items:center;width:34px;height:34px;cursor:pointer}
.subject-color-option input,.subject-type-option input,.subject-day input{position:absolute;width:1px;height:1px;opacity:0;margin:0;padding:0;border:0;clip-path:inset(50%)}
.subject-color-option>span{width:26px;height:26px;background:var(--swatch);border-radius:50%;box-shadow:inset 0 0 0 1px #ffffff20}
.subject-color-option input:checked+span{outline:2px solid var(--ink);outline-offset:3px}
.subject-color-option:focus-within{outline:2px solid var(--sheet-accent);outline-offset:4px;border-radius:50%}
.subject-section-help{font-size:12px;line-height:1.65;margin:-4px 0 16px}
.subject-type-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:18px}
.subject-type-option{display:flex;align-items:center;gap:9px;position:relative;min-width:0;border:1px solid var(--line);border-radius:14px;padding:13px 12px;cursor:pointer}
.subject-type-option:has(input:checked){background:var(--sheet-accent-soft);border-color:var(--sheet-accent)}
.subject-type-option:focus-within,.subject-day:focus-within{outline:2px solid var(--sheet-accent);outline-offset:3px}
.subject-type-icon{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:8px;font-size:13px;font-weight:800;background:var(--soft);color:var(--sheet-accent)}
.subject-type-option strong{display:block;font-size:13px}
.subject-type-option small{display:block;font-size:10px;margin-top:2px;line-height:1.35}
.subject-type-check{margin-left:auto;color:var(--sheet-accent);opacity:0;font-weight:800}
.subject-type-option:has(input:checked) .subject-type-check{opacity:1}
.subject-session{border:1px solid var(--line);border-radius:16px;padding:16px;margin-top:14px}
.subject-session-heading{display:flex;align-items:center;gap:10px;margin-bottom:18px}
.subject-session-mark{display:grid;place-items:center;flex:0 0 32px;height:32px;background:#2a3552;color:#bdd0ff;font-size:13px;font-weight:800;border-radius:10px}
.practice-session .subject-session-mark{background:#3b324b;color:#d8baff}
.subject-session-heading h4{font-size:14px;margin:0 0 3px}
.subject-session-heading p{font-size:10px;line-height:1.4;margin:0}
.subject-weekly-badge{margin-left:auto;align-self:flex-start;border:1px solid var(--line);border-radius:6px;padding:3px 6px;font-size:9px;color:var(--muted)}
.subject-days>div{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.subject-day{position:relative;cursor:pointer;min-width:0}
.subject-day>span{display:grid;place-items:center;min-height:40px;border:1px solid var(--line);border-radius:9px;font-size:11px;color:var(--muted)}
.subject-day:has(input:checked)>span{background:var(--sheet-accent-soft);border-color:var(--sheet-accent);color:var(--ink);font-weight:750}
.subject-time-range{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:end;margin-top:16px}
.subject-time-range label,.subject-extra-fields label{display:block;font-size:12px;font-weight:650;min-width:0}
.subject-time-range>span{padding-bottom:12px;color:var(--muted)}
.subject-time-range input{min-height:46px}
.subject-extra{border-top:1px solid var(--line);padding-top:13px;margin-top:16px;font-size:12px}
.subject-extra summary{font-weight:650;color:var(--ink)}
.subject-extra summary span{font-weight:400;color:var(--muted)}
.subject-extra-fields{display:grid;gap:14px;margin-top:16px}
.subject-another-time{border:0;background:transparent;color:var(--sheet-accent);font-size:11px;font-weight:650;padding:14px 0 0}
.subject-no-sessions{padding:18px;border:1px dashed var(--line);border-radius:12px;font-size:12px;line-height:1.6}
.design-subject-popover:not(:has(#includeTheory:checked)) .theory-session,.design-subject-popover:not(:has(#includePractice:checked)) .practice-session,.design-subject-popover:has(.subject-type-option input:checked) .subject-no-sessions{display:none}
.subject-sheet-footer{flex-shrink:0;border-top:1px solid var(--line);padding:14px 26px 18px;background:var(--campus-surface,#fff)}
.subject-sheet-footer>p{font-size:10px;margin:0 0 12px;text-align:center;color:var(--muted)}
.subject-sheet-footer>div{display:flex;gap:10px}
.subject-sheet-footer button{min-height:46px}
.subject-sheet-footer .primary{flex:1;background:var(--sheet-accent)!important;border-color:var(--sheet-accent)!important;color:#142b4a!important}
.design-subject-popover button:disabled{cursor:not-allowed;opacity:.5}
.schedule-add[popovertarget]:hover{background:var(--soft);color:var(--accent)}
@media(max-width:600px){
  .design-subject-popover{inset:auto 0 0;width:100%;max-height:94dvh;margin:0;border-radius:24px 24px 0 0}
  .subject-sheet-header{padding:20px 20px 16px}
  .subject-sheet-header h2{font-size:24px}
  .subject-sheet-body{padding:20px}
  .subject-sheet-footer{padding:12px 20px max(16px,env(safe-area-inset-bottom))}
  .subject-type-option{padding:12px 9px;gap:7px}
  .subject-type-option small{font-size:9px}
  .subject-type-icon{flex-basis:24px;height:28px}
  .subject-session{padding:14px}
}

.design-subject-popover{background:var(--campus-surface,#fff)}
.design-subject-popover>form{display:flex;flex-direction:column;min-height:0;max-height:inherit;margin:0}
body[data-color-mode=dark] .design-subject-popover{--sheet-accent:#91baff;--sheet-accent-soft:#233c5c}
.subject-sheet-footer .primary{color:#fff!important}
body[data-color-mode=dark] .subject-sheet-footer .primary{color:#142b4a!important}
.subject-class-row.subject-session{display:block}
.subject-class-row .subject-time-range label{margin:0}
.subject-day{margin:0}
.subject-type-option{margin:0}
.subject-color-option{margin:0}
.custom-subject-color{display:flex;align-items:center;gap:12px;font-size:12px;margin-top:12px}
.custom-subject-color input{width:40px;height:32px;padding:2px;margin:0}
.subject-session-buttons{display:flex;gap:18px;flex-wrap:wrap}
.design-subject-popover:not(:has(#includeTheory:checked)) #addSubjectClass,.design-subject-popover:not(:has(#includePractice:checked)) #addPracticeClass{display:none}
.subject-remove-time{display:block;margin-top:14px;color:var(--muted)}
.campus-preview-header .campus-header-icon{color:#f3f7ff;background:#ffffff08;border-color:#526680;border-radius:13px}
.campus-preview-header .campus-header-icon:hover{background:#ffffff20}
.subject-class-kind{display:block;font-weight:700}
@media(max-width:700px){.campus-preview-header+.shell{display:block}.campus-preview-header+.shell .sidebar nav.is-open{position:absolute;background:var(--navy);padding:14px;max-height:calc(100dvh - 140px);overflow-y:auto}.campus-preview-header+.shell main{padding-top:0}}
/* Keep native controls across the whole card for touch and keyboard access. */
.subject-color-option input,.subject-type-option input,.subject-day input{inset:0;width:100%;height:100%;clip-path:none;z-index:1;cursor:pointer}
/* Override the browser's default dialog width limit on the mobile sheet. */
.design-subject-popover{max-width:100%}
