:root {
  color-scheme: light;
  --navy-950: #10233d;
  --navy-900: #17345c;
  --navy-800: #214670;
  --navy-100: #e9f0f8;
  --orange: #ef7611;
  --orange-dark: #d95f00;
  --orange-soft: #fff2e5;
  --green: #168b55;
  --green-soft: #e8f7ef;
  --yellow: #bd7b0b;
  --yellow-soft: #fff7df;
  --red: #c53c47;
  --red-soft: #ffeaec;
  --ink: #182436;
  --muted: #66758a;
  --line: #dde4ec;
  --canvas: #f3f6f9;
  --white: #fff;
  --shadow: 0 12px 34px rgba(16, 35, 61, .09);
  --radius: 16px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.svg-icon { width: 1em; height: 1em; display: inline-block; flex: 0 0 auto; background-color: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(420px, .95fr);
  background:
    radial-gradient(circle at 17% 18%, rgba(239, 118, 17, .22), transparent 24%),
    linear-gradient(140deg, var(--navy-950), var(--navy-800) 58%, #2d5781);
}
.login-shell::before {
  content: "";
  position: fixed;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  left: -180px;
  bottom: -210px;
  box-shadow: 0 0 0 80px rgba(255, 255, 255, .025), 0 0 0 160px rgba(255, 255, 255, .018);
}
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(32px, 6vw, 82px); color: white; position: relative; z-index: 1; }
.login-brand span { display: block; color: rgba(255, 255, 255, .66); font-size: 14px; }
.brand-logo { display: block; width: 100%; height: auto; }
.login-logo { width: min(280px, 70vw); }
.login-card { align-self: center; justify-self: center; width: min(460px, calc(100% - 48px)); padding: clamp(30px, 4vw, 48px); border-radius: 22px; background: rgba(255, 255, 255, .98); box-shadow: 0 28px 80px rgba(5, 16, 30, .3); position: relative; z-index: 2; }
.login-heading { margin-bottom: 30px; }
.login-heading h1 { margin: 8px 0 8px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; }
.login-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.login-help { display: block; margin-top: 22px; text-align: center; color: #8792a1; }

.eyebrow { color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.form-stack { display: grid; gap: 17px; }
.form-stack label, .form-grid label { display: grid; gap: 7px; color: #46546a; font-size: 13px; font-weight: 700; }
input, select { width: 100%; min-height: 46px; border: 1px solid #ccd6e0; border-radius: 10px; padding: 10px 13px; background: white; color: var(--ink); outline: none; transition: border-color .16s, box-shadow .16s; }
input:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239, 118, 17, .14); }
.password-field { display: flex; position: relative; }
.password-field input { padding-right: 48px; }
.password-field .icon-button { position: absolute; right: 5px; top: 4px; }
.check-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; font-weight: 500 !important; }
.check-line input { min-height: 0; width: 17px; height: 17px; accent-color: var(--orange); }
.form-error { color: var(--red); min-height: 18px; margin: -5px 0 0; font-size: 13px; font-weight: 600; }

.button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 750; transition: transform .14s, background .14s, border-color .14s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { background: var(--orange); color: white; box-shadow: 0 8px 20px rgba(239, 118, 17, .22); }
.button.primary:hover { background: var(--orange-dark); }
.button.secondary { background: white; border-color: var(--line); color: var(--navy-800); }
.button.secondary:hover { border-color: #b9c6d5; background: #f9fafc; }
.button.large { min-height: 50px; }
.button.compact { min-height: 38px; padding: 8px 13px; }
.button > .svg-icon { font-size: 17px; }
.icon-button { border: 0; background: transparent; color: inherit; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; }
.icon-button:hover { background: rgba(23, 52, 92, .07); }
.text-button { border: 0; background: transparent; color: var(--orange-dark); font-weight: 750; white-space: nowrap; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 22px 16px 18px; background: var(--navy-950); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 28px; }
.sidebar-logo { width: 168px; }
.navigation { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 6px; padding-right: 3px; }
.nav-item { width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; display: flex; gap: 13px; align-items: center; background: transparent; color: rgba(255, 255, 255, .7); text-align: left; font-weight: 650; }
.navigation a.nav-item { text-decoration: none; }
.nav-item > span { width: 20px; color: rgba(255, 255, 255, .48); font-size: 18px; text-align: center; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: white; }
.nav-item.active { background: linear-gradient(90deg, rgba(239, 118, 17, .24), rgba(239, 118, 17, .08)); color: white; box-shadow: inset 3px 0 var(--orange); }
.nav-item.active > span { color: var(--orange); }
.sidebar-footer { flex: 0 0 auto; margin-top: auto; padding-top: 16px; display: grid; gap: 8px; background: var(--navy-950); }
.api-state { border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .035); }
.api-state i { width: 9px; height: 9px; border-radius: 50%; background: #36d287; box-shadow: 0 0 0 5px rgba(54, 210, 135, .1); }
.api-state strong, .api-state span { display: block; }
.api-state strong { font-size: 12px; }.api-state span { color: rgba(255, 255, 255, .5); font-size: 10px; margin-top: 2px; }
.nav-item.danger { color: #ff9ba3; }

.main-column { min-width: 0; }
.topbar { min-height: 84px; padding: 17px clamp(20px, 3vw, 42px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 3px 0 0; font-size: clamp(20px, 2vw, 25px); letter-spacing: -.025em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.user-chip > span { width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-800); font-weight: 850; }
.user-chip strong, .user-chip small { display: block; }.user-chip strong { font-size: 13px; }.user-chip small { color: var(--muted); margin-top: 2px; }
.content { padding: clamp(20px, 3vw, 38px); max-width: 1680px; margin: 0 auto; }
.settings-grid { max-width: 720px; }
.settings-panel .button { justify-self: start; }
.page-view { display: none; animation: appear .18s ease; }.page-view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
.section-toolbar { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-toolbar h2 { margin: 0 0 5px; font-size: clamp(20px, 2.5vw, 26px); letter-spacing: -.03em; }.section-toolbar p { margin: 0; color: var(--muted); font-size: 14px; }
.period-select { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 750; }.period-select select { min-height: 38px; width: 122px; padding: 7px 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; background: white; box-shadow: 0 4px 18px rgba(16, 35, 61, .035); }
.metric-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--orange-soft); color: var(--orange-dark); font-size: 18px; font-style: normal; }
.metric-card strong { display: block; overflow: hidden; text-overflow: ellipsis; margin: 13px 0 5px; font-size: clamp(23px, 2.2vw, 30px); letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 11px; }
.metric-card small b { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: white; box-shadow: 0 4px 18px rgba(16, 35, 61, .035); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 20px; }.panel-heading h3 { margin: 0 0 4px; font-size: 16px; }.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }.panel-heading > strong { color: var(--navy-900); font-size: 18px; white-space: nowrap; }
.bar-chart { height: 230px; display: flex; align-items: flex-end; gap: clamp(4px, .8vw, 10px); padding: 17px 2px 0; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.bar-chart::before, .bar-chart::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed #e8edf2; }.bar-chart::before { top: 34%; }.bar-chart::after { top: 67%; }
.bar { flex: 1; min-width: 4px; height: max(3px, var(--height)); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--orange), #ff9b45); z-index: 1; position: relative; transition: opacity .15s; }
.bar:hover { opacity: .76; }.bar::after { content: attr(data-label); position: absolute; display: none; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); padding: 6px 8px; border-radius: 7px; background: var(--navy-950); color: white; font-size: 10px; white-space: nowrap; }.bar:hover::after { display: block; }
.empty-state { padding: 34px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.health-list { display: grid; gap: 11px; }.health-item { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 11px; background: #f7f9fb; }.health-item > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; }.health-item strong, .health-item small { display: block; }.health-item strong { font-size: 13px; }.health-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }.health-item b { margin-left: auto; font-size: 12px; }.health-item.good > span { color: var(--green); background: var(--green-soft); }.health-item.warn > span { color: var(--yellow); background: var(--yellow-soft); }.health-item.bad > span { color: var(--red); background: var(--red-soft); }

.table-panel { padding: 0; overflow: hidden; }.table-panel > .panel-heading { padding: 20px 20px 0; }.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }th { padding: 11px 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafc; color: #778397; text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }td { padding: 14px 17px; border-bottom: 1px solid #edf1f5; color: #3e4d62; font-size: 12px; }tbody tr:last-child td { border-bottom: 0; }tbody tr:hover { background: #fbfcfd; }.cell-title { color: var(--ink); font-weight: 750; }.cell-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }.actions-column { text-align: right; }.table-actions { display: flex; justify-content: flex-end; gap: 5px; }.table-action { min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; display: inline-grid; place-items: center; background: white; color: var(--navy-800); font-size: 15px; }.table-action:hover { border-color: #aebccc; }.table-action.danger { color: var(--red); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 800; }.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }.status-badge.online { background: var(--green-soft); color: var(--green); }.status-badge.online::before { background: var(--green); }.status-badge.idle { background: var(--yellow-soft); color: var(--yellow); }.status-badge.idle::before { background: var(--yellow); }.status-badge.offline { background: var(--red-soft); color: var(--red); }.status-badge.offline::before { background: var(--red); }.status-badge.inactive { background: #edf0f4; color: #707b89; }.status-badge.inactive::before { background: #8993a0; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }.legend span { display: flex; align-items: center; gap: 6px; }.dot { width: 7px; height: 7px; border-radius: 50%; }.dot.online { background: var(--green); }.dot.idle { background: var(--yellow); }.dot.offline { background: var(--red); }

.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }.server-card { padding: 0; overflow: hidden; }.server-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line); }.server-title h3 { margin: 0; font-size: 15px; }.server-title small { display: block; color: var(--muted); margin-top: 3px; }.server-components { display: grid; grid-template-columns: 1fr 1fr; }.server-component { padding: 18px 19px; }.server-component + .server-component { border-left: 1px solid var(--line); }.server-component header { display: flex; justify-content: space-between; align-items: center; }.server-component h4 { margin: 0; font-size: 12px; }.server-component p { margin: 11px 0 0; color: var(--muted); font-size: 11px; }.server-component strong { display: block; margin-top: 4px; color: var(--ink); font-size: 13px; }
.account-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(360px, 1.2fr); gap: 18px; max-width: 980px; }.profile-panel { display: flex; align-items: center; gap: 17px; }.profile-avatar { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 18px; background: var(--navy-100); color: var(--navy-800); font-size: 28px; font-weight: 900; }.profile-panel h3 { margin: 5px 0 2px; }.profile-panel p { margin: 0; color: var(--muted); }
.fiscal-grid { max-width: none; grid-template-columns: minmax(0, 1fr); }
.certificate-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.inline-actions, .inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form { padding: 0 20px 18px; }.inline-form label { display: grid; gap: 7px; min-width: 210px; color: #46546a; font-size: 13px; font-weight: 700; }
.token-result { margin: 0 20px 18px; padding: 13px; border: 1px solid rgba(31, 157, 99, .3); border-radius: 10px; background: var(--green-soft); }.token-result strong, .token-result small { display: block; }.token-result code { display: block; overflow-wrap: anywhere; margin: 8px 0; user-select: all; font-size: 12px; }

.fiscal-filters { margin-bottom: 20px; padding: 18px 20px 17px; border-color: rgba(239, 118, 17, .32); border-radius: 11px; box-shadow: 0 5px 18px rgba(16, 35, 61, .045); }
.fiscal-filter-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }
.fiscal-filter-heading > .svg-icon { color: var(--orange-dark); font-size: 18px; }
.fiscal-filter-heading h3 { margin: 0; color: var(--navy-950); font-size: 13px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 14px 16px; align-items: end; }
.filter-grid label { display: grid; gap: 6px; color: #46546a; font-size: 10px; font-weight: 650; }
.filter-grid input, .filter-grid select { min-height: 39px; padding: 8px 11px; border-color: rgba(239, 118, 17, .28); border-radius: 7px; background-color: #fafcfe; font-size: 11px; }
.filter-search { grid-column: auto; }
.search-input { display: flex; align-items: center; position: relative; }
.search-input i { position: absolute; left: 11px; z-index: 1; color: var(--navy-800); font-size: 18px; font-style: normal; }
.search-input i .svg-icon { display: block; }
.search-input input { padding-left: 34px; }
.filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding-top: 2px; }
.clear-filter-button { color: var(--navy-800); font-size: 11px; }
.fiscal-consult-button { min-width: 110px; min-height: 38px; border-radius: 7px; padding: 8px 20px; font-size: 11px; }
.fiscal-table-panel { margin-bottom: 20px; border-color: rgba(239, 118, 17, .3); border-radius: 11px; box-shadow: 0 5px 18px rgba(16, 35, 61, .045); }
.table-panel > .fiscal-table-heading { min-height: 55px; margin: 0; padding: 16px 20px; align-items: center; }
.fiscal-table-heading h3 { margin: 0; color: var(--navy-950); font-size: 13px; }
.fiscal-table-heading p { display: flex; align-items: center; gap: 6px; color: var(--navy-800); font-size: 10px; }
.fiscal-table-heading p .svg-icon { font-size: 13px; }
.fiscal-table-panel th { padding: 12px 16px; border-color: #d9e2ec; background: #edf3f8; color: #52637a; }
.fiscal-table-panel td { padding: 18px 16px; border-color: rgba(239, 118, 17, .2); vertical-align: middle; }
.fiscal-table-panel tbody tr:hover { background: #fffaf6; }
.fiscal-document-number { color: var(--navy-950); }
.fiscal-item-count { color: var(--navy-950); font-weight: 750; }
.payment-label { display: inline-flex; align-items: center; gap: 7px; color: #34465e; }
.payment-label .svg-icon { color: var(--navy-800); font-size: 14px; }
.fiscal-total { color: var(--navy-950); font-size: 13px; }
.fiscal-row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.fiscal-icon-action { width: 30px; height: 30px; border: 0; border-radius: 7px; display: inline-grid; place-items: center; background: transparent; color: var(--navy-800); text-decoration: none; font-size: 15px; }
.fiscal-icon-action:hover { background: var(--navy-100); color: var(--orange-dark); }
.table-pagination { min-height: 58px; padding: 12px 19px; border-top: 1px solid rgba(239, 118, 17, .22); display: flex; justify-content: space-between; align-items: center; gap: 18px; background: #fff; }
.table-pagination > span { color: var(--muted); font-size: 10px; font-weight: 500; }
.pagination-controls, .page-numbers { display: flex; align-items: center; gap: 5px; }
.pagination-nav, .page-number { min-width: 29px; height: 29px; padding: 0 8px; border: 0; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; background: transparent; color: var(--navy-800); font-size: 10px; }
.pagination-nav:hover:not(:disabled), .page-number:hover { background: var(--navy-100); }
.pagination-nav:disabled { color: #b5bec9; cursor: default; }
.page-number.active { background: var(--orange-dark); color: white; box-shadow: 0 4px 10px rgba(217, 95, 0, .2); }
.page-ellipsis { padding: 0 3px; color: var(--muted); font-size: 11px; }

.modal.fiscal-document-modal { width: min(1180px, calc(100vw - 30px)); }
.download-button { text-decoration: none; }
.fiscal-document-content { background: #f7f9fb; }
.fiscal-detail-heading { margin: -21px -22px 18px; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: white; border-bottom: 1px solid var(--line); }
.fiscal-detail-heading > div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.fiscal-detail-heading > strong { color: var(--navy-900); font-size: 23px; }
.fiscal-message { margin-bottom: 16px; padding: 12px 14px; display: grid; gap: 4px; border-radius: 10px; font-size: 12px; }
.fiscal-message strong { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.fiscal-message.success { color: var(--green); background: var(--green-soft); border: 1px solid rgba(22, 139, 85, .2); }
.fiscal-message.error { color: var(--red); background: var(--red-soft); border: 1px solid rgba(197, 60, 71, .2); }
.detail-section { margin-top: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.detail-section:first-of-type { margin-top: 0; }
.detail-section > h3 { margin: 0 0 14px; color: var(--navy-900); font-size: 14px; }
.detail-section > h3 small { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.detail-grid > div { min-width: 0; padding: 11px; border-radius: 9px; background: #f7f9fb; }
.detail-grid span, .detail-grid strong, .detail-grid small { display: block; }
.detail-grid span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.detail-grid strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; }
.detail-grid small { margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.detail-grid code { display: block; margin-top: 6px; overflow-wrap: anywhere; color: var(--navy-800); font-size: 12px; user-select: all; }
.detail-grid .detail-wide { grid-column: span 2; }
.party-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.party-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; }
.party-card > header { padding: 13px 14px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); background: white; }
.party-card > header > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--navy-100); color: var(--navy-800); font-size: 13px; font-weight: 900; }
.party-card > header small, .party-card > header h4 { display: block; }
.party-card > header small { color: var(--orange-dark); font-size: 8px; font-weight: 850; letter-spacing: .09em; }
.party-card > header h4 { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--navy-950); font-size: 13px; }
.party-data-grid { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.party-data-grid > div { min-width: 0; padding: 9px 10px; border-radius: 8px; background: white; }
.party-data-grid span, .party-data-grid strong, .party-data-grid small { display: block; }
.party-data-grid span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.party-data-grid strong { margin-top: 4px; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.party-data-grid small { margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; line-height: 1.45; }
.party-data-grid .party-wide { grid-column: span 2; }
.empty-party p { margin: 0; padding: 18px 14px; color: var(--muted); font-size: 11px; }
.fiscal-totals-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.fiscal-totals-grid > div { min-width: 0; padding: 11px; border: 1px solid #e8edf2; border-radius: 9px; }
.fiscal-totals-grid span, .fiscal-totals-grid strong { display: block; }
.fiscal-totals-grid span { min-height: 24px; color: var(--muted); font-size: 9px; font-weight: 750; }
.fiscal-totals-grid strong { margin-top: 4px; color: var(--navy-900); font-size: 13px; }
.fiscal-totals-grid .featured { border-color: rgba(239, 118, 17, .28); background: var(--orange-soft); }
.fiscal-totals-grid .featured strong { color: var(--orange-dark); }
.fiscal-items { display: grid; gap: 12px; }
.fiscal-item-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: white; }
.fiscal-item-card > header { padding: 13px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: #f8fafc; }
.fiscal-item-card > header span { display: block; color: var(--orange-dark); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.fiscal-item-card > header h4 { margin: 5px 0 0; font-size: 13px; }
.fiscal-item-card > header strong { color: var(--navy-900); font-size: 14px; white-space: nowrap; }
.fiscal-item-card .item-xml-description { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; }
.item-attributes { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); }
.item-attributes span { padding: 5px 8px; border-radius: 7px; background: var(--navy-100); color: var(--muted); font-size: 9px; }
.item-attributes b { margin-left: 4px; color: var(--navy-800); }
.tax-table { border-top: 1px solid var(--line); }
.tax-table th { border-top: 0; }
.tax-table td, .tax-table th { padding-top: 9px; padding-bottom: 9px; }

.modal { width: min(860px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 30px 90px rgba(8, 20, 38, .35); }.modal::backdrop { background: rgba(9, 21, 38, .65); backdrop-filter: blur(3px); }.small-modal { width: min(480px, calc(100vw - 30px)); }.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 30px); }.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }.modal-header h2 { margin: 3px 0 0; font-size: 21px; }.modal-content { padding: 21px 22px; overflow-y: auto; }.modal-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #fbfcfd; }fieldset { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }legend { padding: 0 7px; color: var(--navy-800); font-size: 12px; font-weight: 800; }.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.form-grid .wide { grid-column: span 2; }.database-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 15px; }.database-grid + fieldset { margin-top: 15px; }.compact-fields { gap: 11px; }.compact-fields input { min-height: 42px; }.edit-password-help { color: var(--muted); font-weight: 400; font-size: 10px; }.switch-line { display: flex !important; align-items: center; align-self: end; min-height: 46px; flex-direction: row; }.switch-line input { display: none; }.switch-line span { width: 38px; height: 22px; border-radius: 99px; background: #b8c2cd; padding: 3px; transition: .16s; }.switch-line span::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .16s; }.switch-line input:checked + span { background: var(--green); }.switch-line input:checked + span::after { transform: translateX(16px); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(390px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 11px; background: var(--navy-950); color: white; box-shadow: var(--shadow); font-size: 13px; font-weight: 650; transform: translateY(25px); opacity: 0; pointer-events: none; transition: .2s; }.toast.show { transform: translateY(0); opacity: 1; }.toast.error { background: var(--red); }
.loading-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(244, 247, 250, .74); backdrop-filter: blur(2px); color: var(--navy-900); }.spinner { width: 36px; height: 36px; border: 4px solid #dbe3ec; border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }
.sidebar-backdrop { display: none; }

.table-action.approve { color: var(--green); border-color: rgba(31, 157, 99, .35); background: var(--green-soft); }

@media (max-width: 1150px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .fiscal-totals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .mobile-only { display: grid; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-104%); width: min(290px, 86vw); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(8, 20, 38, .28); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-brand .icon-button { margin-left: auto; color: white; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(8, 20, 38, .5); opacity: 0; visibility: hidden; transition: .2s; }
  .sidebar-backdrop.open { opacity: 1; visibility: visible; }
  .topbar { padding: 13px 18px; min-height: 72px; }.topbar > .icon-button { flex: 0 0 auto; }.topbar .eyebrow { display: none; }
  .server-grid, .account-grid, .fiscal-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .party-cards { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; place-items: center; padding: max(20px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom)); }
  .login-brand { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; padding: 0; }.login-brand span { display: none; }.login-brand strong { font-size: 18px; }.login-brand .brand-mark { width: 44px; height: 44px; font-size: 24px; border-radius: 12px 12px 12px 4px; }
  .login-card { margin-top: 48px; }
}

@media (max-width: 580px) {
  .content { padding: 18px 13px calc(24px + env(safe-area-inset-bottom)); }
  .topbar-actions { gap: 7px; }.topbar-actions .button span, .user-chip div { display: none; }.user-chip { padding-left: 7px; }.topbar h1 { font-size: 19px; }
  .section-toolbar { flex-direction: column; align-items: stretch; }.section-toolbar > .button { width: 100%; }.period-select { justify-content: space-between; }.period-select select { flex: 1; max-width: 180px; }
  .metric-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }.metric-card { padding: 16px; }.metric-card strong { font-size: 25px; }
  .panel { padding: 16px; border-radius: 13px; }.table-panel { padding: 0; }.table-panel > .panel-heading { padding: 16px 16px 0; }.panel-heading { flex-wrap: wrap; }.bar-chart { height: 190px; }
  .server-components { grid-template-columns: 1fr; }.server-component + .server-component { border-left: 0; border-top: 1px solid var(--line); }
  .legend { width: 100%; justify-content: space-between; }
  .modal, .modal.fiscal-document-modal { width: 100vw; max-height: 100dvh; border-radius: 0; }.modal form { max-height: 100dvh; min-height: 100dvh; }.modal-content { padding: 17px 14px; }.modal-header, .modal-footer { padding-left: 15px; padding-right: 15px; }.modal-footer .button { flex: 1; }
  .form-grid, .database-grid { grid-template-columns: 1fr; }.form-grid .wide { grid-column: auto; }
  .inline-form { align-items: stretch; }.inline-form label, .inline-form .button { width: 100%; }
  .filter-grid { grid-template-columns: 1fr; }.filter-search { grid-column: auto; }.filter-actions { justify-content: stretch; }.filter-actions .button { flex: 1; }
  .table-panel > .fiscal-table-heading { padding: 14px 15px; }.fiscal-table-heading { align-items: flex-start; }.fiscal-table-heading p { margin-top: 3px; }
  .table-pagination { align-items: flex-start; flex-direction: column; }.pagination-controls { width: 100%; justify-content: space-between; }.page-numbers { overflow-x: auto; }
  .fiscal-detail-heading { margin: -17px -14px 15px; padding: 14px; align-items: flex-start; }.fiscal-detail-heading > div { align-items: flex-start; flex-direction: column; }.fiscal-detail-heading > strong { font-size: 18px; }
  .detail-grid, .fiscal-totals-grid { grid-template-columns: 1fr 1fr; }.detail-grid .detail-wide { grid-column: span 2; }
  .party-data-grid { grid-template-columns: 1fr; }.party-data-grid .party-wide { grid-column: auto; }
  .fiscal-document-modal .modal-footer { flex-wrap: wrap; }.fiscal-document-modal .modal-footer .button { min-width: 0; }
  .login-card { width: calc(100% - 26px); padding: 26px 20px; border-radius: 17px; }.login-heading { margin-bottom: 23px; }.login-heading h1 { font-size: 32px; }
  .toast { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
