:root {
  --ink: #17130f;
  --muted: #736d66;
  --paper: #f6f4f1;
  --surface: #ffffff;
  --line: #e8e2dc;
  --red: #e42320;
  --red-dark: #b91715;
  --green: #18774a;
  --amber: #a66a09;
  --shadow: 0 18px 48px rgba(38, 28, 20, .08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", Inter, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.btn { border-radius: 10px; font-weight: 700; padding: .72rem 1.15rem; }
.btn-lg { border-radius: 12px; padding: .9rem 1.2rem; font-size: 1rem; }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #2c2621; border-color: #2c2621; }
.btn-brand { color: #fff; background: var(--red); border-color: var(--red); }
.btn-brand:hover { color: #fff; background: var(--red-dark); border-color: var(--red-dark); }
.form-control, .form-select { border: 1px solid #d9d2cb; border-radius: 10px; color: var(--ink); padding: .72rem .85rem; }
.form-select { padding-right: 2.75rem; background-position: right .9rem center; }
.form-control:focus, .form-select:focus { border-color: var(--red); box-shadow: 0 0 0 .2rem rgba(228,35,32,.12); }
.form-label { color: #403a35; font-size: .86rem; font-weight: 700; }
.alert { border: 0; border-radius: 12px; box-shadow: 0 8px 22px rgba(30,20,10,.05); }

.brand-lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-lockup .brand-mark { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; background: var(--red); color: white; font-weight: 900; font-size: 1.45rem; box-shadow: 0 9px 22px rgba(228,35,32,.24); }
.brand-lockup div { display: flex; flex-direction: column; line-height: 1; }
.brand-lockup strong { font-size: 1rem; letter-spacing: .17em; }
.brand-lockup small { margin-top: 7px; color: #968e87; font-size: .58rem; letter-spacing: .18em; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--red); font-size: .66rem; font-weight: 900; letter-spacing: .18em; }

.guest-body { background: var(--ink); }
.guest-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(440px, .95fr); }
.guest-brand { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 56px 7vw 48px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(228,35,32,.25), transparent 31%), linear-gradient(145deg, #211b16 0%, #100d0b 75%); }
.guest-brand::after { content: ""; position: absolute; width: 420px; height: 420px; right: -190px; bottom: 5%; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.018), 0 0 0 160px rgba(255,255,255,.012); }
.guest-copy { position: relative; z-index: 1; max-width: 600px; }
.guest-copy h1 { margin: 0 0 22px; font-size: clamp(3.3rem, 6vw, 6.1rem); line-height: .86; letter-spacing: -.06em; font-weight: 900; }
.guest-copy p { max-width: 530px; margin: 0; color: #c8c0b9; font-size: 1.08rem; line-height: 1.75; }
.security-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #aaa199; font-size: .8rem; }
.security-note span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; }
.guest-panel { display: grid; min-height: 100vh; place-items: center; padding: 42px; background: var(--surface); }
.guest-panel-inner { width: min(100%, 430px); }
.login-heading { margin-bottom: 32px; }
.login-heading h2 { margin: 0 0 10px; font-size: 2.35rem; letter-spacing: -.045em; font-weight: 850; }
.login-heading p { margin: 0; color: var(--muted); }
.login-footnote { margin: 24px auto 0; max-width: 340px; color: #928a83; font-size: .76rem; text-align: center; line-height: 1.6; }
.divider { display: flex; align-items: center; gap: 12px; margin: 7px 0 20px; color: #9d948d; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 265px; display: flex; flex-direction: column; color: #fff; background: #17130f; box-shadow: 12px 0 38px rgba(20,15,10,.08); }
.sidebar-brand { padding: 27px 25px 25px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-nav { flex: 1; padding: 20px 14px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none; }
.side-nav::-webkit-scrollbar { width: 0; height: 0; }
.side-nav .nav-section { display: block; margin: 21px 12px 9px; color: #766e67; font-size: .58rem; font-weight: 900; letter-spacing: .18em; }
.side-nav a { display: flex; align-items: center; gap: 12px; margin: 4px 0; padding: 12px 13px; border-radius: 10px; color: #bdb5ae; font-size: .9rem; font-weight: 650; text-decoration: none; transition: .18s ease; }
.side-nav a span { width: 21px; text-align: center; font-size: 1.05rem; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.side-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(228,35,32,.2), rgba(228,35,32,.07)); box-shadow: inset 3px 0 0 var(--red); }
.sidebar-footer { padding: 17px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-chip > span { width: 36px; height: 36px; display: grid; flex: 0 0 36px; place-items: center; border-radius: 11px; color: #fff; background: var(--red); font-size: .8rem; font-weight: 900; }
.user-chip div { min-width: 0; display: flex; flex-direction: column; }
.user-chip strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { margin-top: 3px; color: #857c75; font-size: .62rem; }
.logout-button { width: 100%; padding: 7px; border: 0; color: #8f8780; background: transparent; font-size: .68rem; text-align: left; }
.logout-button:hover { color: #fff; }
.main-area { width: calc(100% - 265px); min-height: 100vh; margin-left: 265px; }
.topbar { height: 78px; display: flex; align-items: center; gap: 18px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.topbar > div:nth-of-type(1) { display: flex; flex-direction: column; }
.topbar-kicker { color: #9a918a; font-size: .57rem; font-weight: 900; letter-spacing: .18em; }
.topbar strong { margin-top: 4px; font-size: .93rem; }
.version-pill { margin-left: auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 30px; color: #786f68; background: #fff; font-size: .67rem; font-weight: 800; }
.menu-toggle { display: none; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.content-area { width: min(100%, 1500px); margin: 0 auto; padding: 37px 34px 60px; }
.sidebar-backdrop { display: none; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; margin-bottom: 29px; }
.page-heading h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1; letter-spacing: -.055em; font-weight: 900; }
.page-heading p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.6; }
.status-badge { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 50px; color: #635b55; background: white; font-size: .7rem; font-weight: 800; }
.status-badge i { width: 7px; height: 7px; border-radius: 50%; background: #888; }
.status-badge.success i { background: #1aaa68; box-shadow: 0 0 0 4px rgba(26,170,104,.1); }
.status-badge.warning i { background: #e19820; box-shadow: 0 0 0 4px rgba(225,152,32,.1); }
.notice-card { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 25px; padding: 17px 19px; border: 1px solid #f0d8a5; border-radius: 14px; background: #fff9ec; }
.notice-card .notice-icon { width: 31px; height: 31px; display: grid; flex: 0 0 31px; place-items: center; border-radius: 9px; color: white; background: var(--amber); font-weight: 900; }
.notice-card strong { font-size: .86rem; }
.notice-card p { margin: 4px 0 0; color: #7f6845; font-size: .78rem; }
.notice-card code { color: #684817; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.metric-card { display: flex; gap: 15px; min-height: 135px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 38px rgba(35,25,15,.035); }
.metric-icon { width: 42px; height: 42px; display: grid; flex: 0 0 42px; place-items: center; border-radius: 12px; font-weight: 900; }
.metric-icon.red { color: var(--red); background: #fff0ef; }
.metric-icon.dark { color: #fff; background: var(--ink); }
.metric-icon.amber { color: #a66500; background: #fff3dc; }
.metric-icon.green { color: var(--green); background: #eaf8f0; }
.metric-card div { display: flex; flex-direction: column; }
.metric-card small { color: #8d857e; font-size: .58rem; font-weight: 900; letter-spacing: .09em; }
.metric-card strong { margin: 7px 0 1px; font-size: 2rem; line-height: 1; letter-spacing: -.05em; }
.metric-card p { margin: auto 0 0; color: #9a918a; font-size: .68rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 20px; }
.panel-card { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 15px 45px rgba(40,30,20,.045); padding: 24px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.panel-heading h2, .panel-card > h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.03em; font-weight: 850; }
.feature-list { margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: 13px; padding: 14px 0; border-top: 1px solid #f0ece8; }
.feature-list li:first-child { border-top: 0; }
.feature-list li > span { width: 28px; height: 28px; display: grid; flex: 0 0 28px; place-items: center; border-radius: 50%; color: var(--green); background: #eaf7f0; font-size: .72rem; font-weight: 900; }
.feature-list strong { font-size: .85rem; }
.feature-list p { margin: 4px 0 0; color: #89817a; font-size: .75rem; line-height: 1.5; }
.roadmap-highlight { display: flex; min-height: 100%; flex-direction: column; color: #fff; background: radial-gradient(circle at 100% 0, rgba(228,35,32,.45), transparent 45%), var(--ink); }
.roadmap-highlight .eyebrow { color: #f66f6c; }
.version-number { margin: auto 0 5px; color: #8b8179; font-size: .75rem; font-weight: 900; letter-spacing: .1em; }
.roadmap-highlight h2 { font-size: 1.75rem; }
.roadmap-highlight p { color: #a79d94; font-size: .8rem; line-height: 1.6; }
.text-link { margin-top: 18px; color: #fff; font-size: .75rem; font-weight: 800; text-decoration: none; }

.architecture-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 14px; margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.flow-node { min-height: 120px; display: flex; flex-direction: column; justify-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fbfaf9; }
.flow-node > span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 10px; color: #fff; background: var(--ink); font-size: .65rem; font-weight: 900; }
.flow-node strong { font-size: .87rem; }
.flow-node small { margin-top: 4px; color: #999088; font-size: .68rem; }
.flow-node.primary { border-color: #f2b2b0; background: #fff6f5; }
.flow-node.primary > span { background: var(--red); }
.flow-node.muted { background: #f5f2ef; }
.flow-node.muted > span { color: #817870; background: #e5dfda; }
.flow-arrow { color: #aaa19a; font-weight: 900; }
.integration-grid { grid-template-columns: 1fr 1fr; }
.details-list { margin: 0 0 20px; }
.details-list > div { display: grid; grid-template-columns: 145px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid #eee9e5; }
.details-list > div:first-child { border-top: 0; }
.details-list dt { color: #8b837c; font-size: .72rem; }
.details-list dd { margin: 0; overflow-wrap: anywhere; font-size: .76rem; font-weight: 700; text-align: right; }
.details-list.compact { margin-top: 15px; }
.blocked-label { padding: 4px 8px; border-radius: 20px; color: #a41b19; background: #ffe9e8; font-size: .65rem; }
.health-result { display: flex; gap: 12px; padding: 16px; border-radius: 12px; background: #f4f1ee; }
.health-result > span { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 4px; border-radius: 50%; background: #888; }
.health-result.online > span { background: #1aaa68; }
.health-result.error > span { background: var(--red); }
.health-result p { margin: 3px 0 0; color: #7d746d; font-size: .72rem; }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #948b84; text-align: center; }
.empty-state > span { width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 50%; background: #f2efec; }
.empty-state strong { color: #5f5751; font-size: .83rem; }
.empty-state p { max-width: 260px; margin: 5px 0 0; font-size: .72rem; }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 20px; }
.marks-table { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.marks-head, .marks-row { display: grid; grid-template-columns: 1fr 150px 150px; gap: 12px; align-items: center; padding: 11px 14px; }
.marks-head { color: #918980; background: #f5f2ef; font-size: .58rem; font-weight: 900; letter-spacing: .1em; }
.marks-row { border-top: 1px solid var(--line); }
.marks-row label { font-size: .78rem; font-weight: 750; }
.agreement-check { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.agreement-check input { width: 18px; height: 18px; accent-color: var(--red); }
.agreement-check span { display: flex; flex-direction: column; }
.agreement-check strong { font-size: .72rem; }
.agreement-check small { color: #918981; font-size: .62rem; }
.result-card { display: flex; flex-direction: column; }
.balance-display { margin-bottom: 17px; padding: 25px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #1e1814, #322820); }
.balance-display.negative { background: linear-gradient(145deg, #8f1f1c, #45110f); }
.balance-display small { display: block; color: #958b82; font-size: .56rem; font-weight: 900; letter-spacing: .12em; }
.balance-display strong { display: block; margin: 8px 0 3px; font-size: 2.7rem; line-height: 1; letter-spacing: -.06em; }
.balance-display span { color: #b9afa7; font-size: .68rem; }
.result-metrics { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; }
.result-metrics div { padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-metrics div:nth-child(2n) { border-right: 0; }
.result-metrics div:nth-last-child(-n+2) { border-bottom: 0; }
.result-metrics small { display: block; color: #978e86; font-size: .52rem; font-weight: 900; letter-spacing: .08em; }
.result-metrics strong { display: block; margin-top: 5px; font-size: 1rem; }
.result-alerts { margin-top: 16px; padding: 14px; border-radius: 11px; color: #77531a; background: #fff7e9; }
.result-alerts strong { font-size: .72rem; }
.result-alerts ul { margin: 7px 0 0; padding-left: 17px; font-size: .67rem; line-height: 1.55; }
.empty-state.tall { flex: 1; min-height: 330px; }
.legal-note { margin: auto 0 0; padding-top: 17px; color: #9d948c; font-size: .62rem; line-height: 1.55; }

.roadmap-card { padding: 8px 26px; }
.roadmap-list { max-width: 950px; margin: 0 auto; }
.roadmap-item { display: grid; grid-template-columns: 42px 1fr; gap: 16px; min-height: 135px; }
.roadmap-line { position: relative; display: flex; justify-content: center; }
.roadmap-line::after { content: ""; position: absolute; top: 48px; bottom: 0; width: 1px; background: var(--line); }
.roadmap-item:last-child .roadmap-line::after { display: none; }
.roadmap-line > span { z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; margin-top: 28px; border: 1px solid var(--line); border-radius: 50%; color: #978e86; background: white; font-size: .7rem; font-weight: 900; }
.roadmap-item.completed .roadmap-line > span { color: white; border-color: var(--green); background: var(--green); }
.roadmap-item.in_progress .roadmap-line > span { color: white; border-color: var(--red); background: var(--red); }
.roadmap-content { padding: 24px 0 28px; border-bottom: 1px solid #eeeae6; }
.roadmap-item:last-child .roadmap-content { border-bottom: 0; }
.roadmap-meta { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.roadmap-meta > strong { color: var(--red); font-size: .66rem; letter-spacing: .08em; }
.roadmap-meta small { margin-left: auto; color: #9b928a; font-size: .64rem; }
.status-label { padding: 4px 7px; border-radius: 20px; color: #716862; background: #f0edea; font-size: .55rem; font-weight: 800; }
.completed .status-label { color: #14633f; background: #e7f6ee; }
.in_progress .status-label { color: #aa1c1a; background: #ffebea; }
.roadmap-content h2 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 850; }
.roadmap-content p { margin: 0; color: #827a73; font-size: .76rem; line-height: 1.55; }
.error-page { min-height: 65vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page > span { color: var(--red); font-size: 4rem; font-weight: 900; }
.error-page h1 { margin: 0; font-weight: 900; letter-spacing: -.04em; }
.error-page p { color: var(--muted); }

.directory-metrics { margin-bottom: 20px; }
.directory-card { padding: 0; overflow: hidden; }
.directory-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.directory-tabs { display: flex; gap: 5px; overflow-x: auto; }
.directory-tabs a { padding: 8px 11px; border-radius: 8px; color: #7e756e; font-size: .72rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.directory-tabs a:hover, .directory-tabs a.active { color: var(--ink); background: #f1eeeb; }
.directory-tabs a.active { box-shadow: inset 0 -2px 0 var(--red); }
.directory-search { display: flex; gap: 7px; min-width: min(100%, 340px); }
.directory-search .form-control { min-width: 170px; padding: .55rem .7rem; font-size: .78rem; }
.directory-search .btn { padding: .55rem .8rem; font-size: .72rem; }
.directory-table { margin: 0; }
.directory-table th { padding: 12px 17px; border-color: var(--line); color: #8d847d; background: #faf8f6; font-size: .58rem; letter-spacing: .09em; }
.directory-table td { padding: 14px 17px; border-color: #eeeae6; color: #5f5751; font-size: .74rem; }
.directory-table td strong { display: block; color: var(--ink); font-size: .79rem; }
.directory-table td small { display: block; margin-top: 3px; color: #9b928a; font-size: .61rem; }
.directory-table code { color: #6d2a28; font-size: .67rem; }
.record-status { display: inline-flex; padding: 4px 8px; border-radius: 20px; color: #706861; background: #efebe8; font-size: .57rem; font-weight: 850; }
.record-status.active, .record-status.completed { color: #12613c; background: #e5f6ed; }
.record-status.inactive, .record-status.failed { color: #a41b19; background: #ffe9e8; }
.record-status.running { color: #97600c; background: #fff2d9; }
.directory-bottom-grid { margin-top: 20px; grid-template-columns: 1.25fr .75fr; }
.sync-run-list > div { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #eeeae6; }
.sync-run-list > div:first-child { border-top: 0; }
.sync-run-list > div > div { display: flex; flex-direction: column; }
.sync-run-list strong { font-size: .76rem; }
.sync-run-list small { margin-top: 3px; color: #918980; font-size: .63rem; }
.sync-action-card, .update-action-card { display: flex; flex-direction: column; }
.sync-action-card p, .update-action-card p { color: #7f7770; font-size: .76rem; line-height: 1.65; }
.sync-action-card form, .update-action-card form { margin-top: auto; }
.sync-action-card > small, .update-action-card > small { margin-top: 13px; color: #a19891; font-size: .61rem; line-height: 1.5; }
.integration-directory-card { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 20px; }
.integration-directory-card h2 { margin: 0; }
.integration-directory-card p { margin: 7px 0 0; color: #817870; font-size: .75rem; }
.integration-directory-actions { display: flex; align-items: center; gap: 14px; }
.integration-directory-actions small { color: #938a83; font-size: .64rem; }
.update-grid { grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); }
.migration-list > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-top: 1px solid #eeeae6; }
.migration-list > div:first-child { border-top: 0; }
.migration-list code { color: #524943; font-size: .72rem; }
.migration-status { padding: 4px 8px; border-radius: 20px; color: #6c645e; background: #efebe8; font-size: .58rem; font-weight: 800; }
.migration-status.applied { color: #12613c; background: #e5f6ed; }
.migration-status.pending { color: #97600c; background: #fff2d9; }
.migration-status.modified { color: #a41b19; background: #ffe9e8; }
.danger-notice { border-color: #f1bbb9; background: #fff0ef; }
.danger-notice .notice-icon { background: var(--red); }
.danger-notice p { color: #8f3c39; }

/* Integrações Hub/CIH v3.5 */
.integration-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.integration-readiness { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.integration-readiness h2 { margin: 0; }
.readiness-items { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.integration-forms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.integration-form-card { display: flex; flex-direction: column; }
.integration-form-card form { display: flex; flex: 1; flex-direction: column; gap: 13px; }
.integration-form-card form > label { display: flex; flex-direction: column; gap: 6px; }
.integration-form-card label > span { color: #5f5751; font-size: .67rem; font-weight: 850; }
.integration-form-card label > small, .integration-form-card form > p { margin: 0; color: #958c85; font-size: .61rem; line-height: 1.5; }
.integration-form-card .btn { margin-top: auto; }
.integration-queue-card { padding: 0; overflow: hidden; }
.integration-queue-card > .panel-heading { padding: 20px; }
.integration-table td { vertical-align: middle; }
.integration-table .record-status.pending { color: #97600c; background: #fff2d9; }
.integration-table .record-status.processing { color: #214f8b; background: #eaf2ff; }
.integration-table .record-status.cancelled { color: #6f6760; background: #efebe8; }
.integration-error { display: block; max-width: 330px; color: #a41b19; font-size: .64rem; line-height: 1.4; }

/* Produção, relatórios e auditoria v4.0 */
.report-metrics, .production-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-export-card { margin-bottom: 20px; }
.report-export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.report-export-grid form { display: flex; min-height: 170px; flex-direction: column; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #faf8f6; }
.report-export-grid strong { font-size: .86rem; }
.report-export-grid p { margin: 7px 0 18px; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.report-export-grid .btn { margin-top: auto; }
.report-history-card, .audit-log-card, .production-runs-card { margin-top: 20px; }
.audit-filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)) auto; gap: 12px; align-items: end; }
.audit-filter-grid label { display: flex; flex-direction: column; gap: 6px; }
.audit-filter-grid label span { color: #5f5751; font-size: .67rem; font-weight: 850; }
.audit-top-grid { grid-template-columns: minmax(0, 1.5fr) minmax(270px, .5fr); margin-bottom: 20px; }
.audit-checkpoints > div, .evidence-list > div, .readiness-check-list > div { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #eeeae6; }
.audit-checkpoints > div:first-child, .evidence-list > div:first-child, .readiness-check-list > div:first-child { border-top: 0; }
.audit-checkpoints > div > div, .evidence-list > div > div, .readiness-check-list > div > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.audit-checkpoints strong, .evidence-list strong, .readiness-check-list strong { font-size: .76rem; }
.audit-checkpoints small, .evidence-list small, .readiness-check-list small { margin-top: 3px; color: #918980; font-size: .63rem; line-height: 1.4; }
.audit-checkpoints code, .evidence-list code { color: #6d2a28; font-size: .62rem; }
.audit-export-card { display: flex; flex-direction: column; }
.audit-export-card p, .section-note { color: var(--muted); font-size: .72rem; line-height: 1.65; }
.audit-export-card form { margin-top: auto; }
.production-top-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .45fr); margin-bottom: 20px; }
.readiness-check-list { max-height: 590px; overflow-y: auto; padding-right: 5px; }
.production-guide-card { color: #fff; background: radial-gradient(circle at 100% 0, rgba(228,35,32,.36), transparent 42%), var(--ink); }
.production-guide-card .eyebrow { color: #f66f6c; }
.production-guide-card ol { margin: 22px 0; padding-left: 21px; color: #ded7d1; font-size: .75rem; line-height: 2; }
.production-guide-card p { margin: auto 0 0; color: #9f968e; font-size: .68rem; line-height: 1.65; }
.homologation-card { margin-bottom: 20px; }
.homologation-list article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .55fr); gap: 25px; padding: 18px 0; border-top: 1px solid #eeeae6; }
.homologation-list article:first-child { border-top: 0; }
.homologation-copy { display: flex; align-items: flex-start; gap: 13px; }
.homologation-copy > div { display: flex; flex-direction: column; }
.homologation-copy small { color: #9b928a; font-size: .55rem; font-weight: 850; letter-spacing: .08em; }
.homologation-copy strong { margin-top: 5px; font-size: .83rem; }
.homologation-copy p { margin: 5px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.homologation-copy em { margin-top: 7px; color: #52695d; font-size: .62rem; font-style: normal; }
.homologation-list form { display: grid; grid-template-columns: 120px minmax(180px, 1fr) auto; gap: 8px; align-items: center; }
.production-evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-notice { margin-bottom: 12px; padding: 12px 14px; }
.compact-notice .notice-icon { width: 26px; height: 26px; flex-basis: 26px; }
.record-status.pending { color: #97600c; background: #fff2d9; }
.error-page small { display: block; margin-bottom: 18px; color: #8e857e; }

@media (max-width: 1180px) {
  .audit-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .audit-filter-grid .btn { grid-column: span 3; }
  .homologation-list article { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .report-export-grid, .production-evidence-grid { grid-template-columns: 1fr; }
  .audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-filter-grid .btn { grid-column: span 2; }
  .audit-top-grid, .production-top-grid { grid-template-columns: 1fr; }
  .homologation-list form { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .audit-filter-grid { grid-template-columns: 1fr; }
  .audit-filter-grid .btn { grid-column: auto; }
}

/* Core operacional v2.5 */
.filter-card { margin-bottom: 20px; padding: 18px 20px; }
.filter-grid, .form-grid { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 14px; align-items: end; }
.filter-grid.five, .form-grid.five { grid-template-columns: repeat(4, minmax(145px, 1fr)) auto; }
.filter-grid.six { grid-template-columns: repeat(5, minmax(130px, 1fr)) auto; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(3, minmax(160px, 1fr)) auto; }
.form-grid label, .filter-grid label, .schedule-form > label, .upload-zone, .approval-actions label { display: flex; flex-direction: column; gap: 6px; }
.form-grid label > span, .filter-grid label > span, .schedule-form label > span, .approval-actions label > span { color: #5f5751; font-size: .67rem; font-weight: 850; }
.form-grid label > small, .schedule-form label > small { color: #9a9189; font-size: .6rem; }
.span-two { grid-column: span 2; }
.assignment-card, .quick-entry-card, .calculation-run-card, .adjustment-card { margin-bottom: 20px; }
.quick-entry-card, .calculation-run-card, .adjustment-card { display: grid; grid-template-columns: minmax(220px, .45fr) minmax(0, 1.55fr); gap: 28px; align-items: end; }
.quick-entry-card h2, .calculation-run-card h2, .adjustment-card h2 { margin: 0; font-size: 1.25rem; }
.quick-entry-card p, .calculation-run-card p, .adjustment-card p { margin: 7px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.schedule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.schedule-card { display: flex; flex-direction: column; min-height: 315px; }
.schedule-card.is-inactive { opacity: .7; }
.schedule-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-card-head small { overflow: hidden; color: #8d857e; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.schedule-card h2 { margin: 18px 0; font-size: 1.32rem; }
.schedule-facts { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.schedule-facts > div { padding: 12px 9px; border-left: 1px solid var(--line); text-align: center; }
.schedule-facts > div:first-child { border-left: 0; }
.schedule-facts strong, .schedule-facts span { display: block; }
.schedule-facts strong { font-size: .9rem; }
.schedule-facts span { margin-top: 3px; color: #948c85; font-size: .55rem; }
.schedule-card ul { margin: 16px 0; padding-left: 18px; color: #756d66; font-size: .68rem; line-height: 1.7; }
.schedule-card form { margin-top: auto; }
.wide { grid-column: 1 / -1; }
.schedule-form { max-width: 1320px; margin: 0 auto; }
.section-heading { margin: 32px 0 12px; padding-top: 23px; border-top: 1px solid var(--line); }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: .7rem; }
.weekly-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.weekday-row { display: grid; grid-template-columns: 180px repeat(4, 1fr); gap: 12px; align-items: end; padding: 13px 15px; border-top: 1px solid var(--line); }
.weekday-row:first-child { border-top: 0; }
.weekday-row > strong { align-self: center; font-size: .77rem; }
.weekday-row label { display: flex; flex-direction: column; gap: 5px; }
.weekday-row label span { color: #8c837c; font-size: .56rem; font-weight: 800; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.table-card { padding: 0; overflow: hidden; }
.table-card > .panel-heading { padding: 21px 22px 0; }
.operational-table { margin: 0; }
.operational-table th { padding: 12px 15px; border-color: var(--line); color: #8d847d; background: #faf8f6; font-size: .56rem; letter-spacing: .08em; white-space: nowrap; }
.operational-table td { padding: 13px 15px; border-color: #eeeae6; color: #625a54; font-size: .7rem; }
.operational-table td > strong { display: block; color: var(--ink); font-size: .76rem; }
.operational-table td > small { display: block; margin-top: 3px; color: #9a9189; font-size: .58rem; }
.positive-value { color: var(--green) !important; }
.negative-value { color: var(--red-dark) !important; }
.import-grid { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); }
.upload-zone { position: relative; align-items: center; justify-content: center; min-height: 190px; padding: 25px; border: 2px dashed #d8d0c9; border-radius: 14px; background: #faf8f6; text-align: center; cursor: pointer; }
.upload-zone > span { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--red); font-weight: 900; }
.upload-zone strong { margin-top: 8px; font-size: .82rem; }
.upload-zone small { color: #958c85; font-size: .65rem; }
.upload-zone input { width: 100%; margin-top: 12px; font-size: .68rem; }
.csv-guide { margin-top: 20px; padding: 16px; border-radius: 12px; background: #f4f1ee; }
.csv-guide strong, .csv-guide code { display: block; }
.csv-guide strong { margin-bottom: 8px; font-size: .7rem; }
.csv-guide code { overflow-wrap: anywhere; color: #7b2c29; font-size: .67rem; }
.csv-guide p { margin: 9px 0 0; color: #7c746d; font-size: .64rem; line-height: 1.6; }
.batch-list > div, .recent-calculations > div { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #eeeae6; }
.batch-list > div:first-child, .recent-calculations > div:first-child { border-top: 0; }
.batch-list > div > div, .recent-calculations > div > div { display: flex; min-width: 0; flex-direction: column; }
.batch-list strong, .recent-calculations strong { overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.batch-list small, .recent-calculations small { margin-top: 4px; color: #958c85; font-size: .6rem; }
.dark-link { color: var(--ink); }
.balance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.balance-card { min-height: 175px; display: flex; flex-direction: column; padding: 20px; border-radius: 16px; color: white; background: linear-gradient(145deg, #1b2d24, #164b34); box-shadow: var(--shadow); }
.balance-card.negative { background: linear-gradient(145deg, #781d1a, #3d100e); }
.balance-card small { overflow: hidden; color: rgba(255,255,255,.55); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.balance-card > strong { margin-top: 7px; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.balance-card > span { margin: auto 0 2px; font-size: 2rem; font-weight: 900; letter-spacing: -.05em; }
.balance-card em { color: rgba(255,255,255,.6); font-size: .6rem; font-style: normal; }
.approval-list { display: grid; gap: 15px; }
.approval-card { padding: 20px 22px; }
.approval-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.approval-meta small { color: #988f88; font-size: .62rem; }
.approval-body { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(330px, .8fr); gap: 30px; align-items: end; }
.approval-body h2 { margin: 0 0 7px; font-size: 1.2rem; }
.approval-body p { margin: 0 0 8px; color: #736b64; font-size: .74rem; line-height: 1.55; }
.approval-body > div > small { color: #999089; font-size: .6rem; }
.approval-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.approval-actions > div { display: flex; gap: 8px; }
.decision-summary { padding: 14px; border-radius: 11px; background: #f5f2ef; }
.decision-summary strong { font-size: .68rem; }
.decision-summary p { margin: 5px 0 0; font-size: .65rem; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .calculator-layout { grid-template-columns: 1fr; }
  .result-card { min-height: 420px; }
  .schedule-grid { grid-template-columns: 1fr 1fr; }
  .balance-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid.five, .filter-grid.six, .form-grid.five { grid-template-columns: 1fr 1fr; }
  .quick-entry-card, .calculation-run-card, .adjustment-card { grid-template-columns: 1fr; }
  .integration-forms-grid { grid-template-columns: 1fr 1fr; }
  .integration-forms-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 850px) {
  .guest-shell { grid-template-columns: 1fr; }
  .guest-brand { min-height: 380px; padding: 35px; }
  .guest-copy h1 { font-size: 3.5rem; }
  .security-note { display: none; }
  .guest-panel { min-height: auto; padding: 50px 25px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { width: 100%; margin-left: 0; }
  .menu-toggle { display: block; }
  .sidebar-backdrop.show { position: fixed; z-index: 20; inset: 0; display: block; background: rgba(0,0,0,.45); }
  .dashboard-grid, .integration-grid { grid-template-columns: 1fr; }
  .directory-bottom-grid, .update-grid { grid-template-columns: 1fr; }
  .directory-toolbar, .integration-directory-card, .integration-directory-actions { align-items: stretch; flex-direction: column; }
  .directory-search { width: 100%; }
  .weekday-row { grid-template-columns: 1fr 1fr; }
  .weekday-row > strong { grid-column: 1 / -1; }
  .approval-body { grid-template-columns: 1fr; }
  .integration-metrics, .integration-forms-grid { grid-template-columns: 1fr 1fr; }
  .integration-readiness { align-items: stretch; flex-direction: column; }
  .readiness-items { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .content-area { padding: 25px 17px 45px; }
  .topbar { height: 68px; padding: 0 17px; }
  .page-heading { flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .architecture-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
  .marks-head, .marks-row { grid-template-columns: 1fr 1fr; }
  .marks-head span:first-child { display: none; }
  .marks-row label { grid-column: 1 / -1; }
  .roadmap-card { padding: 5px 12px; }
  .roadmap-item { grid-template-columns: 34px 1fr; gap: 8px; }
  .schedule-grid, .balance-grid, .form-grid.two, .form-grid.four, .filter-grid, .filter-grid.five, .filter-grid.six, .form-grid.five, .approval-actions { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .weekday-row { grid-template-columns: 1fr 1fr; }
  .integration-metrics, .integration-forms-grid { grid-template-columns: 1fr; }
  .integration-forms-grid > :last-child { grid-column: auto; }
}

/* Gestão Trabalhista v3.0 */
.workforce-actions { margin-bottom: 20px; }
.check-card { min-height: 58px; flex-direction: row !important; align-items: center; gap: 10px !important; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #faf8f6; }
.check-card input { width: 18px; height: 18px; accent-color: var(--red); }
.check-card span { display: flex; flex-direction: column; }
.check-card strong { color: var(--ink); font-size: .7rem; }
.check-card small { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.document-publish-card, .employee-request-card { display: grid; grid-template-columns: minmax(250px, .55fr) minmax(0, 1.45fr); gap: 30px; margin-bottom: 20px; }
.document-publish-card h2, .employee-request-card h2 { margin: 0; }
.document-publish-card > div > p, .employee-request-card > div > p { color: var(--muted); font-size: .72rem; line-height: 1.6; }
.employee-hero { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 20px; padding: 28px 30px; border-radius: 17px; color: white; background: linear-gradient(135deg, #17130f, #3a2e27); box-shadow: var(--shadow); }
.employee-hero h2 { margin: 3px 0; font-size: 1.8rem; }
.employee-hero p { margin: 0; color: rgba(255,255,255,.55); font-size: .68rem; }
.employee-hero > strong { font-size: 2.2rem; text-align: right; }
.employee-hero > strong small { display: block; color: rgba(255,255,255,.55); font-size: .6rem; letter-spacing: .03em; }
.portal-metrics { margin-bottom: 20px; }
.portal-grid { margin-bottom: 20px; }
.document-list > article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.document-list > article:first-child { border-top: 0; }
.document-list article > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.document-list article strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.document-list article small { color: var(--muted); font-size: .6rem; }
.document-actions { width: min(420px, 55%); }
.document-actions form { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.document-actions form:first-child { margin-top: 0; }
.document-actions .form-check { margin: 0 auto 0 0; font-size: .63rem; }
.proof-code { max-width: 45%; overflow-wrap: anywhere; color: #665c54; font-size: .57rem; text-align: right; }
.vacation-mini-list > div { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.vacation-mini-list > div:first-child { border-top: 0; }
.vacation-mini-list > div > div { display: flex; flex-direction: column; }
.vacation-mini-list strong { font-size: .75rem; }
.vacation-mini-list small { margin-top: 4px; color: var(--muted); font-size: .6rem; line-height: 1.5; }
@media (max-width: 850px) {
  .document-publish-card, .employee-request-card { grid-template-columns: 1fr; }
  .document-list > article { align-items: stretch; flex-direction: column; }
  .document-actions { width: 100%; }
  .proof-code { max-width: 100%; text-align: left; }
}
@media (max-width: 620px) {
  .employee-hero { align-items: flex-start; flex-direction: column; }
  .employee-hero > strong { text-align: left; }
}

/* Operação Assistida v4.1 */
.operations-main-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); margin: 20px 0; }
.operations-recovery-grid { grid-template-columns: minmax(320px, .65fr) minmax(0, 1.35fr); }
.stack-form { display: grid; gap: 13px; }
.stack-form label { display: grid; gap: 6px; color: #6d645d; font-size: .63rem; font-weight: 700; letter-spacing: .02em; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.incident-list a { color: var(--ink); text-decoration: none; }
.incident-list a:hover { color: var(--red); }
.incident-list p, .evidence-list p { margin: 5px 0 0; color: #746b64; font-size: .64rem; line-height: 1.5; }
.incident-history-card { margin-bottom: 20px; }
.operations-alert-list article, .routine-list article { grid-template-columns: minmax(0, 1fr) minmax(330px, .48fr); }
.operations-alert-list form { grid-template-columns: minmax(150px, 1fr) auto; }
.recovery-form { align-self: start; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #faf8f6; }
.recovery-form > small { color: var(--muted); font-size: .62rem; line-height: 1.5; }
@media (max-width: 1000px) {
  .operations-main-grid, .operations-recovery-grid { grid-template-columns: 1fr; }
  .operations-alert-list article, .routine-list article { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .form-row { grid-template-columns: 1fr; }
  .operations-alert-list form, .routine-list form { grid-template-columns: 1fr; }
}

/* Migração definitiva e escala v5.0 */
.migration-safety-card { margin-bottom: 20px; }
.safety-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.safety-steps > div { min-height: 84px; display: flex; flex-direction: column; justify-content: center; padding: 14px; border-left: 1px solid var(--line); background: #faf8f6; }
.safety-steps > div:first-child { border-left: 0; }
.safety-steps strong { font-size: .72rem; }
.safety-steps small { margin-top: 5px; color: var(--muted); font-size: .6rem; line-height: 1.45; }
.migration-main-grid { grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); margin-bottom: 20px; }
.migration-plan-list > div.is-selected { margin: 0 -12px; padding-right: 12px; padding-left: 12px; border-radius: 10px; background: #faf5f2; }
.migration-plan-list a { color: var(--ink); text-decoration: none; }
.migration-plan-list a:hover { color: var(--red); }
.migration-plan-form { display: grid; gap: 13px; }
.migration-plan-form > label, .migration-plan-form .form-grid label { display: grid; gap: 6px; }
.migration-plan-form label > span { color: #5f5751; font-size: .67rem; font-weight: 850; }
.migration-plan-form label > small, .mapping-help { color: var(--muted); font-size: .61rem; line-height: 1.55; }
.mapping-help { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #faf8f6; }
.mapping-help summary { color: #5f5751; font-weight: 800; cursor: pointer; }
.mapping-help p { margin: 8px 0 0; }
.selected-plan-card { margin-bottom: 20px; }
.selected-plan-grid, .scale-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.selected-plan-grid > div, .scale-result-grid > div { display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #faf8f6; }
.selected-plan-grid small, .scale-result-grid small { color: #8e857e; font-size: .55rem; font-weight: 850; letter-spacing: .08em; }
.selected-plan-grid strong, .scale-result-grid strong { margin-top: 6px; font-size: .88rem; }
.selected-plan-grid code { margin-top: 5px; color: #6d2a28; font-size: .61rem; }
.preflight-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.preflight-grid > div { min-height: 75px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.preflight-grid small { color: var(--muted); font-size: .59rem; line-height: 1.45; }
.migration-actions { align-items: center; }
.migration-actions form { margin: 0; }
.migration-wave-card { margin-bottom: 20px; }
.migration-wave-actions { min-width: 230px; }
.migration-wave-actions form { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 6px; }
.migration-wave-actions form:first-child { margin-top: 0; }
.migration-wave-actions form .btn:only-child { grid-column: 1 / -1; }
.scale-control-card { margin-bottom: 20px; }
.scale-result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 15px; }

@media (max-width: 1100px) {
  .safety-steps, .preflight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safety-steps > div { border-top: 1px solid var(--line); }
  .migration-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .safety-steps, .preflight-grid, .selected-plan-grid, .scale-result-grid { grid-template-columns: 1fr; }
  .safety-steps > div { border-left: 0; }
  .migration-wave-actions { min-width: 190px; }
}

/* App Core / PWA v5.0.4 */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.install-app-button { min-height: 38px; padding: 8px 13px; border: 1px solid #7d2422; border-radius: 999px; color: #7d2422; background: #fff; font-size: .67rem; font-weight: 800; }
.install-app-button:hover, .install-app-button:focus-visible { color: #fff; background: #7d2422; }
.connection-banner { position: fixed; z-index: 80; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); left: max(14px, env(safe-area-inset-left)); padding: 11px 16px; border-radius: 10px; color: #fff; background: #4b211f; box-shadow: var(--shadow); text-align: center; font-size: .72rem; }
.ios-install-hint { position: fixed; z-index: 90; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: min(390px, calc(100vw - 28px)); padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.ios-install-hint strong, .ios-install-hint span { display: block; }
.ios-install-hint span { margin: 6px 0 12px; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.ios-install-hint button { min-height: 40px; border: 0; border-radius: 8px; color: #fff; background: #7d2422; padding: 8px 14px; }
@media (max-width: 620px) {
  .topbar-kicker { display: none; }
  .topbar-actions { gap: 6px; }
  .install-app-button { max-width: 125px; min-height: 44px; padding: 7px 10px; }
  button, .btn, input, select, textarea { font-size: 16px; }
  .content-area { padding-bottom: max(45px, env(safe-area-inset-bottom)); }
}
