:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --soft-line: #eef2f6;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --nav: #0f2235;
  --nav-2: #17324d;
  --blue: #0b5f9e;
  --blue-2: #074a7d;
  --cyan: #0aa1b7;
  --red: #c83242;
  --green: #13845a;
  --amber: #a86500;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; font-family: "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: inherit; text-decoration: none; }
h3 { margin: 0 0 14px; font-size: 17px; }
p { line-height: 1.55; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #eef4f8; }
.login-card { width: min(680px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 34px; box-shadow: 0 22px 60px rgba(23, 32, 51, .14); }
.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.brand img { width: 58px; height: 58px; object-fit: cover; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); }
.brand h1 { margin: 0; font-size: 21px; line-height: 1.1; }
.brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-brand { margin-bottom: 24px; }
.login-brand img { width: 64px; height: 64px; }
.login-brand h1 { font-size: 30px; color: #111827; font-weight: 500; letter-spacing: 0; }
.login-brand span { color: #111827; font-size: 12px; font-weight: 800; }
.login-about { margin: 18px 6px 0; color: #111827; font-size: 13px; line-height: 1.55; text-align: justify; }
.login-about strong { font-weight: 900; }
.login-resources { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.login-resources h2 { margin: 0 0 12px; font-size: 13px; text-align: center; text-transform: uppercase; color: var(--blue); letter-spacing: 0; }
.login-resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.login-resource-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: center; background: #fbfdff; }
.login-resource-card strong { display: block; color: var(--blue); font-size: 13px; line-height: 1.25; margin-bottom: 5px; }
.login-resource-card span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-bottom: 10px; }
.login-resource-card .btn { min-height: 32px; padding: 8px 12px; font-size: 12px; }
.login-resource-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #e8f1ff; color: var(--blue); font-weight: 900; }
.login-resource-icon.router { background: #e8f7f2; color: var(--green); }
label { display: block; font-size: 12px; font-weight: 700; margin: 12px 0 6px; color: #344054; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 95, 158, .12); }
textarea { min-height: 92px; resize: vertical; }
button, .btn { border: 0; border-radius: 6px; padding: 10px 13px; background: var(--blue); color: #fff; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; box-shadow: 0 1px 0 rgba(15, 34, 53, .12); transition: transform .12s, box-shadow .12s, background .12s; }
button:hover, .btn:hover { background: var(--blue-2); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 34, 53, .12); }
.btn.secondary, button.secondary { background: #e8edf3; color: var(--ink); }
.btn.secondary:hover, button.secondary:hover { background: #dfe6ef; }
.btn.danger, button.danger { background: var(--red); }
.btn.success, button.success { background: var(--green); }
.btn.info, button.info { background: var(--cyan); }
.btn.warning, button.warning { background: var(--amber); }
.compact-btn { min-height: 34px; padding: 8px 12px; font-size: 12px; border-radius: 7px; white-space: nowrap; }
.bulk-conformities { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 -6px; padding: 12px 14px; border: 1px solid #b9d9ea; border-radius: 8px; background: linear-gradient(90deg, #eef8fc, #ffffff); box-shadow: 0 8px 22px rgba(15, 34, 53, .06); }
.bulk-conformities[hidden] { display: none; }
.bulk-conformities div { display: grid; gap: 2px; }
.bulk-conformities strong { color: var(--blue); font-size: 13px; text-transform: uppercase; }
.bulk-conformities span { color: var(--muted); font-size: 12px; }
.conformity-toolbar { align-items: center; }
.director-month-navigation { margin: 0 0 18px; border: 1px solid #d7e2ed; border-radius: 8px; padding: 16px; background: #fff; box-shadow: 0 10px 28px rgba(15, 34, 53, .06); }
.director-month-navigation-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.director-month-navigation-head .eyebrow { color: var(--blue); letter-spacing: .06em; }
.director-month-navigation-head h3 { margin: 3px 0 0; font-size: 16px; }
.director-month-count { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: #edf4fa; color: #35516d; font-size: 11px; font-weight: 800; }
.director-month-buttons { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 10px; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; }
.director-month-button { position: relative; min-height: 66px; border: 2px solid #cbd6e2; border-radius: 8px; padding: 11px 13px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; background: #f8fafc; color: #26394e; box-shadow: none; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease; }
.director-month-button:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 8px 18px rgba(15, 34, 53, .1); }
.director-month-button span { font-size: 13px; font-weight: 900; text-transform: uppercase; }
.director-month-button small { color: #68778a; font-size: 10px; font-weight: 800; }
.director-month-button.is-active { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue), 0 7px 18px rgba(11, 95, 158, .12); }
.director-month-button.is-active::after { content: "Seleccionado"; position: absolute; top: -8px; right: 8px; border-radius: 999px; padding: 3px 7px; background: var(--blue); color: #fff; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.director-month-button.is-pending { border-color: #df9c22; background: #fffaf0; }
.director-month-button.is-pending small { color: #9a6100; }
.director-month-button.is-pending { animation: pending-month-border 1.7s ease-in-out infinite; }
.director-month-button.is-sent { border-color: #a8c9db; background: #f2f8fb; }
.director-month-button.is-sent small { color: #356a83; }
.director-month-button.is-accepted { border-color: #a9d6c0; background: #f1f9f5; }
.director-month-button.is-accepted small { color: #207653; }
.director-month-button.is-observed { border-color: #d7afd0; background: #fbf4fa; }
.director-month-button.is-observed small { color: #8a3f79; }
.director-month-button.is-expired { border-color: #d9dee5; background: #f5f6f8; color: #697586; }
.director-month-button.is-expired small { color: #8a94a3; }
.director-month-button.is-active { border-color: var(--blue); }
.director-month-empty { display: grid; gap: 4px; border: 1px dashed #c4d1df; border-radius: 8px; padding: 15px; background: #f8fafc; color: #3b5066; }
.director-month-empty span { color: var(--muted); font-size: 12px; }
@keyframes pending-month-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 154, 38, 0); }
  50% { box-shadow: 0 0 0 4px rgba(217, 154, 38, .18); }
}
@media (prefers-reduced-motion: reduce) {
  .director-month-button.is-pending { animation: none; }
}
.director-conformity-card { overflow: hidden; border: 1px solid #dbe5ef; border-radius: 24px; background: #fff; box-shadow: 0 24px 60px rgba(15, 34, 53, .12); }
.director-period-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 32px; background: #06284d; color: #fff; }
.director-period-head h3 { margin: 4px 0 4px; color: #fff; font-size: 25px; }
.director-period-head p { margin: 0; color: #cfe0f2; }
.eyebrow { color: #b9d9ff; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.deadline-pill { min-width: 132px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 12px 16px; background: rgba(139, 71, 103, .42); text-align: center; }
.deadline-pill small { display: block; color: #ffd5e0; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.deadline-pill strong { display: block; margin-top: 3px; font-size: 18px; }
.instruction-box { margin: 28px 32px 0; border: 1px solid #f4c463; border-radius: 12px; padding: 16px 18px; background: #fff9e8; color: #a24d00; line-height: 1.5; }
.instruction-box strong { color: #914100; }
.process-tabs { width: min(448px, calc(100% - 64px)); margin: 30px auto 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 12px; padding: 4px; background: #eef3f8; }
.process-tabs span { min-height: 36px; border-radius: 9px; display: grid; place-items: center; color: #64748b; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.process-tabs .is-active { background: #06284d; color: #fff; box-shadow: 0 8px 18px rgba(6, 40, 77, .22); }
.process-tabs .is-disabled { opacity: .68; }
.auto-state { width: min(448px, calc(100% - 64px)); margin: -14px auto 24px; border-radius: 999px; padding: 8px 14px; background: #f6f8fb; color: #7b8798; font-size: 12px; font-weight: 700; text-align: center; }
.director-process-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding: 0 32px 28px; }
.process-panel { position: relative; display: grid; align-content: start; gap: 12px; border: 1px solid #dce5ef; border-radius: 14px; padding: 34px 24px 24px; background: #fff; box-shadow: 0 10px 24px rgba(15, 34, 53, .05); }
.process-panel label { margin: 0; color: #61708a; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.process-panel label span { color: #9aa6b8; text-transform: none; letter-spacing: 0; }
.process-panel .days-spinner { min-height: 48px; border-radius: 10px; font-size: 16px; font-weight: 800; }
.process-panel textarea { min-height: 74px; border-radius: 10px; }
.process-panel button { margin-top: 6px; min-height: 45px; border-radius: 10px; background: #1d293d; box-shadow: 0 12px 22px rgba(29, 41, 61, .18); }
.process-panel button:hover { background: #06284d; }
.step-label { position: absolute; top: -13px; left: 24px; border: 1px solid #dce5ef; border-radius: 999px; padding: 6px 13px; background: #fff; color: #06284d; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 5px 12px rgba(15, 34, 53, .08); }
.success-label { color: var(--green); }
.signed-drop { display: grid !important; place-items: center; min-height: 176px; margin: 0; border: 2px dashed #bfd0e4; border-radius: 12px; background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%); color: var(--ink); text-align: center; cursor: pointer; }
.signed-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.signed-drop strong { display: block; color: #06284d; font-size: 13px; }
.signed-drop small { display: block; margin-top: 6px; color: #98a2b3; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.signed-drop:hover { border-color: var(--blue); background: #f0f7ff; }
.director-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 32px 32px; }
.director-actions .btn { min-height: 38px; }
.month-check-grid { display: grid; grid-template-columns: repeat(4, minmax(132px, 1fr)); gap: 12px; margin-top: 10px; }
.month-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  grid-template-areas: "month checkbox" "state checkbox";
  align-items: center;
  gap: 6px 12px;
  min-height: 68px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.month-check:hover {
  transform: translateY(-1px);
  border-color: #b7c7d9;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
}
.month-check input[type="checkbox"] {
  grid-area: checkbox;
  justify-self: end;
  width: 18px !important;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  box-shadow: none;
  accent-color: var(--green);
}
.month-check span {
  grid-area: month;
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-check small {
  grid-area: state;
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff1f2;
  color: #be123c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.month-check.is-enabled,
.month-check:has(input:checked) {
  border-color: #8bd6b4;
  background: linear-gradient(180deg, #f5fff9 0%, #eafaf2 100%);
}
.month-check.is-enabled small,
.month-check:has(input:checked) small {
  background: #dff7ea;
  color: var(--green);
}
.conformities-table th, .conformities-table td { vertical-align: middle; }
.select-col { width: 42px; text-align: center; }
.select-col input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--blue); }
.review-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; max-width: 280px; }
.review-actions .badge { margin-right: 2px; }
.review-actions form { margin: 0; }
.observation-cell { min-width: 220px; max-width: 360px; line-height: 1.35; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h3 { margin: 3px 0 3px; font-size: 20px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.section-heading .eyebrow { color: var(--blue); }
.compact-heading { margin-bottom: 12px; }
.dashboard-conformities,
.management-overview { border: 1px solid #dce5ef; border-radius: 16px; padding: 20px; background: rgba(255,255,255,.98); box-shadow: 0 18px 42px rgba(15,34,53,.08); }
.institution-conformity-group + .institution-conformity-group { margin-top: 22px; border-top: 1px solid #e3eaf2; padding-top: 20px; }
.institution-group-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; border-left: 4px solid var(--cyan); padding: 8px 10px; background: #f6fafc; }
.institution-group-head div { display: grid; gap: 3px; }
.institution-group-head strong { color: #102a43; font-size: 15px; }
.institution-group-head span { color: var(--muted); font-size: 11px; }
.institution-group-head > a { color: var(--blue); font-size: 12px; font-weight: 900; }
.month-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.month-status-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 126px; border: 1px solid #dfe6ee; border-radius: 12px; padding: 15px; background: #fff; box-shadow: 0 8px 20px rgba(15,34,53,.05); }
.month-status-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #eef3f8; color: var(--muted); font-weight: 900; }
.month-status-card strong { display: block; font-size: 14px; line-height: 1.25; }
.month-status-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.month-status-card > a { grid-column: 1 / -1; min-height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: 8px; color: var(--blue); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.month-status-card.is-warn { border-color: #f1cf7a; background: #fffaf0; }
.month-status-card.is-warn .month-status-icon { background: #fff1cb; color: #a86500; }
.month-status-card.is-danger { border-color: #efb5bd; background: #fff7f8; }
.month-status-card.is-danger .month-status-icon { background: #fde8eb; color: var(--red); }
.month-status-card.is-danger > a { color: var(--red); }
.month-status-card.is-ok { border-color: #a9ddc6; background: #f5fcf8; }
.month-status-card.is-ok .month-status-icon { background: #e2f5ed; color: var(--green); }
.month-status-card.is-ok > a { color: var(--green); }
.month-status-card.is-info { border-color: #acd9e2; background: #f4fbfd; }
.month-status-card.is-info .month-status-icon { background: #e2f6f9; color: var(--cyan); }
.month-status-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 5px; border: 1px dashed #c8d5e3; border-radius: 12px; padding: 28px 18px; background: #f8fafc; color: var(--muted); text-align: center; }
.month-status-empty strong { color: #17324d; font-size: 14px; }
.month-status-empty span { font-size: 12px; }
.management-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.management-stat { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #dce5ef; border-top: 3px solid var(--blue); border-radius: 10px; padding: 13px; background: #fff; }
.management-stat span { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.management-stat strong { font-size: 28px; }
.management-stat.is-warn { border-top-color: var(--amber); }
.management-stat.is-danger { border-top-color: var(--red); }
.management-stat.is-ok { border-top-color: var(--green); }
.management-stat.is-muted { border-top-color: #98a2b3; }
.management-stat.is-info { border-top-color: var(--cyan); }
.assistance-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; border: 1px solid #b9d9ea; border-radius: 10px; padding: 12px 14px; background: #eef8fc; }
.assistance-notice strong { color: var(--blue); }
.assistance-notice span { color: #52647a; font-size: 12px; }
.assisted-form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
#modal-conformity .modal-foot [data-submit-modal] { display: none; }
.file-upload-box { position: relative; min-height: 112px; display: grid !important; place-items: center; margin: 0; border: 2px dashed #bfd0e4; border-radius: 12px; padding: 16px; background: linear-gradient(180deg,#fbfdff,#f5f9fd); text-align: center; cursor: pointer; transition: border-color .16s, background .16s, box-shadow .16s; }
.file-upload-box:hover { border-color: var(--blue); background: #f0f7ff; }
.file-upload-box.has-file { border-style: solid; border-color: #82cfac; background: #f1fbf6; box-shadow: 0 0 0 4px rgba(19,132,90,.08); }
.file-upload-box > input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.file-upload-idle,
.file-upload-ready { display: grid; justify-items: center; gap: 5px; width: 100%; }
.file-upload-idle[hidden],
.file-upload-ready[hidden] { display: none; }
.file-upload-idle strong { color: #06284d; font-size: 13px; }
.file-upload-idle small { color: #8b98aa; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.file-upload-ready b { display: inline-flex; border-radius: 999px; padding: 5px 10px; background: #dff7ea; color: var(--green); font-size: 11px; text-transform: uppercase; }
.file-upload-ready strong { max-width: 100%; overflow: hidden; color: #17324d; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-upload-ready small { color: var(--muted); }
.file-upload-controls { display: flex; gap: 8px; margin-top: 5px; }
.file-upload-controls a,
.file-upload-controls button { min-height: 30px; border-radius: 7px; padding: 6px 10px; background: #fff; color: var(--blue); border: 1px solid #cbd8e6; box-shadow: none; font-size: 11px; font-weight: 850; }
.existing-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; border-radius: 8px; padding: 8px 10px; background: #eef3f8; color: var(--muted); font-size: 11px; }
.existing-file a { color: var(--blue); font-weight: 900; }
.management-user { display: grid; min-width: 150px; gap: 2px; }
.management-user strong { font-size: 12px; }
.management-user small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.app { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { background: linear-gradient(180deg, var(--nav), var(--nav-2)); color: #eaf3fb; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; border-right: 1px solid rgba(255,255,255,.08); }
.sidebar .brand { padding: 4px 6px 16px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.11); }
.sidebar .brand img { width: 48px; height: 48px; }
.sidebar .brand h1 { font-size: 16px; letter-spacing: .02em; }
.sidebar .brand span { color: #b7cce0; }
.nav { display: grid; gap: 5px; margin-top: 10px; }
.nav a { padding: 10px 11px; border-radius: 6px; color: #dceaf6; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 9px; }
.nav a i { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #cde1f4; font-style: normal; font-size: 10px; font-weight: 800; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active i, .nav a:hover i { background: var(--cyan); color: #fff; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 15px 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.topbar h2 { margin: 0; font-size: 21px; }
.content { padding: 22px 24px 34px; display: grid; gap: 18px; max-width: 1360px; width: 100%; }
.banner { width: 100%; height: 78px; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 18px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 17px; box-shadow: 0 10px 28px rgba(16, 24, 40, .05); }
.metric { min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.metric:after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; background: var(--cyan); }
.metric strong { font-size: 33px; letter-spacing: 0; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; justify-content: space-between; background: #eef3f8; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.period-filter { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin: 0; }
.period-filter label { margin: 0; }
.period-filter input { min-width: 160px; }
.inline-form { display: inline-flex; margin: 0; }
.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-actions .btn, .row-actions button { min-height: 34px; padding: 8px 10px; font-size: 12px; }
.datatable-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; background: #fff; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 12px; box-shadow: 0 10px 28px rgba(16, 24, 40, .05); }
.datatable-controls .dt-global { width: 260px; max-width: 100%; margin-top: 0; }
.datatable-controls .dt-ie-filter { width: 280px; max-width: 100%; margin-top: 0; }
.dt-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dt-length { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); white-space: nowrap; }
.dt-length select { width: auto; min-width: 76px; padding: 8px 28px 8px 9px; }
.dt-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 6px; background: #e8f7f2; color: var(--green); font-weight: 900; font-size: 12px; text-transform: uppercase; }
.dt-actions { display: flex; gap: 7px; justify-content: center; }
.dt-actions button { min-height: 34px; padding: 8px 11px; font-size: 12px; }
.dt-search-label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ink); }
.dt-ie-label { color: var(--blue); font-weight: 900; }
.datatable-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 10px 12px; }
.datatable-pager div { display: flex; align-items: center; gap: 8px; }
.datatable-pager button:disabled, button:disabled { opacity: .55; cursor: not-allowed; }
.select-search { margin-bottom: 6px; }
.combobox { position: relative; }
.native-combobox-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combobox-input { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, #344054 50%), linear-gradient(135deg, #344054 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.combobox-list { display: none; position: absolute; z-index: 80; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 38px rgba(15, 34, 53, .18); padding: 6px; }
.combobox.is-open .combobox-list { display: grid; gap: 2px; }
.combobox-option { width: 100%; justify-content: flex-start; min-height: 34px; padding: 8px 10px; border-radius: 6px; background: #fff; color: var(--ink); box-shadow: none; font-weight: 700; text-align: left; }
.combobox-option:hover, .combobox-option:focus { background: #edf6fb; color: var(--blue); transform: none; box-shadow: none; }
.combobox-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.institution-assignment-search { margin: 7px 0 10px; }
.institution-assignment-list { max-height: 290px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: auto; border: 1px solid #dce5ef; border-radius: 8px; padding: 10px; background: #f8fafc; }
.institution-assignment-item { min-width: 0; display: flex; align-items: flex-start; gap: 9px; margin: 0; border: 1px solid #dce5ef; border-radius: 7px; padding: 10px; background: #fff; cursor: pointer; }
.institution-assignment-item:has(input:checked) { border-color: #65b994; background: #f0faf5; box-shadow: inset 3px 0 0 var(--green); }
.institution-assignment-item input { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--green); }
.institution-assignment-item span { min-width: 0; display: grid; gap: 3px; }
.institution-assignment-item strong { overflow-wrap: anywhere; color: #17324d; font-size: 12px; line-height: 1.25; }
.institution-assignment-item small { color: var(--muted); font-size: 10px; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 24, 40, .05); }
.datatable-controls + .table-wrap { border-radius: 0; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--soft-line); vertical-align: top; }
tbody tr:hover { background: #f8fafc; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; background: #f8fafc; font-weight: 800; }
.column-filter-row th { background: #fff; padding: 8px 10px; }
.column-filter-row input { min-height: 34px; padding: 8px 10px; font-size: 12px; background: #fbfdff; border-color: #dce5ee; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; background: #e8edf3; color: var(--ink); white-space: nowrap; }
.badge.danger { background: #fde8eb; color: var(--red); }
.badge.warn { background: #fff2d8; color: var(--amber); }
.badge.ok { background: #e2f5ed; color: var(--green); }
.badge.muted { background: #edf1f6; color: var(--muted); }
.flash { padding: 12px 14px; border-radius: 7px; font-weight: 700; border: 1px solid transparent; }
.flash.ok { background: #e2f5ed; color: var(--green); border-color: #b8e3cf; }
.flash.error { background: #fde8eb; color: var(--red); border-color: #f5b9c0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.span-2, .span-all { grid-column: 1 / -1; }
.timeline { display: grid; gap: 10px; }
.timeline-item { border-left: 3px solid var(--cyan); padding-left: 12px; }
.timeline-item small { color: var(--muted); display: block; margin-bottom: 3px; }
.permissions-panel { overflow: hidden; }
.permissions-grid { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(120px, 160px)); border: 1px solid var(--line); border-radius: 8px; overflow: auto; margin: 14px 0; }
.permissions-head, .permissions-group, .permission-label, .switch { min-height: 48px; border-bottom: 1px solid var(--soft-line); display: flex; align-items: center; padding: 10px 12px; background: #fff; }
.permissions-head { background: #f8fafc; font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 800; }
.permissions-group { background: #eef6fa; color: #174862; font-weight: 800; min-height: 38px; }
.permission-label { flex-direction: column; align-items: flex-start; justify-content: center; font-weight: 700; }
.permission-label small { color: var(--muted); font-weight: 500; margin-top: 2px; }
.switch { justify-content: center; margin: 0; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: #cdd5df; position: relative; transition: background .15s; }
.switch span:after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #fff; position: absolute; left: 3px; top: 3px; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span:after { transform: translateX(18px); }

/* Capa visual profesional: rescata el estilo premium sin traer codigo desordenado. */
body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(10, 161, 183, .09), transparent 28rem),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  -webkit-font-smoothing: antialiased;
}
.sidebar {
  background: linear-gradient(180deg, #0d2134 0%, #081827 100%);
  box-shadow: 14px 0 42px rgba(15, 34, 53, .18);
}
.sidebar .brand { border-bottom-color: rgba(255,255,255,.09); }
.nav a {
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
}
.nav a:hover {
  transform: translateX(3px);
  border-color: rgba(255,255,255,.08);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(10, 161, 183, .28), rgba(255,255,255,.09));
  border-color: rgba(10, 161, 183, .35);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.topbar {
  background: rgba(255,255,255,.92);
  box-shadow: 0 1px 0 rgba(216, 222, 232, .8), 0 12px 34px rgba(15, 34, 53, .05);
}
.topbar h2,
.panel h3,
label,
button,
.btn,
.badge { letter-spacing: 0; }
.content { gap: 22px; }
.panel,
.card,
.table-wrap,
.datatable-controls,
.datatable-pager,
.toolbar {
  border-color: #e1e7ef;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 34, 53, .06);
}
.panel,
.card { background: rgba(255,255,255,.98); }
button,
.btn {
  border-radius: 9px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(11, 95, 158, .14);
}
button:hover,
.btn:hover { box-shadow: 0 12px 24px rgba(15, 34, 53, .16); }
.btn.secondary,
button.secondary {
  background: #eef3f8;
  border: 1px solid #d9e2ec;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(15, 34, 53, .05);
}
.btn.secondary:hover,
button.secondary:hover {
  background: #e4ebf3;
  border-color: #c7d3df;
}
input,
select,
textarea {
  border-color: #ccd6e2;
  border-radius: 9px;
  box-shadow: inset 0 1px 1px rgba(15, 34, 53, .025);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 95, 158, .11);
}
label { color: #26364a; }
th {
  background: #f3f7fb;
  color: #5c6b80;
  letter-spacing: .03em;
}
td { color: #243245; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f6fbff; }
.datatable-controls { background: rgba(255,255,255,.97); }
.dt-chip { border-radius: 8px; }
.modal-dialog {
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(15, 34, 53, .34);
}
.modal-head,
.modal-foot { background: #f7f9fc; }
.director-conformity-card {
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(15, 34, 53, .14);
}
.director-period-head { background: linear-gradient(135deg, #06284d 0%, #0b3f78 100%); }
.process-panel { border-radius: 16px; }
.process-tabs,
.signed-drop,
.instruction-box { border-radius: 14px; }
.modal { display: none; position: fixed; inset: 0; z-index: 50; padding: 22px; background: rgba(15, 34, 53, .58); overflow: auto; }
.modal.is-open { display: grid; place-items: start center; }
.modal-dialog { width: min(760px, 100%); background: #fff; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 28px 80px rgba(15, 34, 53, .28); margin: 32px 0; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 17px; border-top: 1px solid var(--line); background: #f8fafc; }
.icon-btn { width: 34px; min-height: 34px; padding: 0; border-radius: 6px; background: #e8edf3; color: var(--ink); font-size: 20px; line-height: 1; }
.modal .panel { border: 0; box-shadow: none; padding: 0; }
.modal .panel h3 { display: none; }
.modal .panel > button:last-child { display: none; }
.modal-flash { margin: 0 0 14px; }
.level-selector { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfd; }
.level-selector legend { padding: 0 7px; color: var(--ink); font-weight: 800; }
.level-selector p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.level-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.level-option { position: relative; display: block; cursor: pointer; }
.level-option input { position: absolute; opacity: 0; pointer-events: none; }
.level-option span { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 10px; border: 1px solid #cbd8e5; border-radius: 8px; background: #fff; color: #294158; font-weight: 800; text-align: center; transition: .15s ease; }
.level-option input:checked + span { border-color: #118c72; background: #e8f7f1; color: #08725d; box-shadow: inset 0 0 0 1px #118c72; }
.level-option input:focus-visible + span { outline: 3px solid rgba(14, 116, 144, .18); outline-offset: 2px; }
.levels-text { display: inline-block; max-width: 220px; color: #334e68; font-weight: 700; line-height: 1.35; }
.menu-toggle, .mobile-menu-backdrop { display: none; }
.print-header { display: none; }
.modal-dialog {
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(15, 34, 53, .34);
}
.modal-head,
.modal-foot {
  background: #f7f9fc;
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid { grid-template-columns: 1fr; }
  .director-period-head, .director-process-grid { grid-template-columns: 1fr; }
  .director-period-head { display: grid; padding: 24px; }
  .director-process-grid { gap: 22px; padding-left: 24px; padding-right: 24px; }
  .instruction-box { margin-left: 24px; margin-right: 24px; }
  .process-tabs { width: calc(100% - 48px); }
  .auto-state { width: calc(100% - 48px); }
  .director-actions { padding-left: 24px; padding-right: 24px; }
  .month-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permissions-grid { grid-template-columns: minmax(220px, 1fr) repeat(3, 110px); }
  .month-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal { padding: 12px; }
  .modal-dialog { margin: 12px 0; }
}
@media (max-width: 720px) {
  html { min-height: 100%; background: var(--bg); }
  body { min-height: 100%; font-size: 14px; -webkit-tap-highlight-color: transparent; }
  .login { align-items: stretch; place-items: stretch; padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); }
  .login-card { width: 100%; align-self: center; padding: 24px 20px; border-radius: 12px; box-shadow: 0 16px 45px rgba(23, 32, 51, .12); }
  .login-card .brand { justify-content: center; text-align: left; }
  .login-card input, .login-card button { min-height: 46px; }
  .login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #eef6fb 0%, #f8fbfd 100%); }
  .login-card { width: min(100%, 420px); max-height: calc(100dvh - 28px); overflow: auto; padding: 22px 18px; border-radius: 14px; }
  .login-brand { justify-content: flex-start; gap: 12px; margin-bottom: 20px; }
  .login-brand img { width: 58px; height: 58px; flex: 0 0 58px; }
  .login-brand h1 { font-size: 30px; line-height: 1; }
  .login-brand span { font-size: 13px; line-height: 1.2; }
  .login-card label { font-size: 13px; margin-top: 14px; }
  .login-card input, .login-card button { min-height: 52px; border-radius: 9px; }
  .login-resources { margin-top: 18px; padding-top: 14px; }
  .login-resources h2 { font-size: 13px; margin-bottom: 10px; }
  .login-resource-grid { grid-template-columns: 1fr; gap: 10px; }
  .login-resource-card { grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding: 12px; align-items: center; }
  .login-resource-icon { width: 50px; height: 50px; font-size: 13px; }
  .login-resource-card strong { font-size: 14px; line-height: 1.2; margin-bottom: 3px; overflow-wrap: anywhere; }
  .login-resource-card span { font-size: 12px; line-height: 1.3; margin-bottom: 8px; }
  .login-resource-card .btn { width: 100%; min-height: 40px; padding: 8px 10px; font-size: 12px; border-radius: 8px; }
  .login-about { margin: 16px 2px 0; font-size: 12px; line-height: 1.45; text-align: left; }
  .app { display: block; min-height: 100vh; }
  .banner { display: none; }
  .main { min-height: 100vh; }
  .topbar { position: sticky; top: 0; z-index: 20; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 10px; background: rgba(255, 255, 255, .97); box-shadow: 0 1px 0 var(--line); display: grid; grid-template-columns: 44px 1fr; align-items: center; }
  .topbar h2 { font-size: 18px; line-height: 1.2; }
  .topbar .hint { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-column: 1 / -1; }
  .topbar .actions .btn { width: 100%; min-height: 42px; }
  .topbar .actions .btn:only-child { grid-column: 1 / -1; }
  .menu-toggle { display: inline-flex; width: 40px; min-height: 40px; padding: 0; border-radius: 10px; font-size: 20px; background: var(--nav); color: #fff; }
  .content { padding: 14px 12px 20px; gap: 12px; }

  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: min(82vw, 310px); height: 100dvh; padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); border-right: 1px solid rgba(255,255,255,.10); background: linear-gradient(180deg, var(--nav), var(--nav-2)); box-shadow: 18px 0 45px rgba(15, 34, 53, .28); overflow-y: auto; transform: translateX(-104%); transition: transform .22s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar .brand { display: flex; padding: 0 4px 16px; margin-bottom: 10px; }
  .sidebar .brand img { width: 46px; height: 46px; }
  .sidebar .brand h1 { font-size: 16px; }
  .nav { display: grid; gap: 6px; margin-top: 8px; overflow: visible; }
  .nav a { min-width: 0; padding: 11px 10px; grid-template-columns: 32px 1fr; justify-items: stretch; gap: 10px; border-radius: 8px; font-size: 14px; line-height: 1.2; text-align: left; }
  .nav a i { width: 30px; height: 28px; border-radius: 7px; font-size: 10px; }
  .mobile-menu-backdrop { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(15, 34, 53, .44); }
  body.menu-open .mobile-menu-backdrop { display: block; }
  body.menu-open { overflow: hidden; }

  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 94px; padding: 14px; }
  .metric strong { font-size: 27px; }
  .metric span { font-size: 10px; line-height: 1.25; }
  .panel, .card { border-radius: 10px; padding: 14px; }
  .toolbar { display: block; }
  .datatable-controls { display: grid; grid-template-columns: 1fr; align-items: stretch; border-radius: 10px 10px 0 0; }
  .datatable-pager { align-items: stretch; flex-direction: column; }
  .datatable-controls .dt-global { max-width: none; }
  .dt-left, .dt-search-label { width: 100%; align-items: stretch; }
  .dt-search-label { display: grid; gap: 6px; }
  .dt-actions, .datatable-pager div { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .dt-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .actions .btn, .actions button { width: 100%; min-height: 44px; }
  .director-institution-filter { display: grid; grid-template-columns: 1fr; align-items: stretch; width: 100%; }
  .director-institution-filter label, .director-institution-filter button { width: 100%; }
  .director-month-navigation { padding: 13px; }
  .director-month-navigation-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .director-month-buttons { grid-auto-columns: minmax(150px, 78vw); scroll-snap-type: x proximity; }
  .director-month-button { scroll-snap-align: start; min-height: 70px; }
  .director-conformity-card { border-radius: 14px; margin: 0 -2px; }
  .director-period-head { padding: 20px 16px; }
  .director-period-head h3 { font-size: 20px; }
  .deadline-pill { width: 100%; }
  .instruction-box { margin: 18px 16px 0; }
  .process-tabs { width: calc(100% - 32px); margin: 20px auto; }
  .process-tabs span { font-size: 11px; letter-spacing: .04em; }
  .auto-state { width: calc(100% - 32px); margin-top: -10px; border-radius: 10px; }
  .director-process-grid { padding: 0 16px 20px; gap: 20px; }
  .process-panel { padding: 30px 16px 18px; }
  .director-actions { display: grid; grid-template-columns: 1fr; padding: 0 16px 20px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading .btn { width: 100%; }
  .dashboard-conformities, .management-overview { border-radius: 12px; padding: 14px; }
  .institution-group-head { align-items: flex-start; flex-direction: column; }
  .month-status-grid { grid-template-columns: 1fr; }
  .month-status-card { min-height: 116px; }
  .management-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-stat { min-height: 82px; }
  .assistance-notice { align-items: flex-start; flex-direction: column; }
  .assisted-form-actions { grid-template-columns: 1fr; }
  .file-upload-box { min-height: 132px; }

  .table-wrap { border-radius: 10px; margin: 0 -2px; }
  table { min-width: 720px; }
  th, td { padding: 10px; }
  .badge { padding: 5px 9px; }

  input, select, textarea { min-height: 44px; font-size: 16px; }
  textarea { min-height: 106px; }
  .form-grid { gap: 10px; }
  .institution-assignment-list { grid-template-columns: 1fr; max-height: 340px; }
  .level-options { grid-template-columns: 1fr; }
  .month-check-grid { grid-template-columns: 1fr; gap: 8px; }
  .month-check { min-height: 58px; padding: 10px 12px; }

  .modal { padding: 0; background: rgba(15, 34, 53, .42); }
  .modal.is-open { display: block; }
  .modal-dialog { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; box-shadow: none; }
  .modal-head { position: sticky; top: 0; z-index: 2; padding: calc(13px + env(safe-area-inset-top)) 14px 13px; }
  .modal-head h3 { font-size: 17px; }
  .modal-body { overflow: auto; padding: 14px; }
  .modal-foot { position: sticky; bottom: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; }
  .modal-foot button { min-height: 44px; }
  .icon-btn { width: 38px; min-height: 38px; }

  .permissions-grid { grid-template-columns: minmax(220px, 1fr) repeat(3, 96px); margin-left: -2px; margin-right: -2px; }
  .permission-label small { font-size: 11px; }
}
@media print {
  .sidebar, .topbar, .no-print, .banner { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .panel, .table-wrap { border: 0; box-shadow: none; }
  .print-header { display: block; margin-bottom: 18px; }
  body { background: #fff; }
}
