*{box-sizing:border-box}body{margin:0;background:#f2f4f7;color:#16202a;font-family:Inter,Segoe UI,Arial,sans-serif}.layout{min-height:100vh;display:grid;grid-template-columns:235px 1fr}.side{background:#111820;color:#fff;padding:24px 18px;position:sticky;top:0;height:100vh}.brand{display:flex;gap:7px;align-items:end;font-size:24px;margin-bottom:28px}.brand span{font-size:13px;color:#9fb0c0}.side nav{display:grid;gap:5px}.side a{color:#dbe4ec;text-decoration:none;padding:10px 12px;border-radius:8px}.side a:hover{background:#222d38;color:#fff}.side hr{border:0;border-top:1px solid #33404d;width:100%;margin:12px 0}main{padding:24px 30px;min-width:0}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.top h1{margin:0;font-size:25px}.top p{margin:5px 0 0;color:#667085}.user{text-align:right;display:grid}.user span{font-size:12px;color:#667085}.grid{display:grid;gap:16px}.grid.cards{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.card{background:#fff;border:1px solid #e4e7ec;border-radius:12px;padding:18px;box-shadow:0 2px 8px #1018280a}.card h2,.card h3{margin-top:0}.stat{font-size:30px;font-weight:800;margin-top:6px}.muted{color:#667085}.row{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.field{display:grid;gap:6px;min-width:150px;flex:1}.field label{font-size:13px;font-weight:700}.field input,.field select,.field textarea{width:100%;padding:10px 11px;border:1px solid #cfd5dc;border-radius:8px;background:#fff}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;background:#1f2937;color:#fff;text-decoration:none;padding:10px 15px;border-radius:8px;cursor:pointer;font-weight:700}.btn.secondary{background:#eef2f6;color:#273444}.btn.danger{background:#b42318}.btn.green{background:#166534}.table{width:100%;border-collapse:collapse}.table th,.table td{border-bottom:1px solid #eaecf0;padding:10px 9px;text-align:left;font-size:13px;vertical-align:top}.table th{font-size:12px;text-transform:uppercase;color:#667085;background:#fafafa}.table-wrap{overflow:auto}.badge{display:inline-block;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;background:#eef2f6}.badge.ok{background:#dcfae6;color:#067647}.badge.err{background:#fee4e2;color:#b42318}.alert{padding:12px 15px;border-radius:8px;margin-bottom:16px;background:#eff8ff;color:#175cd3}.alert.success{background:#ecfdf3;color:#067647}.alert.error{background:#fef3f2;color:#b42318}.errors{background:#fef3f2;border:1px solid #fecdca;color:#b42318;border-radius:8px;padding:12px 14px;margin:12px 0}.service-group{margin-bottom:14px}.service-group h3{display:flex;justify-content:space-between;font-size:15px;margin:0 0 6px}.slot{display:grid;grid-template-columns:210px 1fr 1fr;gap:10px;padding:8px;border-top:1px solid #eee;font-size:13px}.changed{font-weight:800;color:#b54708}.login{min-height:100vh;display:grid;place-items:center;background:#111820}.login .box{width:min(420px,92vw);background:#fff;border-radius:14px;padding:26px}.login h1{margin-top:0}.login .field{margin:12px 0}.login .btn{width:100%}@media(max-width:850px){.layout{grid-template-columns:1fr}.side{height:auto;position:static}.side nav{grid-template-columns:repeat(2,1fr)}main{padding:18px}.slot{grid-template-columns:1fr}}

/* =========================================================
   ESCALA 3.0 — GRADE MENSAL COMPACTA
   ========================================================= */
.schedule-toolbar{
    background:#fff;
    border:1px solid #e4e7ec;
    border-radius:14px;
    padding:14px 16px 12px;
    box-shadow:0 2px 8px #1018280a;
    margin-bottom:14px;
}
.schedule-toolbar-main{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    flex-wrap:wrap;
}
.schedule-month-nav{display:flex;align-items:center;gap:12px}
.month-arrow{
    width:38px;height:38px;border-radius:9px;display:grid;place-items:center;
    background:#eef2f6;color:#172033;text-decoration:none;font-size:28px;line-height:1;font-weight:600;
}
.month-arrow:hover{background:#dfe6ee}
.schedule-month-title{font-size:18px;font-weight:850;letter-spacing:.02em}
.schedule-month-subtitle{font-size:12px;color:#667085;margin-top:2px}
.schedule-toolbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.month-picker-form{display:flex;gap:8px;align-items:center}
.month-picker-form input[type=month]{height:38px;border:1px solid #cfd5dc;border-radius:8px;padding:0 10px;background:#fff;color:#16202a}
.schedule-legend{display:flex;align-items:center;gap:14px;flex-wrap:wrap;border-top:1px solid #edf0f3;margin-top:12px;padding-top:10px;font-size:11px;font-weight:700;color:#475467}
.schedule-legend>span{display:inline-flex;align-items:center;gap:5px}
.legend-box{width:13px;height:13px;border-radius:3px;border:1px solid #c9d0da;background:#fff;display:inline-block}
.legend-box.service{background:#111820;border-color:#111820}
.legend-box.weekend{background:#d92d20;border-color:#d92d20}
.legend-box.status-f{background:#fff27a;border-color:#e1cf38}
.legend-box.status-l{background:#17a34a;border-color:#16853f}
.legend-box.status-m{background:#d946ef;border-color:#b72fc9}

.schedule-card{
    background:#fff;
    border:1px solid #dfe4ea;
    border-radius:12px;
    box-shadow:0 3px 12px rgba(16,24,40,.05);
    overflow:hidden;
}
.schedule-grid-wrap{
    overflow:auto;
    width:100%;
    max-height:calc(100vh - 225px);
    scrollbar-color:#98a2b3 #eef2f6;
}
.schedule-table{
    border-collapse:separate;
    border-spacing:0;
    table-layout:fixed;
    width:max-content;
    min-width:100%;
    background:#fff;
    font-variant-numeric:tabular-nums;
}
.schedule-table th,.schedule-table td{padding:0;border:0}
.schedule-table thead th{
    position:sticky;top:0;z-index:8;
    height:44px;
    background:#edf0f3;
    border-right:1px solid #cfd5dc;
    border-bottom:1px solid #bfc7d1;
    color:#344054;
    text-align:center;
}
.schedule-table .military-col{
    position:sticky;left:0;z-index:7;
    width:190px;min-width:190px;max-width:190px;
    background:#f7f8fa;
    border-right:2px solid #aeb8c5;
}
.schedule-table thead .military-col{
    z-index:12;
    text-align:left;
    padding:0 12px;
    font-size:11px;
    letter-spacing:.04em;
}
.schedule-table .day-col{width:38px;min-width:38px;max-width:38px}
.schedule-table .day-number{display:block;font-size:12px;font-weight:850;line-height:14px;margin-top:7px}
.schedule-table .day-name{display:block;font-size:8px;font-weight:800;line-height:10px;color:#667085}
.schedule-table thead .is-nonwork{background:#d92d20;color:#fff}
.schedule-table thead .is-nonwork .day-name{color:#fff}
.schedule-table thead .is-today{box-shadow:inset 0 0 0 2px #1570ef}

.schedule-table tbody tr:nth-child(even) .military-name{background:#f3f5f7}
.schedule-table tbody tr:hover .military-name{background:#e9eef5}
.schedule-table tbody td{
    height:29px;
    border-right:1px solid #d6dce4;
    border-bottom:1px solid #d6dce4;
    background:#fff;
}
.schedule-table tbody td.is-nonwork{background:#fff4f3}
.schedule-table tbody td.is-today{box-shadow:inset 1px 0 #84adff,inset -1px 0 #84adff}
.schedule-table .military-name{
    height:29px;
    padding:0 9px;
    display:flex;
    align-items:center;
    gap:7px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:11px;
    font-weight:800;
    color:#172033;
}
.military-order{
    width:20px;min-width:20px;height:18px;display:grid;place-items:center;
    border-radius:4px;background:#e4e9ef;color:#667085;font-size:9px;font-weight:800;
}
.schedule-td{width:38px;min-width:38px;max-width:38px;text-align:center}
.schedule-cell-form{margin:0;width:100%;height:100%}
.schedule-cell{
    appearance:none;-webkit-appearance:none;
    border:0;border-radius:0;margin:0;padding:0;
    width:100%;height:28px;
    display:grid;place-items:center;
    background:transparent;color:#667085;
    cursor:pointer;
    font-size:10px;font-weight:750;
    line-height:1;
    transition:box-shadow .08s ease,filter .08s ease,transform .08s ease;
}
.schedule-cell:hover{box-shadow:inset 0 0 0 2px #98a2b3;position:relative;z-index:2}
.schedule-cell.is-editing{box-shadow:inset 0 0 0 2px #1570ef;position:relative;z-index:3}
.schedule-cell.service{background:#111820;color:#fff;font-size:11px;font-weight:900}
.schedule-cell.status{font-weight:900;color:#172033}
.schedule-cell.status-f{background:#fff27a}
.schedule-cell.status-l{background:#17a34a;color:#fff}
.schedule-cell.status-ap{background:#eaf2ff;color:#175cd3}
.schedule-cell.status-b{background:#111;color:#fff}
.schedule-cell.status-p{background:#f4a024;color:#172033}
.schedule-cell.status-d{background:#7f56d9;color:#fff}
.schedule-cell.status-i{background:#fde047;color:#172033}
.schedule-cell.status-m{background:#d946ef;color:#fff}
.schedule-cell.status-o{background:#ffd6f5;color:#172033}

.cell-picker{
    position:fixed;z-index:1000;
    width:300px;
    background:#fff;
    border:1px solid #d0d5dd;
    border-radius:12px;
    box-shadow:0 18px 42px rgba(16,24,40,.22);
    padding:10px;
}
.cell-picker[hidden]{display:none}
.cell-picker-title{font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:850;color:#667085;margin:2px 3px 8px}
.cell-picker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.picker-option{
    border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#172033;
    padding:7px 5px;min-height:50px;cursor:pointer;text-align:center;
}
.picker-option:hover{filter:brightness(.96);border-color:#98a2b3}
.picker-option b{display:block;font-size:12px}
.picker-option small{display:block;margin-top:2px;font-size:8px;line-height:10px;opacity:.75}
.picker-option.service{background:#111820;color:#fff;border-color:#111820}
.picker-option.status-F{background:#fff27a}
.picker-option.status-L{background:#17a34a;color:#fff}
.picker-option.status-AP{background:#eaf2ff;color:#175cd3}
.picker-option.status-B{background:#111;color:#fff}
.picker-option.status-P{background:#f4a024}
.picker-option.status-D{background:#7f56d9;color:#fff}
.picker-option.status-I{background:#fde047}
.picker-option.status-M{background:#d946ef;color:#fff}
.picker-option.status-O{background:#ffd6f5}
.picker-option.clear{background:#f2f4f7;color:#475467}
.schedule-empty{
    display:grid;gap:5px;text-align:center;padding:34px;background:#fff;border:1px solid #e4e7ec;border-radius:12px;color:#475467
}
.schedule-empty strong{color:#172033;font-size:16px}

@media(max-width:850px){
    .schedule-toolbar-main{align-items:stretch}
    .schedule-toolbar-actions{width:100%}
    .schedule-toolbar-actions form{flex:1}
    .schedule-toolbar-actions .btn{width:100%}
    .month-picker-form input[type=month]{min-width:0;flex:1}
    .schedule-grid-wrap{max-height:none}
    .schedule-table .military-col{width:155px;min-width:155px;max-width:155px}
    .schedule-table .day-col,.schedule-td{width:35px;min-width:35px;max-width:35px}
}


/* =========================================================
   ESCALA 3.0 — CALENDÁRIO OPERACIONAL
   ========================================================= */
.schedule-table thead .is-admin-day{
    background:#fff;
    color:#344054;
    box-shadow:inset 0 -3px 0 #f5c842;
}
.schedule-table thead .is-admin-day .day-name{color:#667085}
.schedule-table tbody td.is-admin-day{background:#fff}
.day-admin-mark{
    position:absolute;
    top:1px;
    right:2px;
    border-radius:3px;
    padding:1px 2px;
    font-size:6px;
    line-height:1;
    font-weight:900;
    background:#f5c842;
    color:#3b2f00;
}
.schedule-table .day-col{position:sticky}

.calendar-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:14px;
}
.calendar-month-nav{display:flex;align-items:center;gap:12px}
.calendar-rules{
    display:grid;
    grid-template-columns:repeat(3,minmax(180px,1fr));
    gap:10px;
    margin-bottom:14px;
}
.calendar-rule{
    border:1px solid #d0d5dd;
    border-radius:10px;
    padding:10px 12px;
    display:grid;
    gap:3px;
    background:#fff;
}
.calendar-rule b{font-size:12px}
.calendar-rule span{font-size:10px;color:#667085}
.calendar-rule.red{background:#d92d20;color:#fff;border-color:#d92d20}
.calendar-rule.red span{color:#fff}
.calendar-rule.admin{box-shadow:inset 0 -4px 0 #f5c842}

.calendar-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 330px;
    gap:14px;
    align-items:start;
}
.calendar-card{padding:12px;overflow:hidden}
.calendar-weekdays{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    background:#eef1f4;
    border:1px solid #d6dce4;
    border-bottom:0;
}
.calendar-weekdays div{
    padding:8px 4px;
    text-align:center;
    font-size:10px;
    font-weight:900;
    color:#475467;
    border-right:1px solid #d6dce4;
}
.calendar-weekdays div:last-child{border-right:0}
.calendar-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    border-left:1px solid #d6dce4;
    border-top:1px solid #d6dce4;
}
.calendar-day{
    min-height:104px;
    border:0;
    border-right:1px solid #d6dce4;
    border-bottom:1px solid #d6dce4;
    padding:8px;
    text-align:left;
    background:#fff;
    color:#172033;
    cursor:pointer;
    position:relative;
    display:flex;
    flex-direction:column;
    gap:4px;
}
.calendar-day:hover{box-shadow:inset 0 0 0 2px #98a2b3;z-index:2}
.calendar-day.empty{cursor:default;background:#f7f8fa}
.calendar-day.empty:hover{box-shadow:none}
.calendar-day.red-day{background:#d92d20;color:#fff}
.calendar-day.admin-day{background:#fff;box-shadow:inset 0 -5px 0 #f5c842}
.calendar-day.today{outline:3px solid #1570ef;outline-offset:-3px;z-index:1}
.calendar-number{font-size:19px;font-weight:900;line-height:1}
.calendar-status{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.03em}
.calendar-description{font-size:10px;line-height:1.25;opacity:.88;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.calendar-edit-hint{font-size:8px;font-weight:800;margin-top:auto;opacity:.7;text-transform:uppercase}
.calendar-editor{position:sticky;top:24px}
.calendar-editor h2{font-size:17px;margin-bottom:5px}
.calendar-editor .field{margin-top:12px}
.calendar-editor .btn{width:100%;margin-top:14px}
.calendar-remove{margin-top:8px}
.calendar-remove[hidden]{display:none}
.calendar-impact{
    margin-top:18px;
    border-top:1px solid #eaecf0;
    padding-top:14px;
    font-size:11px;
    color:#475467;
    line-height:1.4;
}
.calendar-impact b{color:#172033}
.calendar-impact p{margin:7px 0}

@media(max-width:1000px){
    .calendar-layout{grid-template-columns:1fr}
    .calendar-editor{position:static}
}
@media(max-width:700px){
    .calendar-rules{grid-template-columns:1fr}
    .calendar-toolbar{align-items:stretch;flex-direction:column}
    .calendar-day{min-height:78px;padding:5px}
    .calendar-number{font-size:15px}
    .calendar-description{display:none}
}

/* =========================================================
   ESCALA 3.0 — PARTICIPANTES DAS ESCALAS
   ========================================================= */
.scale-list-table td{vertical-align:middle}
.scale-row-actions{display:flex;justify-content:flex-end;gap:7px;white-space:nowrap}
.scale-legacy-note{font-size:10px;margin-top:3px}

.participant-summary{
    display:flex;justify-content:space-between;align-items:center;gap:18px;
    background:#fff;border:1px solid #e4e7ec;border-radius:12px;padding:15px 18px;
    box-shadow:0 2px 8px #1018280a;margin-bottom:14px;
}
.back-link{display:inline-block;color:#475467;text-decoration:none;font-size:12px;font-weight:750;margin-bottom:7px}
.back-link:hover{color:#172033}
.participant-summary-title{display:flex;align-items:baseline;gap:7px}
.participant-summary-title strong{font-size:24px;line-height:1;color:#172033}
.participant-summary-title span{font-size:13px;font-weight:750;color:#475467}
.participant-summary-note{font-size:11px;margin-top:5px;max-width:760px}
.participant-summary-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.participant-summary-actions form{margin:0}

.participant-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:14px;align-items:start}
.participant-list-card{padding:0;overflow:hidden}
.participant-section-head{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:16px 18px;border-bottom:1px solid #eaecf0}
.participant-section-head h2{font-size:17px;margin:0 0 4px}
.participant-section-head p{font-size:11px;color:#667085;margin:0}
.participant-table th,.participant-table td{vertical-align:middle}
.participant-table tbody tr:hover{background:#fafbfc}
.participant-order-col{width:44px;text-align:center!important}
.participant-order-badge{width:26px;height:26px;border-radius:7px;background:#eef2f6;color:#344054;display:inline-grid;place-items:center;font-size:11px;font-weight:900}
.participant-name{font-size:12px;color:#172033;white-space:nowrap}
.participant-fullname{font-size:10px;color:#667085;margin-top:2px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.participant-counter-mini{display:flex;gap:5px;flex-wrap:wrap}
.participant-counter-mini span{font-size:9px;padding:3px 5px;border-radius:5px;background:#f2f4f7;color:#667085;white-space:nowrap}
.participant-counter-mini b{color:#344054}
.participant-edit-link{display:inline-block;font-size:9px;font-weight:800;color:#175cd3;text-decoration:none;margin-top:4px}
.participant-order-actions{display:flex;align-items:center;gap:4px;white-space:nowrap}
.participant-order-actions form{margin:0}
.participant-order-text{font-size:10px;font-weight:900;color:#667085;min-width:24px;text-align:center}
.icon-btn{
    width:30px;height:30px;border:1px solid #d0d5dd;border-radius:7px;background:#fff;color:#344054;
    display:inline-grid;place-items:center;text-decoration:none;font-weight:900;cursor:pointer;padding:0;font-size:15px;
}
.icon-btn:hover:not(:disabled){background:#eef2f6;border-color:#98a2b3}
.icon-btn:disabled{opacity:.28;cursor:not-allowed}
.link-danger{border:0;background:transparent;color:#b42318;font-size:10px;font-weight:850;cursor:pointer;padding:5px}
.link-danger:hover{text-decoration:underline}
.participant-remove-cell{text-align:right!important}

.participant-side-stack{display:grid;gap:14px;position:sticky;top:20px}
.participant-side-stack .card h2{font-size:17px;margin:3px 0 5px}
.eyebrow{font-size:9px;text-transform:uppercase;letter-spacing:.07em;font-weight:900;color:#667085}
.participant-editor-head{display:flex;justify-content:space-between;gap:10px;align-items:start}
.participant-editor .field,.participant-add-card .field{margin-top:12px}
.participant-editor .btn{width:100%;margin-top:14px}
.participant-counter-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.participant-search-field input{height:38px}
.participant-candidate-list{display:grid;gap:6px;margin-top:10px;max-height:430px;overflow:auto;padding-right:2px}
.participant-candidate{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:9px;border:1px solid #e4e7ec;border-radius:9px;background:#fff;margin:0;
}
.participant-candidate[hidden]{display:none}
.participant-candidate:hover{border-color:#b8c2ce;background:#fafbfc}
.participant-candidate>div{min-width:0;display:grid;gap:2px}
.participant-candidate b{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#172033}
.participant-candidate small{font-size:9px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.participant-add-btn{padding:7px 9px;font-size:10px;flex:0 0 auto}
.participant-no-candidates,.participant-search-empty{font-size:11px;color:#667085;background:#f7f8fa;border-radius:8px;padding:12px;margin-top:10px}
.participant-inactive-card summary{cursor:pointer;font-size:12px;font-weight:850;color:#344054;display:flex;justify-content:space-between;align-items:center}
.participant-inactive-list{display:grid;gap:7px;margin-top:11px}
.participant-inactive-list>div{border-top:1px solid #eaecf0;padding-top:7px;display:grid}
.participant-inactive-list span{font-size:11px;font-weight:750}
.participant-inactive-list small{font-size:9px;color:#667085}

@media(max-width:1180px){
    .participant-layout{grid-template-columns:1fr}
    .participant-side-stack{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}
    .participant-inactive-card{grid-column:1/-1}
}
@media(max-width:760px){
    .participant-summary{align-items:stretch;flex-direction:column}
    .participant-summary-actions{width:100%}
    .participant-summary-actions .btn,.participant-summary-actions form{flex:1}
    .participant-summary-actions form .btn{width:100%}
    .participant-side-stack{grid-template-columns:1fr}
    .participant-counter-grid{grid-template-columns:1fr}
    .scale-row-actions{flex-direction:column}
}


/* =========================================================
   USUÁRIO LOGADO NO MENU LATERAL
   ========================================================= */
.side .brand{margin-bottom:10px}
.side-user{display:flex;align-items:center;gap:9px;margin:0 0 20px;padding:9px 10px;border:1px solid rgba(255,255,255,.08);border-radius:10px;background:rgba(255,255,255,.035);min-width:0}
.side-user-icon{width:28px;height:28px;flex:0 0 28px;border-radius:8px;display:grid;place-items:center;background:#202a35;color:#dce6ef}
.side-user-icon svg{width:15px;height:15px}
.side-user-copy{display:grid;gap:1px;min-width:0}
.side-user-copy strong{font-size:11px;line-height:1.2;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user-copy small{font-size:8px;line-height:1.2;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#8fa1b2}
@media(max-width:850px){.side-user{max-width:300px;margin-bottom:14px}}
