/* Distributor responsive cascade fix. */
@media (max-width: 980px) {
    .cloud-distributor-shell {
        grid-template-columns: 1fr;
    }

    .cloud-distributor-story,
    .cloud-distributor-form {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 760px) {
    .cloud-distributor-shell {
        gap: 16px;
    }

    .cloud-distributor-copy h2 {
        font-size: clamp(1.55rem, 8vw, 2rem);
    }

    .cloud-distributor-copy p:last-child {
        font-size: 0.84rem;
    }

    .cloud-distributor-logo-wrap {
        width: min(100%, 300px);
        max-width: 300px;
    }

    .cloud-distributor-form .cloud-contact-field textarea {
        min-height: 84px;
    }
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--color-text-muted, #6b7894);
  font-size: 0.82rem;
  line-height: 1.35;
}

.settings-holiday-year-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-toggle-row small {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-text-muted, #6b7894);
}

.work-schedule-meal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.1;
}

.work-schedule-meal-toggle span {
  color: var(--color-text-muted, #6b7894);
  font-size: 0.78rem;
  font-weight: 700;
}

.company-holiday-toolbar {
  align-items: flex-start;
}

.company-holiday-toolbar h2 {
  margin: 0 0 0.25rem;
  color: var(--color-text-strong, #0f1a2a);
  font-size: 1.25rem;
}

.company-holiday-toolbar p {
  margin: 0;
  color: var(--color-text-muted, #6b7894);
}

.company-holiday-table td small {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-text-muted, #6b7894);
  line-height: 1.3;
}

.company-holiday-worked {
  color: #047857;
  background: #e9f9ef;
}

.company-holiday-off {
  color: #d97706;
  background: #fff7e6;
}

.company-holiday-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.company-holiday-modal-body {
  display: grid;
  gap: 1rem;
}

.company-holiday-form-grid {
  align-items: end;
}

.company-holiday-rule-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.company-holiday-rule-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.35rem 0.8rem;
  min-height: 5.45rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border, #dbe4f2);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
}

.company-holiday-rule-option.is-selected {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.1);
}

.company-holiday-rule-option input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  accent-color: #2563eb;
}

.company-holiday-rule-option span {
  color: var(--color-text-strong, #0f1a2a);
  font-weight: 800;
}

.company-holiday-rule-option small {
  grid-column: 2;
  color: var(--color-text-muted, #6b7894);
  line-height: 1.3;
}

@media (max-width: 900px) {
  .company-holiday-rule-picker {
    grid-template-columns: 1fr;
  }
}

.shift-section-helper {
    margin: -0.35rem 0 1.25rem;
    color: #6b7894;
    font-size: 1rem;
}

.shift-employee-picker {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.shift-employee-picker > small,
.shift-check-field small,
.shift-manual-codes span {
    color: #6b7894;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
}

.shift-employee-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
    max-height: 17rem;
    overflow: auto;
    padding: 0.15rem;
}

.shift-employee-option {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe5f3;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    gap: 0.85rem;
    min-height: 4.35rem;
    padding: 0.9rem 1rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.shift-employee-option:hover {
    border-color: #9fd5eb;
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.08);
    transform: translateY(-1px);
}

.shift-employee-option input {
    flex: 0 0 auto;
    height: 1.25rem;
    width: 1.25rem;
}

.shift-employee-option span,
.shift-check-field > span,
.shift-manual-codes {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shift-employee-option strong,
.shift-check-field strong {
    color: #101828;
    font-weight: 800;
}

.shift-employee-option small {
    color: #73809b;
    font-size: 0.86rem;
    font-weight: 700;
}

.shift-selected-list {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.shift-selected-chip {
    align-items: center;
    background: #eef9f9;
    border: 1px solid #b9eeee;
    border-radius: 999px;
    color: #123055;
    display: inline-flex;
    gap: 0.45rem;
    min-height: 2.4rem;
    padding: 0.45rem 0.65rem 0.45rem 0.9rem;
}

.shift-selected-chip button,
.shift-clear-selection {
    align-items: center;
    background: #fff;
    border: 1px solid #d8e3f2;
    border-radius: 999px;
    color: #42526e;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
}

.shift-selected-chip button {
    height: 1.75rem;
    width: 1.75rem;
}

.shift-clear-selection {
    min-height: 2.4rem;
    padding: 0 0.95rem;
}

.shift-manual-codes {
    gap: 0.5rem;
}

.shift-check-field {
    align-items: flex-start;
}

.shift-check-field input {
    margin-top: 0.15rem;
}

@media (max-width: 760px) {
    .shift-employee-options {
        grid-template-columns: 1fr;
    }
}

.shift-employee-code-row {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.shift-employee-code-row .app-form-textarea {
    min-height: 4.8rem;
}

.shift-search-button {
    align-self: stretch;
    min-width: 13rem;
    white-space: nowrap;
}

.shift-employee-modal {
    width: min(100%, 920px);
}

.shift-employee-modal-body {
    display: grid;
    gap: 1rem;
}

.shift-select-all-row {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #dfe7f2;
    border-radius: 16px;
    color: #213455;
    cursor: pointer;
    display: flex;
    font-weight: 800;
    gap: 0.85rem;
    min-height: 3.25rem;
    padding: 0.75rem 1rem;
}

.shift-select-all-row input {
    height: 1.2rem;
    width: 1.2rem;
}

.shift-employee-modal-list {
    display: grid;
    gap: 0.75rem;
    max-height: 26rem;
    overflow: auto;
    padding: 0.15rem;
}

.shift-employee-modal-list .shift-employee-option {
    min-height: 3.75rem;
}

.shift-employee-empty,
.shift-employee-modal-summary {
    background: #f8fbff;
    border: 1px solid #dfe7f2;
    border-radius: 16px;
    color: #6b7894;
    font-weight: 800;
    padding: 1rem;
}

.shift-employee-modal-summary {
    color: #213455;
    text-align: right;
}

@media (max-width: 760px) {
    .shift-employee-code-row {
        grid-template-columns: 1fr;
    }

    .shift-search-button {
        width: 100%;
    }
}

.shift-section-heading-row {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.shift-section-helper {
    color: #7180a0;
    margin: 0.25rem 0 0;
}

.shift-pattern-list {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    margin: 1rem 0 1.35rem;
}

.shift-pattern-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #dfe7f2;
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
    display: flex;
    gap: 0.85rem;
    justify-content: space-between;
    padding: 1rem;
}

.shift-pattern-card.is-muted {
    opacity: 0.6;
}

.shift-pattern-card strong {
    color: #101828;
    display: block;
    font-weight: 900;
}

.shift-pattern-card small,
.shift-pattern-card span {
    color: #7180a0;
    display: block;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-top: 0.25rem;
}

.shift-pattern-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.45rem;
}

.shift-pattern-modal {
    width: min(100%, 1080px);
}

.shift-pattern-modal-body {
    display: grid;
    gap: 1.1rem;
}

.shift-pattern-preset {
    align-items: end;
    background: #f6f9ff;
    border: 1px solid #d9e4f5;
    border-radius: 18px;
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(16rem, 1.4fr) minmax(14rem, 1fr) auto;
    padding: 1rem;
}

.shift-pattern-preset p,
.shift-pattern-preset small {
    color: #667391;
    line-height: 1.4;
    margin: 0.25rem 0 0;
}

.shift-pattern-preset small {
    grid-column: 1 / -1;
    font-weight: 700;
}

.shift-pattern-segment-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: space-between;
}

.shift-pattern-segment-header strong {
    color: #101828;
    font-weight: 900;
}

.shift-pattern-segments {
    display: grid;
    gap: 0.8rem;
}

.shift-pattern-segment {
    align-items: end;
    background: #fff;
    border: 1px solid #dfe7f2;
    border-radius: 18px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 3rem minmax(8.5rem, 0.75fr) minmax(6rem, 0.5fr) minmax(12rem, 1fr) minmax(12rem, 1fr) auto;
    padding: 0.85rem;
}

.shift-segment-order {
    align-self: center;
    background: #eef5ff;
    border-radius: 14px;
    color: #2864d8;
    display: grid;
    font-weight: 900;
    height: 2.65rem;
    place-items: center;
    width: 2.65rem;
}

@media (max-width: 980px) {
    .shift-pattern-preset,
    .shift-pattern-segment {
        grid-template-columns: 1fr;
    }

    .shift-pattern-preset small {
        grid-column: auto;
    }

    .shift-segment-order {
        width: 100%;
    }
}

@media (max-width: 820px) {
    .efirma-card {
        grid-template-columns: 1fr;
    }

    .efirma-visual {
        min-height: 250px;
        border-right: 0;
        border-bottom: 1px solid #e1e9f5;
    }

    .efirma-lock {
        right: calc(50% - 92px);
        bottom: 24px;
    }

    .efirma-content {
        padding: 30px 24px;
    }

}
