:root {
  --navy: #13263d;
  --blue: #1675e0;
  --blue-dark: #0d5fbe;
  --bg: #f4f7fa;
  --text: #162235;
  --muted: #68778b;
  --border: #dfe6ee;
  --white: #fff;
  --green: #14865f;
  --red: #c43e4f;
  --amber: #a96700;
  --shadow: 0 8px 28px rgba(18, 38, 61, .07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, sans-serif; font-size: 14px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .brand { font-family: Manrope, sans-serif; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--navy); color: white; padding: 24px 18px 16px; display: flex; flex-direction: column; z-index: 2; }
.brand { color: inherit; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; }
.brand-logo { display: block; width: auto; height: 44px; }
.sidebar .brand { justify-content: center; padding: 4px 6px; }
.sidebar .brand-logo { height: 40px; }
.sidebar nav { margin-top: 28px; display: grid; gap: 3px; overflow-y: auto; scrollbar-width: thin; }
.company-workspace { margin: 8px 2px 0; padding: 6px; border: 1px solid #38516c; border-radius: 11px; background: #172e47; }
.company-workspace.empty-workspace { border-style: dashed; }
.company-context { display: flex; align-items: center; gap: 9px; margin: 0 0 5px; padding: 10px 8px 12px; color: white; border: 0; border-bottom: 1px solid #38516c; border-radius: 7px 7px 0 0; background: transparent; min-width: 0; }
.company-context:hover { background: #203a57; }
.company-context > span:nth-child(2) { flex: 1; min-width: 0; }
.company-context small, .company-context strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-context small { color: #91a8be; font-size: 9px; margin-top: 3px; }
.company-context strong { font-size: 11px; }
.company-context b { color: #91a8be; }
.company-context-icon { width: 27px; height: 27px; flex: none; display: grid; place-items: center; border-radius: 6px; color: #9ecbff; background: #294968; }
.scope-divider { height: 1px; margin: 14px 8px 4px; background: #2e455f; }
.workspace-module-label { padding: 11px 9px 4px; color: #7890a8; font-size: 8px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.company-workspace > a:not(.company-context) { padding: 9px 8px; }
.context-hint { margin: 4px; padding: 8px; color: #91a2b5; font-size: 9px; line-height: 1.5; }
.sidebar nav a { color: #b9c7d7; padding: 11px 13px; border-radius: 8px; font-weight: 500; display: flex; gap: 12px; align-items: center; }
.sidebar nav a span { font-size: 18px; width: 19px; text-align: center; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: #203a57; }
.nav-label { color: #7389a1; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; padding: 17px 13px 5px; }
.sidebar-user { margin-top: auto; border-top: 1px solid #2e455f; padding: 20px 5px 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user > div:nth-child(2) { overflow: hidden; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: #91a2b5; font-size: 10px; margin-top: 3px; }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #26517d; font-weight: 700; }
.logout { color: #9aacbf; background: none; border: 0; font-size: 20px; cursor: pointer; }
.app-main { margin-left: 248px; padding: 48px clamp(24px, 5vw, 68px); min-height: 100vh; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.page-header.compact { align-items: start; }
.page-header h1 { font-size: 30px; margin: 5px 0 7px; letter-spacing: -.8px; }
.page-header p, .card-header p { color: var(--muted); margin: 0; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.eyebrow { color: var(--blue); font-size: 10px; letter-spacing: 1.5px; font-weight: 700; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 8px; padding: 10px 17px; font-weight: 600; cursor: pointer; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 5px 12px rgba(22, 117, 224, .17); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: var(--blue); background: #eaf3fd; border-color: #cfe2f6; white-space: nowrap; }
.button-secondary:hover { background: #dcecfb; }
.button:disabled { cursor: wait; opacity: .65; }
.button-ghost { color: var(--text); background: white; border-color: var(--border); }
.button-large { padding: 14px 23px; }
.button-block { width: 100%; margin-top: 10px; padding: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 25px; }
.stat-card, .card { background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.stat-card { padding: 22px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; }
.stat-card span { color: var(--muted); font-weight: 500; }
.stat-card strong { grid-column: 1 / 3; font: 800 25px Manrope, sans-serif; margin: 11px 0; }
.stat-card strong.responsible-name { font-size: 18px; }
.stat-card a { grid-column: 1 / 3; font-size: 12px; font-weight: 600; }
.stat-icon { width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; }
.stat-icon.blue { color: var(--blue); background: #eaf3fd; }
.stat-icon.green { color: var(--green); background: #e8f7f1; }
.stat-icon.amber { color: var(--amber); background: #fff4df; }
.card { overflow: hidden; }
.payroll-section { margin-bottom: 24px; }
.setup-status { margin-bottom: 24px; border-left: 4px solid var(--amber); }
.setup-status-completed { border-left-color: var(--green); }
.setup-status-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.setup-status-header h2 { margin: 5px 0; }
.setup-progress { min-width: 125px; padding: 12px 16px; border-radius: 9px; text-align: center; background: #f5f8fb; }
.setup-progress strong, .setup-progress small { display: block; }
.setup-progress strong { font: 800 22px Manrope, sans-serif; }
.setup-progress small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.locked-action, .unlocked-action { display: flex; align-items: center; gap: 14px; padding: 18px 24px; background: #fff8e9; }
.unlocked-action { background: #e9f7f1; }
.locked-action > span, .unlocked-action > span { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: white; }
.locked-action > div, .unlocked-action > div { flex: 1; }
.locked-action p, .unlocked-action p { margin: 3px 0 0; color: var(--muted); }
.setup-checklist { display: grid; }
.setup-check { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.setup-check:last-child { border-bottom: 0; }
.setup-check > div { flex: 1; }
.setup-check p { margin: 3px 0 0; color: var(--muted); }
.setup-check-icon { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 50%; font-weight: 800; }
.setup-check.complete .setup-check-icon { color: var(--green); background: #e8f7f1; }
.setup-check.pending .setup-check-icon { color: var(--amber); background: #fff4df; }
.card-footer-action { padding: 18px 24px; border-top: 1px solid var(--border); text-align: right; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-card { display: flex; align-items: center; gap: 16px; padding: 22px; color: inherit; }
.settings-card:hover { border-color: #bdd7f3; transform: translateY(-1px); }
.settings-card > div { flex: 1; }
.settings-card h2 { margin-bottom: 5px; font-size: 16px; }
.settings-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.settings-card b { color: var(--blue); font-size: 20px; }
.settings-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; color: var(--blue); background: #eaf3fd; font-size: 20px; }
.locked-section { background: #fafbfc; }
.rubric-catalog { overflow: visible; }
.catalog-toolbar { display: flex; align-items: end; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.catalog-toolbar .field { flex: 1; margin: 0; }
.catalog-error { display: block; padding: 12px 24px 0; }
.rubric-options { max-height: 620px; overflow-y: auto; }
.rubric-option { display: flex; align-items: flex-start; gap: 13px; padding: 16px 24px; border-bottom: 1px solid var(--border); cursor: pointer; }
.rubric-option:hover { background: #f8fbfe; }
.rubric-option[hidden] { display: none; }
.rubric-option > input { position: absolute; opacity: 0; pointer-events: none; }
.rubric-check { width: 21px; height: 21px; flex: none; margin-top: 1px; border: 2px solid #b8c6d5; border-radius: 5px; background: white; }
.rubric-option > input:checked + .rubric-check { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px white; }
.rubric-main { flex: 1; min-width: 0; }
.rubric-main strong, .rubric-main small { display: block; }
.rubric-main small { margin-top: 4px; color: var(--blue); }
.rubric-main p { margin: 7px 0 0; color: var(--muted); line-height: 1.45; }
.rubric-option.already-added { cursor: default; background: #f7faf8; }
.rubric-option.already-added .rubric-check { border-color: var(--green); background: var(--green); }
.card-header { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 16px; margin-bottom: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: #7d8a9b; background: #f9fafc; font-size: 10px; letter-spacing: .6px; text-align: left; text-transform: uppercase; }
th, td { padding: 14px 20px; border-bottom: 1px solid #edf0f4; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td { color: #435166; }
td strong, td small { display: block; color: var(--text); }
td small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.text-right { text-align: right; }
.badge, .type { display: inline-flex; border-radius: 20px; padding: 5px 9px; font-size: 10px; font-weight: 700; }
.badge-authorized { color: #0d7450; background: #e5f6ef; }
.badge-pending { color: #976000; background: #fff1d2; }
.badge-cancelled { color: #ac3745; background: #fdebed; }
.type-issued { color: var(--green); background: #e8f7f1; }
.type-received { color: var(--blue); background: #eaf3fd; }
.actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.actions form { margin: 0; }
.transmission-history { margin-top: 8px; max-width: 360px; }
.transmission-history summary { color: var(--blue); cursor: pointer; font-weight: 700; }
.transmission-record { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.transmission-record:last-child { border-bottom: 0; }
.transmission-record div { display: flex; flex-wrap: wrap; gap: 12px; }
.transmission-record a { color: var(--blue); font-weight: 700; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: white; color: #66768a; cursor: pointer; }
.icon-button.danger { color: var(--red); font-size: 18px; }
.empty { text-align: center; padding: 65px 25px; }
.empty-icon { margin: auto auto 15px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: #eaf3fd; font-size: 22px; }
.empty h3 { margin-bottom: 7px; }
.empty p { color: var(--muted); margin-bottom: 22px; }
.form-card { max-width: 900px; padding: 30px; overflow: visible; }
.section-title { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 15px; margin: 10px 0 22px; }
.section-title:not(:first-of-type) { margin-top: 37px; }
.section-title > span { color: var(--blue); background: #eaf3fd; width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.section-title h2 { font-size: 15px; margin-bottom: 2px; }
.section-title p { color: var(--muted); font-size: 11px; margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px 24px; }
.span-2 { grid-column: 1 / 3; }
.field label, .filters label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 7px; color: #3c4a5c; }
.input { width: 100%; border: 1px solid #d8e0e9; border-radius: 7px; background: white; color: var(--text); padding: 10px 11px; outline: none; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 117, 224, .1); }
.input.invalid { border-color: var(--red); }
.field-help, .field-error { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); }
.field-error { color: var(--red); }
.input-action { display: flex; gap: 8px; }
.input-action .input { min-width: 0; }
.lookup-status { display: block; min-height: 14px; margin-top: 5px; font-size: 10px; font-weight: 600; }
.lookup-status.success { color: var(--green); }
.lookup-status.error { color: var(--red); }
.check { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-check { border: 1px solid var(--border); border-radius: 8px; padding: 13px; margin-top: 24px; }
.status-check input { width: 17px; height: 17px; }
.status-check strong, .status-check small { display: block; color: var(--text); }
.status-check small { color: var(--muted); margin-top: 2px; }
.form-actions { border-top: 1px solid var(--border); margin-top: 30px; padding-top: 20px; display: flex; justify-content: end; gap: 10px; }
.back { color: var(--muted); font-size: 11px; font-weight: 600; }
.filters { padding: 18px 20px; display: flex; align-items: end; gap: 14px; border-bottom: 1px solid var(--border); }
.filters label { margin: 0; min-width: 240px; }
.filters .input { display: block; margin-top: 7px; }
.filters > a { margin-bottom: 10px; font-size: 11px; font-weight: 600; }
.upload-box { padding: 28px; border: 2px dashed #cfdbe7; border-radius: 10px; background: #f9fbfd; }
.upload-box label { display: block; margin-bottom: 10px; font-weight: 700; }
.upload-box small { display: block; margin-top: 8px; color: var(--muted); }
.notice { margin-top: 20px; padding: 15px 17px; border-left: 4px solid var(--blue); border-radius: 6px; background: #eef6fe; }
.notice strong { display: block; margin-bottom: 4px; }
.notice p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.movement-income { color: var(--green); }
.movement-expense { color: var(--red); }
.settings-section + .settings-section { margin-top: 24px; }
.settings-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.compact-empty { padding: 30px; }
.operation-context { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 18px; margin-bottom: 28px; border: 1px solid #d7e6f5; border-radius: 9px; background: #f3f8fd; }
.operation-context small, .operation-context strong { display: block; }
.operation-context small { margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.operation-context strong { font-size: 12px; }
.selection-page { max-width: 1050px; margin: 4vh auto; }
.selection-header { text-align: center; margin-bottom: 35px; }
.selection-header h1 { margin: 8px 0; font-size: 32px; }
.selection-header p { color: var(--muted); }
.company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.company-choice { border: 1px solid var(--border); border-radius: 11px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.company-choice.selected { border-color: var(--blue); }
.company-choice button { width: 100%; border: 0; background: transparent; padding: 20px; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; }
.company-choice button:hover { background: #f8fbfe; }
.company-choice-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: #eaf3fd; font-weight: 800; }
.company-choice-data { min-width: 0; flex: 1; }
.company-choice-data strong, .company-choice-data small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-choice-data strong { margin-bottom: 5px; }
.company-choice-data small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.company-choice-action { color: var(--blue); font-size: 11px; font-weight: 700; }
.selection-footer { margin-top: 24px; text-align: center; }
.flash-stack { position: fixed; z-index: 10; right: 25px; top: 20px; display: grid; gap: 8px; }
.alert { background: white; border-left: 4px solid var(--blue); border-radius: 7px; padding: 13px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.14); }
.alert-success { border-color: var(--green); }
.alert-danger { border-color: var(--red); }
.alert-warning { border-color: var(--amber); }
.public-main { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(500px, 55%) 1fr; background: white; }
.auth-panel { padding: 32px 7vw; }
.auth-panel .brand { color: var(--navy); max-width: 520px; margin-inline: auto; }
.auth-panel .brand-logo { height: clamp(56px, 6vw, 76px); }
.auth-box { max-width: 520px; margin: 9vh auto 0; }
.auth-box h1 { font-size: 33px; margin: 10px 0 7px; }
.auth-box > p { color: var(--muted); margin-bottom: 30px; }
.auth-box .field { margin-bottom: 16px; }
.auth-switch { text-align: center; font-size: 12px; margin-top: 20px; }
.auth-visual { background: linear-gradient(150deg, #183653, #0d5f9e); color: white; display: flex; flex-direction: column; justify-content: end; padding: 8vw 5vw; position: relative; overflow: hidden; }
.auth-visual::before { content: ""; position: absolute; width: 370px; height: 370px; border: 80px solid rgba(255,255,255,.04); border-radius: 50%; top: 8%; right: -25%; }
.auth-visual blockquote { font: 700 28px/1.4 Manrope; margin: 0 0 15px; max-width: 440px; z-index: 1; }
.auth-visual p { color: #b9d0e4; max-width: 400px; line-height: 1.6; z-index: 1; }
.auth-visual-logo { width: 150px; height: auto; margin-bottom: 28px; z-index: 1; }
@media (max-width: 900px) {
  .sidebar { width: 76px; padding-inline: 12px; }
  .sidebar nav a:not(.active) { font-size: 0; }
  .sidebar .brand { padding: 4px 0; }
  .sidebar .brand-logo { width: 100%; height: auto; }
  .company-context { padding: 8px; justify-content: center; }
  .company-context > span:nth-child(2), .company-context b { display: none; }
  .context-hint, .workspace-module-label { display: none; }
  .sidebar nav a { justify-content: center; }
  .sidebar nav a span { font-size: 18px; }
  .nav-label, .sidebar-user > div:nth-child(2), .sidebar-user form { display: none; }
  .sidebar-user { justify-content: center; }
  .app-main { margin-left: 76px; }
  .stats-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}

.environment-banner {
  background: #9a3412;
  color: #fff7ed;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.7rem 1rem;
  position: sticky;
  text-align: center;
  text-transform: uppercase;
  top: 0;
  z-index: 50;
}
@media (max-width: 600px) {
  .sidebar { inset: auto 0 0; width: auto; height: 64px; padding: 8px; flex-direction: row; }
  .sidebar > .brand, .sidebar-user, .nav-label { display: none; }
  .sidebar nav { margin: 0; width: 100%; display: flex; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; }
  .sidebar nav a { display: flex; padding: 10px; }
  .sidebar nav a span { font-size: 21px; }
  .app-main { margin: 0; padding: 28px 16px 90px; }
  .page-header { align-items: start; flex-direction: column; gap: 15px; }
  .header-actions { justify-content: start; }
  .form-grid { grid-template-columns: 1fr; }.span-2 { grid-column: 1; }
  .input-action { align-items: stretch; flex-direction: column; }
  .company-grid, .operation-context { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
  .auth-panel { padding: 24px; }
  .auth-box { margin-top: 60px; }
  .setup-status-header, .setup-check, .locked-action, .unlocked-action { align-items: flex-start; flex-direction: column; }
  .setup-progress { width: 100%; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
}
