:root {
  --app-bg: #f3f6f8;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafb;
  --app-ink: #17212b;
  --app-muted: #667485;
  --app-border: #dfe6ee;
  --app-primary: #2454a6;
  --app-primary-strong: #183d7c;
  --app-accent: #0f766e;
  --app-warning: #a16207;
  --app-danger: #b42318;
  --app-shadow: 0 14px 36px rgba(31, 42, 55, 0.08);
  --app-radius: 8px;
  --sidebar-width: 212px;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(36, 84, 166, 0.08), transparent 30rem),
    linear-gradient(180deg, #f8fafc 0%, var(--app-bg) 42%, #eef3f6 100%);
  color: var(--app-ink);
  font-size: 0.95rem;
  letter-spacing: 0;
}

a {
  color: var(--app-primary);
  text-decoration: none;
}

a:hover {
  color: var(--app-primary-strong);
}

.btn {
  border-radius: 7px;
  font-weight: 650;
}

.btn-fixed {
  width: 136px;
}

.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
  box-shadow: 0 8px 18px rgba(36, 84, 166, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--app-primary-strong);
  border-color: var(--app-primary-strong);
}

.btn-outline-primary {
  border-color: rgba(36, 84, 166, 0.34);
  color: var(--app-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-outline-secondary {
  border-color: var(--app-border);
  color: #465466;
}

.app-authenticated {
  background: #f5f7fa;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  background: #f9fbfd;
  border-right: 1px solid #dce4ed;
  bottom: 0;
  display: flex;
  flex-direction: column;
  left: 0;
  overflow-y: auto;
  padding: 1.15rem 0.8rem 0.9rem;
  position: fixed;
  top: 0;
  width: var(--sidebar-width);
  z-index: 1040;
}

.sidebar-brand,
.public-brand {
  align-items: center;
  color: var(--app-ink);
  display: inline-flex;
  gap: 0.65rem;
}

.sidebar-brand {
  margin: 0 0.35rem 1.7rem;
}

.sidebar-brand:hover,
.public-brand:hover {
  color: var(--app-ink);
}

.sidebar-brand-mark {
  align-items: center;
  background: #1e518d;
  border-radius: 7px;
  color: #fff;
  display: inline-flex;
  font-size: 1.05rem;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.sidebar-brand-wordmark strong,
.sidebar-brand-wordmark small {
  display: block;
  line-height: 1.1;
}

.sidebar-brand-wordmark strong {
  font-size: 0.96rem;
}

.sidebar-brand-wordmark small {
  color: var(--app-muted);
  font-size: 0.69rem;
  margin-top: 0.2rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.16rem;
}

.sidebar-link {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #405066;
  display: flex;
  font-size: 0.87rem;
  font-weight: 630;
  gap: 0.72rem;
  min-height: 40px;
  padding: 0.55rem 0.68rem;
  text-align: left;
  width: 100%;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: #edf2f8;
  color: #19467f;
}

.sidebar-link.active {
  background: #e7effa;
  color: #174b89;
  font-weight: 750;
}

.sidebar-button {
  cursor: pointer;
}

.nav-icon {
  flex: 0 0 18px;
  height: 18px;
  width: 18px;
}

.sidebar-bottom {
  border-top: 1px solid #e1e7ee;
  margin-top: auto;
  padding-top: 0.7rem;
}

.sidebar-user-meta {
  border-top: 1px solid #e1e7ee;
  margin: 0.5rem 0.4rem 0;
  padding: 0.7rem 0.25rem 0.45rem;
}

.sidebar-user-meta strong,
.sidebar-user-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-meta strong {
  font-size: 0.78rem;
}

.sidebar-user-meta small {
  color: var(--app-muted);
  font-size: 0.69rem;
  margin-top: 0.16rem;
}

.sidebar-logout {
  margin: 0;
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-width: 0;
  padding: 1.65rem clamp(1.25rem, 3vw, 3rem) 2.5rem;
}

.public-brand {
  margin-bottom: 1.5rem;
}

.mobile-menu-button,
.sidebar-backdrop {
  display: none;
}

.public-main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 3.25rem 1.25rem;
}

.flash-stack {
  margin-bottom: 1rem;
}

.page-header {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 230, 238, 0.9);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1.15rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.stat-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  min-height: 116px;
  padding: 1.1rem;
}

.stat-label {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-value {
  color: var(--app-ink);
  font-size: 1.75rem;
  font-weight: 830;
  line-height: 1;
  margin-top: 0.65rem;
}

.archive-header .page-actions {
  align-items: center;
}

.month-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
}

.month-switches {
  align-self: start;
}

.month-header-actions {
  align-items: center;
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
}

.archive-switch {
  min-height: 38px;
  min-width: 160px;
}

.archive-switch-small {
  min-width: 104px;
}

.archive-card-grid,
.dashboard-card-grid,
.monthly-doc-grid {
  display: grid;
  gap: 1rem;
}

.archive-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 250px));
}

.dashboard-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-action-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthly-doc-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
  justify-content: start;
  row-gap: 1.5rem;
}

.studio-file-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 250px));
}

.archive-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--app-ink);
  display: grid;
  gap: 1rem;
  min-height: 172px;
  overflow: hidden;
  padding: 1rem;
  position: relative;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.archive-card::before {
  background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.archive-card:hover {
  border-color: rgba(36, 84, 166, 0.36);
  box-shadow: 0 18px 42px rgba(31, 42, 55, 0.12);
  color: var(--app-ink);
  transform: translateY(-2px);
}

.month-card-date {
  align-items: center;
  background: #eef7f6;
  border: 1px solid #cbe7e2;
  border-radius: var(--app-radius);
  color: #0f514d;
  display: inline-grid;
  height: 68px;
  justify-content: center;
  justify-self: start;
  line-height: 1;
  min-width: 72px;
  padding: 0.5rem 0.7rem;
  text-align: center;
}

.month-card-number {
  color: #0f514d;
  font-size: 1.48rem;
  font-weight: 880;
}

.month-card-year {
  color: #52746f;
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0;
  margin-top: 0.18rem;
  text-transform: uppercase;
}

.archive-card-icon {
  background: #eef4ff;
  border-color: #d8e6ff;
  color: var(--app-primary);
}

.archive-card-icon .month-card-number {
  color: var(--app-primary);
}

.archive-card-icon .month-card-year {
  color: #5f73a2;
}

.archive-card-body,
.archive-card-title,
.archive-card-meta,
.archive-card-footer,
.archive-card-action {
  display: block;
}

.archive-card-body {
  align-self: end;
}

.archive-card-title {
  color: var(--app-ink);
  font-size: 1.08rem;
  font-weight: 850;
}

.archive-card-meta {
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.archive-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.document-grid {
  display: grid;
  gap: 0.85rem;
}

.document-card {
  align-items: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: 0 10px 28px rgba(31, 42, 55, 0.06);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.9fr) auto;
  padding: 1rem;
}

.document-card-identity {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.document-kind-tag {
  align-items: center;
  border: 1px solid #d7e0ea;
  border-radius: 7px;
  color: #243244;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 850;
  justify-content: center;
  line-height: 1;
  min-height: 32px;
  min-width: 6.35rem;
  padding: 0.45rem 0.7rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.document-kind-tag-payslip,
.document-kind-tag-payslips_company,
.document-kind-tag-payslip_employee {
  background: #e9f7f1;
  border-color: #bfe6d3;
  color: #17633f;
}

.document-kind-tag-f24 {
  background: #eef4ff;
  border-color: #cdddf9;
  color: #244d91;
}

.document-kind-tag-accounting_note {
  background: #fff4db;
  border-color: #f0d28f;
  color: #75510c;
}

.document-period-text {
  color: var(--app-ink);
  font-size: 0.95rem;
  font-weight: 850;
  white-space: nowrap;
}

.document-card-type {
  color: var(--app-primary);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-card-title {
  color: var(--app-ink);
  font-size: 0.98rem;
  font-weight: 830;
  line-height: 1.25;
  margin: 0.2rem 0 0;
}

.document-card-meta,
.document-card-file {
  color: var(--app-muted);
  font-size: 0.82rem;
}

.document-card-file {
  min-width: 0;
}

.document-card-file span,
.document-card-file small {
  display: block;
}

.document-card-file span {
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-file small {
  color: var(--app-muted);
  margin-top: 0.15rem;
}

.document-card-actions {
  display: flex;
  gap: 0.5rem;
}

.archive-card-footer {
  align-items: center;
  border-top: 1px solid #edf1f5;
  color: var(--app-muted);
  display: flex;
  font-size: 0.78rem;
  gap: 0.5rem;
  justify-content: space-between;
  padding-top: 0.85rem;
}

.archive-card-footer strong {
  color: var(--app-ink);
}

.archive-card-action {
  background: #eef4ff;
  border: 1px solid #d8e6ff;
  border-radius: 7px;
  color: var(--app-primary);
  font-size: 0.8rem;
  font-weight: 850;
  padding: 0.38rem 0.6rem;
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.studio-month-card {
  padding-top: 3rem;
}

.studio-month-card .archive-card-link {
  inset: 0;
  position: absolute;
  z-index: 1;
}

.studio-month-card .month-card-date,
.studio-month-card .archive-card-body,
.studio-month-card .archive-card-footer,
.studio-month-card .archive-card-action {
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.studio-month-card .archive-card-action {
  right: 3.75rem;
}

.archive-card-delete {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 3;
}

.archive-card-delete-button {
  align-items: center;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 7px;
  color: #be123c;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.archive-card-delete-button:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

.presence-calendar-section {
  border-bottom: 1px solid var(--app-border);
  scroll-margin-top: 1rem;
  padding-bottom: 1.25rem;
}

.presence-year-list {
  display: grid;
  gap: 0.75rem;
}

.presence-month-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: 0 10px 28px rgba(31, 42, 55, 0.06);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.presence-month-main {
  align-items: center;
  display: flex;
  flex: 1 1 22rem;
  gap: 0.9rem;
  justify-content: space-between;
  min-width: min(100%, 18rem);
}

.presence-month-side {
  align-items: center;
  display: flex;
  flex: 1 1 20rem;
  gap: 0.75rem;
  justify-content: flex-end;
}

.presence-month-reason {
  color: var(--app-muted);
  font-size: 0.84rem;
  text-align: right;
}

.presence-toolbar {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.presence-view-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.presence-toolbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.presence-employee-picker {
  max-width: 22rem;
  min-width: min(100%, 16rem);
  position: relative;
  width: 22rem;
  z-index: 5;
}

.presence-employee-select-wrap {
  margin-bottom: 0.45rem;
}

.presence-employee-menu {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  left: 0;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
}

.presence-employee-option {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--app-ink);
  display: block;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  text-align: left;
  width: 100%;
}

.presence-employee-option:hover,
.presence-employee-option:focus,
.presence-employee-option.active {
  background: #eef4ff;
  outline: none;
}

.presence-calendar-wrap {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow-x: auto;
  width: 100%;
}

.presence-employee-extras {
  border-bottom: 1px solid #e5eaf0;
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.presence-extra-panel {
  border: 1px solid #e5eaf0;
  border-radius: 7px;
  padding: 0.75rem;
}

.presence-note-preview {
  max-width: 44rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-expense-summary {
  display: grid;
  gap: 0.35rem;
}

.presence-expense-summary-row {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(6rem, auto) minmax(10rem, 1fr) minmax(10rem, 1fr);
}

.presence-print-extras-summary {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 0.9rem;
}

.presence-print-extras-list {
  display: grid;
  gap: 0.85rem;
}

.presence-print-extras-employee {
  border-top: 1px solid #e5eaf0;
  padding-top: 0.75rem;
}

.presence-print-extras-employee:first-child {
  border-top: 0;
  padding-top: 0;
}

.presence-print-note {
  color: #334155;
}

.presence-print-expense-list {
  display: grid;
  gap: 0.25rem;
  list-style: none;
  padding-left: 0;
}

.presence-print-expense-list li {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: minmax(6rem, auto) minmax(8rem, 1fr) minmax(8rem, 1fr);
}

.presence-print-expense-total {
  font-weight: 800;
}

.presence-expense-rows {
  display: grid;
  gap: 0.65rem;
}

.presence-expense-row {
  align-items: end;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(7rem, 0.7fr) minmax(12rem, 1.4fr) minmax(10rem, 1fr) auto;
}

.presence-expense-delete {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  min-height: 31px;
}

@media (max-width: 900px) {
  .presence-expense-row,
  .presence-expense-summary-row {
    grid-template-columns: 1fr;
  }
}

.presence-calendar-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  min-width: 1120px;
  table-layout: fixed;
  width: max-content;
}

.presence-calendar-table th,
.presence-calendar-table td {
  border-bottom: 1px solid #e5eaf0;
  border-right: 1px solid #e5eaf0;
  height: 38px;
  padding: 0.25rem;
  text-align: center;
  vertical-align: middle;
  width: 3.25rem;
}

.presence-calendar-table thead th {
  background: #f8fafc;
  color: #334155;
  font-weight: 850;
}

.presence-calendar-label {
  background: #ffffff;
  color: var(--app-ink);
  left: 0;
  min-width: 10.5rem;
  position: sticky;
  text-align: left !important;
  width: 10.5rem !important;
  z-index: 2;
}

.presence-calendar-table thead .presence-calendar-label {
  background: #f1f5f9;
  z-index: 3;
}

.presence-calendar-day {
  font-size: 0.92rem;
}

.presence-calendar-weekday {
  font-size: 0.68rem;
  text-transform: uppercase;
}

.presence-calendar-holiday {
  background: #fff1f2 !important;
  color: #be123c !important;
}

.presence-calendar-theoretical-cell {
  background: #f1f5f9 !important;
  color: #475569 !important;
}

.presence-employee-highlight {
  outline: 2px solid rgba(36, 84, 166, 0.34);
  outline-offset: 3px;
}

.presence-calendar-input,
.presence-calendar-note {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--app-ink);
  font: inherit;
  height: 28px;
  padding: 0.2rem;
  text-align: center;
  width: 100%;
}

.presence-calendar-input:focus,
.presence-calendar-note:focus {
  background: #ffffff;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.14rem rgba(36, 84, 166, 0.12);
  outline: none;
}

.presence-calendar-input:disabled,
.presence-calendar-note:disabled {
  color: #64748b;
  opacity: 1;
}

.presence-calendar-input-readonly {
  color: #475569;
}

.presence-calendar-detail-row .presence-calendar-label {
  color: #7c2d12;
}

.presence-vertical-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  min-width: 340px;
  table-layout: fixed;
  width: max-content;
}

.presence-vertical-table th,
.presence-vertical-table td {
  border-bottom: 1px solid #e5eaf0;
  border-right: 1px solid #e5eaf0;
  height: 26px;
  padding: 0.06rem;
  text-align: center;
  vertical-align: middle;
  width: 2.35rem;
}

.presence-vertical-table thead th {
  background: #f8fafc;
  color: #334155;
  font-weight: 850;
}

.presence-vertical-table tfoot th,
.presence-vertical-table tfoot td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  color: var(--app-ink);
  font-weight: 850;
}

.presence-vertical-table tbody th {
  background: #ffffff;
  color: var(--app-ink);
  font-weight: 800;
  width: 2.25rem;
}

.presence-vertical-weekday {
  color: #64748b;
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.presence-vertical-table .presence-calendar-input {
  border-radius: 4px;
  height: 28px;
  padding: 0.05rem;
}

.presence-worked-input {
  background: #ffffff;
  border-color: #e5eaf0;
  font-weight: 850;
}

.presence-calendar-holiday .presence-calendar-input,
.presence-calendar-table td.presence-calendar-holiday .presence-calendar-input,
.presence-vertical-table tr.presence-calendar-holiday .presence-calendar-input {
  background: transparent;
  border-color: rgba(190, 18, 60, 0.2);
  color: #be123c;
}

.presence-calendar-table th.presence-calendar-holiday,
.presence-calendar-table td.presence-calendar-holiday,
.presence-vertical-table tr.presence-calendar-holiday > th,
.presence-vertical-table tr.presence-calendar-holiday > td,
.presence-vertical-table tr.presence-calendar-holiday .presence-calendar-theoretical-cell {
  background: #fff1f2 !important;
  color: #be123c !important;
}

.presence-vertical-value {
  display: inline-block;
  min-width: 100%;
  padding: 0.05rem;
}

.presence-worked-value {
  font-weight: 850;
}

.presence-worked-total {
  font-weight: 900 !important;
}

.presence-calendar-note {
  font-size: 0.72rem;
  min-width: 4.5rem;
}

.absence-reason-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.presence-action-label-mobile {
  display: none;
}

.dashboard-quick-card {
  min-height: 150px;
}

.company-action-card {
  min-height: 182px;
}

.company-action-card::before {
  background: #dfe6ee;
}

.company-action-card-current::before {
  background: linear-gradient(90deg, #465466, var(--app-primary));
}

.dashboard-presence-card::before {
  background: #0f766e;
}

.company-action-card-send::before {
  background: #d97706;
}

.dashboard-presence-card {
  background: #e6f7f2;
  border-color: #0f766e;
  color: #134e4a;
}

.dashboard-presence-card .archive-card-title,
.dashboard-presence-card .archive-card-meta {
  color: #134e4a;
}

.dashboard-presence-card .archive-card-icon {
  background: #d2f0e8;
  border-color: rgba(15, 118, 110, 0.36);
}

.dashboard-presence-card .month-card-number,
.dashboard-presence-card .month-card-year {
  color: #134e4a;
}

.dashboard-presence-card .archive-card-action {
  background: #d2f0e8;
  border-color: rgba(15, 118, 110, 0.42);
  color: #0f766e;
}

.company-action-card-send {
  background: #fff7e6;
  border-color: #d97706;
  color: #7c2d12;
}

.company-action-card-send .archive-card-title,
.company-action-card-send .archive-card-meta {
  color: #7c2d12;
}

.company-action-card-send .archive-card-icon {
  background: #ffedc2;
  border-color: rgba(217, 119, 6, 0.36);
}

.company-action-card-send .month-card-number,
.company-action-card-send .month-card-year {
  color: #7c2d12;
}

.company-action-card-send .archive-card-action {
  background: #ffedc2;
  border-color: rgba(217, 119, 6, 0.42);
  color: #7c2d12;
}

.company-archive-card {
  min-height: 182px;
}

.company-dashboard-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 230, 238, 0.9);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 1.15rem;
}

.company-dashboard-section-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.company-archive-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-archive-link {
  align-items: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-ink);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 92px;
  padding: 0.95rem 1rem;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.company-archive-link:hover {
  border-color: rgba(36, 84, 166, 0.34);
  box-shadow: 0 10px 24px rgba(31, 42, 55, 0.08);
  color: var(--app-ink);
}

.company-archive-title,
.company-archive-meta {
  display: block;
}

.company-archive-title {
  color: var(--app-ink);
  font-weight: 850;
}

.company-archive-meta {
  color: var(--app-muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 0.18rem;
}

.company-archive-action {
  color: var(--app-primary);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.finder-file-tile {
  border: 1px solid transparent;
  border-radius: var(--app-radius);
  color: var(--app-ink);
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  min-height: 210px;
  padding: 0.85rem;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.finder-file-tile:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--app-border);
}

.finder-file-tile.is-empty {
  opacity: 0.52;
}

.finder-file-preview {
  align-items: center;
  color: var(--app-ink);
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  text-decoration: none;
}

.finder-file-preview:hover {
  color: var(--app-primary);
}

.finder-file-icon {
  background: #f8fbff;
  border: 2px solid #d8e6ff;
  border-radius: 8px 14px 8px 8px;
  box-shadow: 0 18px 32px rgba(31, 42, 55, 0.14);
  display: grid;
  height: 112px;
  place-items: center;
  position: relative;
  width: 88px;
}

.finder-file-icon::before {
  background: #eaf2ff;
  border-bottom: 2px solid #d8e6ff;
  border-left: 2px solid #d8e6ff;
  border-radius: 0 10px 0 6px;
  content: "";
  height: 26px;
  position: absolute;
  right: -2px;
  top: -2px;
  width: 26px;
}

.finder-file-icon::after {
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 12px 0 currentColor, 0 24px 0 currentColor;
  content: "";
  height: 3px;
  left: 20px;
  opacity: 0.28;
  position: absolute;
  right: 20px;
  top: 58px;
}

.finder-file-code {
  color: var(--app-primary);
  font-size: 1.12rem;
  font-weight: 900;
  margin-top: -1.3rem;
  position: relative;
  z-index: 1;
}

.doc-card-f24 .finder-file-icon {
  background: #f5fbfa;
  border-color: #cbe7e2;
  color: #0f514d;
}

.doc-card-f24 .finder-file-icon::before {
  background: #e6f5f3;
  border-color: #cbe7e2;
}

.doc-card-f24 .finder-file-code {
  color: #0f514d;
}

.doc-card-accounting_note .finder-file-icon {
  background: #fffaf0;
  border-color: #f4d88b;
  color: #7a4d00;
}

.doc-card-accounting_note .finder-file-icon::before {
  background: #fff3ce;
  border-color: #f4d88b;
}

.doc-card-accounting_note .finder-file-code {
  color: #7a4d00;
}

.finder-file-name,
.finder-file-meta,
.finder-file-note {
  display: block;
}

.finder-file-name {
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.15;
}

.finder-file-meta,
.finder-file-note {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.finder-file-note {
  max-width: 12rem;
}

.studio-file-tile {
  align-content: start;
  min-height: 360px;
}

.studio-file-tile .finder-file-meta,
.studio-file-tile .finder-file-note {
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finder-file-details {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  min-height: 78px;
}

.finder-file-status {
  min-height: 24px;
}

.studio-file-actions {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 1fr;
  justify-items: stretch;
  width: 100%;
}

.studio-file-actions form,
.studio-file-actions .btn {
  width: 100%;
}

.monthly-doc-actions {
  align-items: center;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 1fr;
  justify-items: center;
  width: 100%;
}

.monthly-doc-actions .btn {
  min-height: 36px;
}

.monthly-doc-actions form {
  display: grid;
  justify-items: center;
  width: 100%;
}

.archive-section {
  border-top: 1px solid var(--app-border);
  padding-top: 1rem;
}

.archive-subsection + .archive-subsection {
  margin-top: 1rem;
}

.alert {
  border: 0;
  border-radius: var(--app-radius);
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.08);
}

h1,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  color: var(--app-ink);
  font-weight: 780;
  letter-spacing: 0;
}

.text-muted {
  color: var(--app-muted) !important;
}

.border,
.rounded-2 {
  border-color: var(--app-border) !important;
  border-radius: var(--app-radius) !important;
}

form.border,
.border.rounded-2.p-3,
.border.rounded-2.p-4,
.border.rounded-2.p-3.h-100 {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(31, 42, 55, 0.06);
}

.row.g-3.mb-4 > [class*="col-"] > .border {
  background: var(--app-surface);
  border: 1px solid var(--app-border) !important;
  box-shadow: var(--app-shadow);
}

.form-label {
  color: #405066;
  font-size: 0.82rem;
  font-weight: 760;
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  border-color: var(--app-border);
  border-radius: 7px;
  min-height: 42px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(36, 84, 166, 0.58);
  box-shadow: 0 0 0 0.2rem rgba(36, 84, 166, 0.12);
}

.form-check-input {
  border-color: #a7b4c2;
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.table-responsive {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: auto;
}

.table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  border-bottom-color: #edf1f5;
  padding: 0.9rem 1rem;
  vertical-align: middle;
}

.table thead th {
  background: #f7f9fb;
  color: #536274;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table tbody tr:hover {
  background: #fbfdff;
}

.badge {
  border-radius: 999px;
  font-weight: 760;
  padding: 0.38rem 0.58rem;
}

.doc-cell-primary {
  display: grid;
  gap: 0.45rem;
  min-width: 220px;
}

.doc-badge-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.doc-period-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 850;
  justify-content: center;
  line-height: 1;
  min-height: 30px;
  padding: 0.42rem 0.68rem;
  white-space: nowrap;
}

.doc-period-badge {
  background: #17212b;
  border-color: #17212b;
  box-shadow: 0 8px 16px rgba(23, 33, 43, 0.12);
  color: #fff;
  min-width: 4.8rem;
}

.doc-period-badge.muted {
  background: #e8eef5;
  border-color: #d2dde8;
  box-shadow: none;
  color: var(--app-muted);
}

.doc-type-item {
  align-items: center;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 72px;
}

.doc-type-payslip,
.doc-type-payslips_company,
.doc-type-payslip_employee {
  color: #17428c;
}

.doc-type-f24 {
  color: #0d5b42;
}

.doc-type-accounting_note {
  color: #7a4d00;
}

.doc-type-cu {
  color: #53389e;
}

.doc-type-contract {
  color: #9d174d;
}

.doc-type-form,
.doc-type-presence_sheet,
.doc-type-other {
  color: #405066;
}

.doc-type-icon {
  border-radius: 3px 5px 3px 3px;
  box-shadow: 0 8px 16px rgba(23, 33, 43, 0.2);
  display: inline-block;
  flex: 0 0 auto;
  height: 27px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  z-index: 2;
}

.doc-type-code {
  color: currentColor;
  font-size: 1.45rem;
  font-weight: 900;
  left: 50%;
  letter-spacing: 0.03em;
  opacity: 0.34;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 1;
}

.doc-type-f24 .doc-type-code {
  font-size: 1.55rem;
  letter-spacing: 0.05em;
}

.doc-type-icon::before,
.doc-type-icon::after {
  content: "";
  position: absolute;
}

.doc-type-icon::after {
  background: rgba(255, 255, 255, 0.48);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  height: 8px;
  right: 0;
  top: 0;
  width: 8px;
}

.doc-type-payslip .doc-type-icon,
.doc-type-payslips_company .doc-type-icon,
.doc-type-payslip_employee .doc-type-icon {
  background: #2454a6;
}

.doc-type-payslip .doc-type-icon::before,
.doc-type-payslips_company .doc-type-icon::before,
.doc-type-payslip_employee .doc-type-icon::before {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 6px 0 #ffffff, 0 12px 0 #ffffff;
  height: 2px;
  left: 5px;
  top: 7px;
  width: 11px;
}

.doc-type-f24 .doc-type-icon {
  background: #0f766e;
}

.doc-type-f24 .doc-type-icon::before {
  border-bottom: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  height: 11px;
  left: 5px;
  top: 8px;
  width: 11px;
}

.doc-type-accounting_note .doc-type-icon {
  background: #f59e0b;
}

.doc-type-accounting_note .doc-type-icon::before {
  border-bottom: 2px solid #ffffff;
  border-top: 2px solid #ffffff;
  height: 12px;
  left: 5px;
  top: 8px;
  width: 11px;
}

.doc-type-cu .doc-type-icon {
  background: #6d28d9;
}

.doc-type-contract .doc-type-icon {
  background: #be185d;
}

.doc-type-form .doc-type-icon,
.doc-type-presence_sheet .doc-type-icon,
.doc-type-other .doc-type-icon {
  background: #64748b;
}

.company-code-badge {
  align-items: center;
  background: #eef7f6;
  border: 1px solid #b7ded8;
  border-radius: 7px;
  color: #0f514d;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 850;
  min-height: 30px;
  padding: 0.36rem 0.62rem;
  white-space: nowrap;
}

.doc-subject,
.doc-file-meta {
  color: var(--app-muted);
  font-size: 0.82rem;
}

.doc-subject strong {
  color: var(--app-ink);
  font-weight: 760;
}

.doc-file-name {
  color: #334155;
  display: block;
  font-size: 0.84rem;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-bg-primary {
  background-color: #dceaff !important;
  color: #173b78 !important;
}

.text-bg-success {
  background-color: #dff4ed !important;
  color: #0d5b42 !important;
}

.text-bg-danger {
  background-color: #fee4e2 !important;
  color: var(--app-danger) !important;
}

.text-bg-warning,
.table-warning {
  background-color: #fff7df !important;
  color: #6c4600 !important;
}

.text-bg-secondary {
  background-color: #eef2f6 !important;
  color: #405066 !important;
}

code {
  background: #eef4ff;
  border-radius: 6px;
  color: #1f4b91;
  padding: 0.12rem 0.35rem;
}

.btn-group-sm > .btn,
.btn-sm {
  border-radius: 7px;
}

.login-shell {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 430px;
  margin: 0 auto;
  max-width: 1040px;
}

.login-panel,
.login-copy {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 230, 238, 0.9);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.login-copy {
  align-content: end;
  background:
    linear-gradient(135deg, rgba(24, 61, 124, 0.94), rgba(15, 118, 110, 0.9)),
    #183d7c;
  color: #fff;
  display: grid;
  min-height: 480px;
  padding: 2rem;
}

.login-copy h1,
.login-copy p {
  color: #fff;
}

.login-copy .sidebar-kicker {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-copy p {
  color: rgba(255, 255, 255, 0.78);
}

.login-panel {
  padding: 2rem;
}

.login-panel .form-control {
  min-height: 46px;
}

.empty-state {
  color: var(--app-muted);
  padding: 2.5rem 1rem;
  text-align: center;
}

/* Studio document Finder: four independently scrolling panes. */
.finder-page {
  min-width: 0;
}

.finder-page-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.finder-eyebrow {
  color: #697c91;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.finder-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.finder-company-chooser {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  max-width: 720px;
  padding: 1.25rem;
}

.finder-company-chooser-controls {
  display: flex;
  gap: 0.55rem;
}

.finder-company-chooser-controls .form-select {
  flex: 1;
  min-width: 0;
}

.finder-operations {
  position: relative;
  z-index: 4;
}

.finder-operations > summary,
.finder-month-actions > summary,
.finder-row-menu > summary {
  cursor: pointer;
  list-style: none;
}

.finder-operations > summary::-webkit-details-marker,
.finder-month-actions > summary::-webkit-details-marker,
.finder-row-menu > summary::-webkit-details-marker {
  display: none;
}

.finder-operations-list {
  background: #fff;
  border: 1px solid #d6e0eb;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(18, 37, 61, 0.16);
  display: grid;
  min-width: 225px;
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
}

.finder-operations-list a {
  border-radius: 5px;
  color: #33475d;
  font-size: 0.82rem;
  padding: 0.48rem 0.55rem;
}

.finder-operations-list a:hover,
.finder-operations-list a:focus-visible {
  background: #edf3fa;
}

.finder-workspace {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 9px;
  display: grid;
  grid-template-columns: minmax(105px, 0.62fr) minmax(145px, 0.86fr) minmax(210px, 1.05fr) minmax(260px, 1.38fr);
  height: calc(100vh - 184px);
  height: calc(100dvh - 184px);
  min-height: 510px;
  overflow-x: auto;
  transition: opacity 120ms ease;
}

.finder-workspace.is-loading {
  opacity: 0.62;
}

.finder-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.finder-pane + .finder-pane {
  border-left: 1px solid #e0e7ef;
}

.finder-pane-heading {
  align-items: center;
  background: #f7f9fc;
  border-bottom: 1px solid #e0e7ef;
  color: #465b73;
  display: flex;
  flex: none;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
}

.finder-pane-heading h2 {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 0;
  text-transform: uppercase;
}

.finder-pane-heading span {
  color: #8190a3;
  font-size: 0.71rem;
  font-weight: 700;
}

.finder-pane-body,
.finder-preview-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.finder-pane-body {
  padding: 0.38rem;
}

.finder-entry {
  align-items: center;
  border-radius: 6px;
  color: #34465c;
  display: flex;
  font-size: 0.83rem;
  gap: 0.35rem;
  justify-content: space-between;
  min-height: 37px;
  padding: 0.45rem 0.55rem;
}

.finder-entry:hover,
.finder-entry:focus-visible,
.finder-file-choice:hover,
.finder-file-choice:focus-visible {
  background: #edf3fa;
  color: #1a4f90;
}

.finder-entry.is-selected,
.finder-folder-row.is-selected .finder-folder-choice,
.finder-file-row.is-selected .finder-file-choice {
  background: #e3eefb;
  color: #154983;
  font-weight: 750;
}

.finder-entry-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finder-entry-count {
  color: #5b6e84;
  flex: none;
  font-size: 0.72rem;
  font-weight: 650;
}

.finder-list-separator {
  border-top: 1px solid #e5ebf2;
  color: #8694a5;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0.5rem 0.4rem 0.2rem;
  padding-top: 0.6rem;
  text-transform: uppercase;
}

.finder-folder-row,
.finder-file-row {
  position: relative;
}

.finder-folder-choice {
  padding-right: 2.25rem;
}

.finder-row-menu > summary {
  border-radius: 5px;
  color: #61758d;
  font-size: 1.2rem;
  font-weight: 750;
  height: 27px;
  line-height: 0.9;
  padding: 0.25rem;
  position: absolute;
  right: 0.38rem;
  text-align: center;
  top: 0.28rem;
  width: 27px;
}

.finder-row-menu > summary:hover,
.finder-row-menu > summary:focus-visible {
  background: #dce9f7;
  color: #154983;
}

.finder-row-actions {
  background: #f8fafc;
  border: 1px solid #e0e7ee;
  border-radius: 6px;
  display: grid;
  gap: 0.1rem;
  margin: 0.3rem 0.3rem 0.5rem;
  padding: 0.3rem;
}

.finder-row-actions a,
.finder-row-actions button {
  background: none;
  border: 0;
  border-radius: 4px;
  color: #254d7e;
  display: block;
  font-size: 0.76rem;
  font-weight: 650;
  padding: 0.35rem 0.42rem;
  text-align: left;
  width: 100%;
}

.finder-row-actions a:hover,
.finder-row-actions button:hover,
.finder-row-actions a:focus-visible,
.finder-row-actions button:focus-visible {
  background: #e8f0f9;
}

.finder-row-actions .finder-danger-action {
  color: #a12d2d;
}

.finder-row-actions form {
  margin: 0;
}

.finder-row-actions .finder-update-action {
  border-top: 1px solid #e1e7ee;
  display: grid;
  gap: 0.3rem;
  margin-top: 0.2rem;
  padding: 0.5rem 0.35rem 0.2rem;
}

.finder-row-actions label {
  color: #475b73;
  font-size: 0.72rem;
  font-weight: 700;
}

.finder-month-actions {
  border-bottom: 1px solid #e6ebf1;
  margin-bottom: 0.3rem;
  padding: 0.35rem 0.45rem;
}

.finder-month-actions > summary {
  color: #285486;
  font-size: 0.74rem;
  font-weight: 750;
}

.finder-month-actions-content {
  background: #f7f9fc;
  border-radius: 6px;
  margin-top: 0.4rem;
  padding: 0.65rem;
}

.finder-file-choice {
  align-items: flex-start;
  border-radius: 6px;
  color: #33475d;
  display: flex;
  gap: 0.55rem;
  min-height: 58px;
  padding: 0.62rem 2.15rem 0.62rem 0.55rem;
}

.finder-file-glyph {
  background: #e6eef8;
  border-radius: 4px;
  color: #285486;
  flex: none;
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
  padding: 0.25rem 0.18rem;
}

.finder-file-text {
  min-width: 0;
}

.finder-file-text strong,
.finder-file-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finder-file-text strong {
  font-size: 0.79rem;
  line-height: 1.3;
}

.finder-file-text small {
  color: #596d83;
  font-size: 0.68rem;
  margin-top: 0.12rem;
}

.finder-preview-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
}

.finder-preview-meta strong,
.finder-preview-meta span {
  display: block;
  overflow-wrap: anywhere;
}

.finder-preview-meta strong {
  font-size: 0.9rem;
}

.finder-preview-meta span {
  color: #596d83;
  font-size: 0.7rem;
  margin-top: 0.18rem;
}

.finder-preview-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.finder-pdf-frame {
  background: #fff;
  border: 1px solid #d6e0ea;
  border-radius: 5px;
  flex: 1 0 360px;
  min-height: 360px;
  width: 100%;
}

.finder-preview-placeholder,
.finder-preview-note,
.finder-empty {
  color: #5b6e84;
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
  padding: 0.75rem;
}

.finder-versions {
  border-top: 1px solid #e1e7ee;
  font-size: 0.75rem;
  padding-top: 0.55rem;
}

.finder-versions > summary {
  color: #285486;
  cursor: pointer;
  font-weight: 700;
}

.finder-versions ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

@media (max-width: 1199.98px) {
  .app-main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    box-shadow: 12px 0 30px rgba(20, 36, 56, 0.15);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    width: min(280px, 86vw);
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-open {
    overflow: hidden;
  }

  .app-main {
    margin-left: 0;
    padding: 1rem;
  }

  .mobile-menu-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 7px;
    color: var(--app-ink);
    display: inline-flex;
    font-size: 0.83rem;
    font-weight: 700;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.45rem 0.7rem;
  }

  .sidebar-backdrop:not([hidden]) {
    background: rgba(15, 30, 48, 0.42);
    border: 0;
    display: block;
    inset: 0;
    position: fixed;
    z-index: 1030;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-copy {
    min-height: 280px;
    order: -1;
  }

  .page-header {
    display: block;
  }

  .month-header {
    display: block;
  }

  .month-header-actions {
    margin-top: 0.75rem;
  }

  .page-actions {
    justify-content: flex-start;
    margin-top: 1rem;
  }

  .dashboard-card-grid,
  .company-action-grid,
  .company-archive-grid,
  .monthly-doc-grid {
    grid-template-columns: 1fr;
  }

  .company-dashboard-section-header {
    display: block;
  }

  .company-dashboard-section-header .btn {
    margin-top: 0.85rem;
  }

  .document-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .document-card-actions {
    flex-wrap: wrap;
  }

  .presence-month-row,
  .presence-month-main,
  .presence-month-side {
    align-items: stretch;
    flex-direction: column;
  }

  .presence-month-side {
    justify-content: flex-start;
  }

  .presence-month-reason {
    text-align: left;
  }

  .archive-switch {
    flex: 1 1 150px;
  }
}

@media (max-width: 575.98px) {
  .public-main {
    padding: 1.5rem 1rem;
  }

  .login-panel,
  .login-copy {
    padding: 1.25rem;
  }

  .table > :not(caption) > * > * {
    padding: 0.75rem;
  }

  .archive-card-grid {
    grid-template-columns: 1fr;
  }

  .archive-filter-bar .btn-fixed,
  .document-card-actions .btn-fixed {
    width: 100%;
  }

  .archive-header .page-actions .btn,
  .archive-header .page-actions .form-select {
    width: 100%;
  }

  .month-header-actions {
    display: grid;
    gap: 0.5rem;
  }

  .presence-action-label-desktop {
    display: none;
  }

  .presence-action-label-mobile {
    display: inline;
  }

  .presence-year-list {
    gap: 0.5rem;
  }

  .presence-month-row {
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
  }

  .presence-month-main,
  .presence-month-side {
    flex: 0 1 auto;
    gap: 0.35rem;
    min-width: 0;
  }

  .presence-month-main h2 {
    margin-bottom: 0.1rem !important;
  }

  .presence-month-main .badge,
  .presence-month-side .btn {
    align-self: flex-start;
  }

  .presence-month-reason {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .presence-month-side .btn {
    padding: 0.25rem 0.55rem;
  }
}

/* The approved studio sidebar is shared by every studio page. */
.studio-shell {
  --sidebar-width: 194px;
}

.studio-shell .app-sidebar {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f5f7;
  border-color: #dfe4e9;
  padding: 17px 10px;
}

/* The document Finder keeps its own content layout. */
.finder-shell {
  background: #fff;
  color: #24313c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.studio-shell .sidebar-brand {
  align-items: flex-start;
  color: #155f75;
  gap: 5px;
  margin: 7px 12px 23px;
}

.studio-shell .sidebar-brand-mark {
  background: transparent;
  border-radius: 0;
  color: inherit;
  font-size: 22px;
  height: 24px;
  line-height: 1;
  width: 21px;
}

.studio-shell .sidebar-brand-wordmark strong {
  font-size: 21px;
  font-weight: 750;
  line-height: 1.05;
}

.studio-shell .sidebar-brand-wordmark small {
  color: #71808a;
  font-size: 11px;
  font-weight: 400;
  margin-top: 3px;
}

.studio-shell .sidebar-nav {
  display: block;
}

.studio-shell .sidebar-link {
  border-radius: 8px;
  color: #24313c;
  font-size: 15px;
  font-weight: 400;
  gap: 9px;
  margin: 2px 0;
  min-height: 0;
  padding: 11px 12px;
}

.studio-shell .sidebar-link:hover,
.studio-shell .sidebar-link:focus-visible {
  background: #e8eef3;
  color: #164e73;
}

.studio-shell .sidebar-link.active {
  background: #dbeaf4;
  color: #164e73;
  font-weight: 500;
}

.studio-shell .nav-icon {
  height: 15px;
  width: 15px;
}

.studio-shell .sidebar-bottom {
  border-color: #dfe4e9;
  padding-top: 12px;
}

.finder-shell .app-main {
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 22px 24px 22px;
}

.finder-shell .flash-stack {
  flex: none;
}

.finder-shell .finder-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.finder-shell .finder-page-header {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: none;
  gap: 12px;
  margin: 0;
  padding: 0 1px 14px;
}

.finder-shell .finder-page-header h1 {
  color: #24313c;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.2;
  margin: 0;
}

.finder-shell .finder-company-name {
  color: #73818b;
  font-size: 12px;
  line-height: 1.3;
  margin: 5px 0 0;
}

.finder-shell .finder-company-switch,
.finder-shell .finder-header-menu-trigger {
  align-items: center;
  background: #fff;
  border: 1px solid #d7dfe5;
  border-radius: 7px;
  color: #344a5c;
  display: inline-flex;
  font-size: 16px;
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.finder-shell .finder-company-switch:hover,
.finder-shell .finder-company-switch:focus-visible,
.finder-shell .finder-header-menu-trigger:hover,
.finder-shell .finder-header-menu-trigger:focus-visible {
  background: #e8eef3;
  color: #164e73;
}

.finder-shell .finder-header-actions {
  flex: none;
  flex-wrap: nowrap;
  gap: 6px;
}

.finder-shell .finder-company-picker {
  position: relative;
}

.finder-shell .finder-company-trigger {
  align-items: center;
  background: #fff;
  border: 1px solid #d7dfe5;
  border-radius: 7px;
  color: #24313c;
  display: inline-flex;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  gap: 10px;
  justify-content: space-between;
  max-width: 250px;
  min-height: 36px;
  min-width: 170px;
  padding: 7px 9px;
  text-align: left;
}

.finder-shell .finder-company-trigger:hover,
.finder-shell .finder-company-trigger:focus-visible {
  border-color: #8caec0;
  outline: 2px solid #a8cce0;
  outline-offset: 1px;
}

.finder-shell .finder-company-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finder-shell .finder-company-popover {
  background: #fff;
  border: 1px solid #d8dfe5;
  border-radius: 9px;
  box-shadow: 0 10px 35px #26374630;
  max-width: calc(100vw - 20px);
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  width: 310px;
  z-index: 1200;
}

.finder-shell .finder-company-popover[hidden] {
  display: none;
}

.finder-shell .finder-company-search {
  border: 1px solid #d7dfe5;
  border-radius: 6px;
  color: #24313c;
  font-family: inherit;
  font-size: 13px;
  min-height: 34px;
  padding: 6px 8px;
  width: 100%;
}

.finder-shell .finder-company-results {
  max-height: min(280px, 45dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 5px;
}

.finder-shell .finder-company-option {
  background: #fff;
  border: 0;
  border-radius: 5px;
  color: #24313c;
  display: block;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  padding: 9px 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.finder-shell .finder-company-option:hover,
.finder-shell .finder-company-option:focus-visible,
.finder-shell .finder-company-option.is-active {
  background: #dbeaf4;
  color: #164e73;
}

.finder-shell .finder-company-option-code {
  color: #72808b;
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.finder-shell .finder-company-message {
  color: #72808b;
  font-size: 11px;
  margin: 0;
  padding: 7px 10px 2px;
}

.finder-shell .finder-upload-link {
  background: #17657b;
  border: 1px solid #17657b;
  border-radius: 7px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.finder-shell .finder-upload-link:hover,
.finder-shell .finder-upload-link:focus-visible {
  background: #15566a;
  border-color: #15566a;
  color: #fff;
}

.finder-shell .finder-company-chooser {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  max-width: 520px;
  padding: 0;
}

.finder-shell .finder-company-chooser-controls {
  align-items: center;
  gap: 8px;
}

.finder-shell .finder-company-chooser-controls .form-select {
  background-color: #fff;
  border-color: #d7dfe5;
  border-radius: 7px;
  font-size: 13px;
  max-width: 250px;
  min-height: 36px;
}

.finder-shell .finder-company-chooser-controls .btn {
  border-radius: 7px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  min-height: 36px;
  white-space: nowrap;
}

.finder-shell .finder-workspace {
  border: 1px solid #e0e5e9;
  border-radius: 10px;
  flex: 1;
  grid-template-columns: minmax(150px, 17fr) minmax(200px, 25fr) minmax(260px, 29fr) minmax(260px, 29fr);
  height: auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  transition: none;
}

.finder-shell .finder-workspace.is-loading {
  opacity: 0.7;
}

.finder-shell .finder-pane + .finder-pane {
  border-color: #e2e6ea;
}

.finder-shell .finder-pane-heading {
  background: transparent;
  border: 0;
  color: #7a8791;
  min-height: 0;
  padding: 16px 18px 10px;
}

.finder-shell .finder-pane-heading h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.finder-shell .finder-pane-heading > span {
  display: none;
}

.finder-shell .finder-pane-body {
  padding: 0 9px 12px;
}

.finder-shell .finder-entry,
.finder-shell .finder-file-choice {
  align-items: center;
  border-radius: 6px;
  color: #24313c;
  font-size: 13px;
  font-weight: 400;
  gap: 9px;
  min-height: 0;
  padding: 10px 9px;
}

.finder-shell .finder-folder-choice,
.finder-shell .finder-file-choice {
  padding-right: 34px;
}

.finder-shell .finder-entry-count {
  display: none;
}

.finder-shell .finder-entry:hover,
.finder-shell .finder-entry:focus-visible,
.finder-shell .finder-file-choice:hover,
.finder-shell .finder-file-choice:focus-visible {
  background: #e8eef3;
  color: #164e73;
}

.finder-shell .finder-entry.is-selected,
.finder-shell .finder-folder-row.is-selected .finder-folder-choice,
.finder-shell .finder-file-row.is-selected .finder-file-choice {
  background: #dbeaf4;
  color: #164e73;
  font-weight: 500;
}

.finder-shell .finder-file-glyph {
  background: transparent;
  color: #72808b;
  font-size: 16px;
  font-weight: 400;
  margin: 0;
  padding: 0;
}

.finder-shell .finder-file-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finder-shell .finder-file-text strong {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
}

.finder-shell .finder-preview-content {
  align-items: center;
  display: flex;
  justify-content: flex-start;
  padding: 20px;
}

.finder-shell .finder-preview-download {
  background: #fff;
  border: 1px solid #dce2e6;
  border-radius: 3px;
  color: inherit;
  display: block;
  max-width: 260px;
  overflow: hidden;
  width: 100%;
}

.finder-shell .finder-preview-download:focus-visible {
  outline: 2px solid #17657b;
  outline-offset: 3px;
}

.finder-shell .finder-preview-image {
  display: block;
  height: auto;
  max-height: calc(100dvh - 165px);
  object-fit: contain;
  width: 100%;
}

.finder-shell .finder-preview-unavailable {
  color: #72808b;
  display: block;
  font-size: 12px;
  margin: 0;
  padding: 24px 16px;
  text-align: center;
}

.finder-shell .finder-preview-unavailable[hidden] {
  display: none;
}

.finder-shell .finder-empty {
  color: #72808b;
  font-size: 12px;
  padding: 10px 9px;
}

@media (max-width: 991.98px) {
  .finder-shell .app-main {
    margin-left: 0;
    padding: 14px 9px 12px;
  }

  .finder-shell .mobile-menu-button {
    flex: none;
    margin-bottom: 8px;
  }
}

@media (max-width: 575.98px) {
  .finder-shell .finder-company-popover {
    left: 0;
    right: auto;
    width: min(310px, calc(100vw - 20px));
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #ffffff !important;
    color: #111827;
    font-size: 9pt;
  }

  .app-sidebar,
  .mobile-menu-button,
  .sidebar-backdrop,
  .flash-stack,
  .btn,
  button,
  form,
  input,
  textarea,
  select {
    display: none !important;
  }

  .app-shell,
  .app-main {
    display: block;
    margin: 0;
    margin-left: 0;
    max-width: none;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .presence-print-extras-summary {
    border: 1px solid #9ca3af;
    border-radius: 0;
    break-inside: avoid;
    box-shadow: none;
    margin: 0 0 6mm !important;
    padding: 5mm;
    page-break-inside: avoid;
  }

  .presence-print-extras-summary h2 {
    font-size: 11pt;
    margin-bottom: 3mm !important;
  }

  .presence-print-extras-list {
    gap: 3mm;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .presence-print-extras-employee {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .presence-print-expense-list li {
    grid-template-columns: minmax(18mm, auto) 1fr 1fr;
  }

  .presence-calendar-section {
    break-inside: avoid;
    page-break-inside: avoid;
    padding-bottom: 5mm;
  }

  .presence-calendar-wrap {
    border-color: #9ca3af;
    overflow: visible;
  }

  .presence-employee-extras {
    display: none;
  }

  .presence-vertical-table {
    font-size: 7.5pt;
    width: 100%;
  }

  .presence-vertical-table th,
  .presence-vertical-table td {
    height: 15pt;
  }
}
