:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #687084;
    --line: #dfe5ee;
    --primary: #087f8c;
    --primary-dark: #066773;
    --accent: #f2b84b;
    --danger: #b42318;
    --shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 18px clamp(16px, 4vw, 48px);
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
}

h1 {
    font-size: clamp(24px, 3vw, 36px);
}

h2 {
    font-size: clamp(22px, 3vw, 32px);
}

h3 {
    font-size: 18px;
}

main {
    margin: 0 auto;
    max-width: 1440px;
    padding: 24px clamp(16px, 4vw, 48px) 48px;
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.message {
    border-radius: 6px;
    font-weight: 700;
    padding: 11px 13px;
}

.message.success {
    background: #edf5f6;
    color: var(--primary-dark);
}

.message.error {
    background: #fff0ee;
    color: var(--danger);
}

.login,
.inline-form,
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-option {
    align-items: center;
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    gap: 6px;
    min-height: 42px;
    padding: 8px 11px;
}

.check-option input {
    min-height: auto;
    width: auto;
}

.role-badge {
    background: #edf5f6;
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    font-size: 11px;
    margin: 2px 4px 2px 0;
    padding: 4px 7px;
}

.session-box {
    align-items: center;
    display: flex;
    gap: 12px;
}

.session-box span {
    color: var(--muted);
    font-weight: 700;
}

input,
select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    gap: 6px;
}

.field-label {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.day-picker {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
}

.day-week {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 0 2px 2px;
    text-align: center;
    text-transform: lowercase;
}

.day-option {
    cursor: pointer;
    display: block;
    min-height: 42px;
}

.day-option.empty-day {
    background: #f4f6f9;
    border: 1px dashed var(--line);
    border-radius: 6px;
    cursor: default;
}

.day-option input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.day-option span {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    min-height: 42px;
    padding: 6px 4px;
    text-align: center;
}

.day-option strong,
.day-option small {
    display: block;
}

.day-option strong {
    color: var(--text);
    font-size: 15px;
}

.day-option small {
    color: var(--muted);
    font-size: 10px;
}

.day-option.current span {
    border-color: var(--accent);
}

.day-option input:focus + span {
    box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.16);
}

.day-option input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
}

.day-option input:checked + span strong,
.day-option input:checked + span small {
    color: #fff;
}

.button,
.icon-link {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover,
.icon-link:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #edf5f6;
    color: var(--primary-dark);
}

.button.danger {
    background: var(--danger);
}

.button.danger:hover {
    background: #8f1d14;
}

.month-bar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 6px 0 22px;
    text-align: center;
}

.app-tabs {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 20px;
}

.app-tabs a {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    padding: 9px 13px;
    text-decoration: none;
}

.app-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tab-badge {
    background: #b91c1c;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    margin-left: 6px;
    min-width: 20px;
    padding: 2px 6px;
}

.app-tabs .backup-link {
    margin-left: auto;
}

.vet-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    margin-bottom: 16px;
}

.vet-summary article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 14px;
}

.vet-summary span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.vet-summary strong {
    display: block;
    font-size: 18px;
}

.calendar-tools {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 14px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-buttons button {
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 8px 12px;
}

.filter-buttons button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.icon-link {
    border-radius: 50%;
    font-size: 24px;
    height: 44px;
    padding: 0;
    width: 44px;
}

.admin-panel {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(280px, 1.2fr) minmax(280px, 1fr);
    margin-bottom: 22px;
}

.pending-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
    margin-bottom: 16px;
}

.pending-summary div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.pending-summary strong {
    display: block;
    font-size: 26px;
}

.pending-summary span {
    color: var(--muted);
    font-size: 13px;
}

.requests-panel,
.vet-panel {
    margin-bottom: 22px;
}

.form-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    padding: 18px;
}

.professionals {
    display: grid;
    gap: 6px;
}

.compact-list {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.professional-row {
    align-items: center;
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(120px, 1fr) auto 70px 18px;
    padding: 6px;
}

.professional-row strong {
    align-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.professional-row input {
    font-size: 13px;
    min-height: 32px;
    padding: 5px 7px;
}

.professional-row span {
    color: var(--muted);
    font-size: 13px;
}

.compact-button {
    font-size: 13px;
    min-height: 32px;
    padding: 0 10px;
}

.modal-backdrop {
    align-items: center;
    background: rgba(23, 32, 51, 0.48);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 20;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    background: var(--panel);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(23, 32, 51, 0.28);
    max-width: 420px;
    padding: 18px;
    width: 100%;
}

.wide-modal {
    max-width: 720px;
}

.modal-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.icon-close {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
}

.modal form {
    display: grid;
    gap: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.admin-create-form,
.admin-row {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(150px, 1fr) minmax(130px, 1fr) auto;
}

.admin-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.admin-row {
    align-items: center;
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 6px;
    grid-template-columns: minmax(150px, 1fr) minmax(130px, 1fr) auto 18px;
    padding: 8px;
}

.request-list {
    display: grid;
    gap: 10px;
}

.request-list.compact {
    gap: 8px;
}

.history-scroll {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.vet-panel > .report-card {
    max-height: 320px;
    overflow-y: auto;
}

.request-card {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 13px;
}

.request-card strong,
.request-card span {
    display: block;
}

.request-card p {
    color: var(--muted);
    margin: 4px 0;
}

.request-actions {
    display: flex;
    gap: 8px;
}

.status {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 9px;
}

.status.pendente {
    background: #fff8ea;
    color: #8a5a00;
}

.status.aprovada {
    background: #edf5f6;
    color: var(--primary-dark);
}

.status.recusada {
    background: #fff0ee;
    color: var(--danger);
}

.chip {
    align-items: center;
    background: #edf5f6;
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    font-size: 14px;
    gap: 8px;
    padding: 7px 10px;
}

.chip a,
.delete {
    color: var(--danger);
    font-weight: 700;
    text-decoration: none;
}

.calendar {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    scroll-margin-top: 18px;
}

.today-link {
    border: 1px solid var(--primary);
    border-radius: 999px;
    color: var(--primary);
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    margin-top: 6px;
    padding: 4px 10px;
    text-decoration: none;
    text-transform: uppercase;
}

.day {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 178px;
    position: relative;
}

.day::after {
    align-items: center;
    background: var(--primary);
    border: 2px solid var(--bg);
    border-radius: 999px;
    color: #fff;
    content: none;
    display: flex;
    font-size: 12px;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    position: absolute;
    right: -17px;
    top: 16px;
    width: 28px;
    z-index: 2;
}

.day:not(:nth-child(7n))::after {
    content: "->";
}

.day.today {
    border-color: #0f766e;
    box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.2), 0 10px 22px rgba(15, 118, 110, 0.16);
    scroll-margin-top: 18px;
}

.day.today .day-head {
    background: #e8f6f3;
}

.day.today .day-head strong::after {
    background: #0f766e;
    border-radius: 999px;
    color: #fff;
    content: "hoje";
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    margin-left: 6px;
    padding: 2px 6px;
    text-transform: uppercase;
}

.day.my-day {
    border-color: var(--line);
    box-shadow: none;
}

.day.my-day .day-head {
    background: #f9fbfd;
}

.day.my-day .day-head strong::after {
    background: #fff3c4;
    border: 1px solid #d9ab36;
    border-radius: 999px;
    color: #7a5200;
    content: "meu";
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    margin-left: 6px;
    padding: 2px 5px;
    text-transform: uppercase;
}

.day-head {
    align-items: center;
    background: #f9fbfd;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.day-head strong {
    font-size: 20px;
}

.day-head span,
.muted,
.empty {
    color: var(--muted);
}

.service-groups {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.service-group {
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.service-group h4 {
    background: #f9fbfd;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    margin: 0;
    padding: 7px 8px;
}

.shifts {
    display: grid;
    gap: 6px;
    padding: 8px;
}

.shift {
    background: #f4fbfc;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 8px;
}

.shift.internacao {
    background: #edf8ef;
    border-left-color: #2f8f46;
    color: #173d22;
}

.shift.auxiliares {
    background: #f6f7fb;
    border-left-color: #687084;
}

.shift.recepcao {
    background: #fff0f5;
    border-left-color: #c14472;
    color: #5f2038;
}

.shift.servicosgerais {
    background: #f0f5ed;
    border-left-color: #647a42;
    color: #31401f;
}

.shift.my-shift {
    background: #fff3c4;
    border-left-color: #d19200;
    box-shadow: inset 0 0 0 1px rgba(209, 146, 0, 0.24);
}

.shift.overnight-start {
    background: #e8f5ff;
    border-left-color: #0f6fbf;
    box-shadow: inset 0 0 0 1px rgba(15, 111, 191, 0.08);
}

.shift.overnight-end {
    background: #f7fbff;
    border: 1px dashed #8cb9df;
    border-left: 4px dashed #8cb9df;
    color: #375a75;
    padding: 6px 8px;
}

.shift.overnight-start.my-shift {
    background: #ffeeb0;
    border-left-color: #d19200;
}

.shift.overnight-end.my-shift {
    background: #fff8df;
    border-color: #d9ab36;
    border-left-color: #d19200;
}

.shift strong,
.shift span,
.shift b {
    display: block;
}

.shift strong {
    font-size: 13px;
}

.shift-label {
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.shift span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.shift .night-note {
    color: #1d5f99;
    font-weight: 700;
}

.shift.overnight-end .night-note {
    color: #55728a;
    font-weight: 600;
}

.shift b {
    font-size: 14px;
    margin-top: 5px;
}

.shift.overnight-end b {
    font-size: 13px;
}

.production-note {
    color: var(--primary-dark);
    font-weight: 700;
}

.production-panel {
    margin-bottom: 22px;
}

.point-panel {
    display: grid;
    gap: 16px;
}

.point-employee-reports {
    display: grid;
    gap: 16px;
}

.point-employee-report {
    margin: 0;
}

.point-employee-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.point-employee-head h3 {
    margin: 2px 0 0;
}

.point-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.point-totals span {
    display: grid;
    gap: 2px;
    min-width: 138px;
    padding: 8px 10px;
    border: 1px solid #d8e1e8;
    border-radius: 6px;
    background: #f7fafb;
    color: #53636d;
    font-size: 0.78rem;
}

.point-totals strong {
    color: #17313d;
    font-size: 1rem;
}

.point-totals .overtime-total {
    border-color: #e8c77e;
    background: #fff8e8;
}

@media (max-width: 700px) {
    .point-employee-head {
        align-items: stretch;
        flex-direction: column;
    }

    .point-totals {
        justify-content: stretch;
    }

    .point-totals span {
        flex: 1;
    }
}

.point-manual-form {
    align-items: end;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.point-manual-form .form-section-head {
    grid-column: 1 / -1;
}

.point-manual-form .form-section-head p:last-child {
    margin: 6px 0 0;
}

.point-manual-note {
    grid-column: span 2;
}

.point-action-card {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 20px;
}

.point-action-card h3 {
    margin: 7px 0 5px;
}

.point-action-card p {
    color: var(--muted);
    margin: 0;
}

.point-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.point-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 9px;
}

.point-status.open {
    background: #fff0ee;
    color: var(--danger);
}

.point-status.ready {
    background: #edf5f6;
    color: var(--primary-dark);
}

.point-status.neutral {
    background: #f1f3f7;
    color: var(--muted);
}

.location-feedback {
    background: #fff8ea;
    border: 1px solid #efd49a;
    border-radius: 6px;
    color: #7a5200 !important;
    flex-basis: 100%;
    padding: 9px 11px;
}

.point-history {
    margin-top: 0;
}

.pill.manual {
    background: #fff8ea;
    color: #8a5a00;
}

.production-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.production-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.production-row input {
    max-width: 120px;
}

.empty {
    font-size: 13px;
    margin: 0;
}

.reports {
    margin-top: 28px;
}

.commission-reports {
    border-top: 3px solid var(--primary);
    padding-top: 20px;
}

.commission-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.commission-title {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.commission-title h3 {
    margin-bottom: 0;
}

.commission-summary span {
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}

.commission-summary .commission-total,
.total-row {
    background: #edf5f6;
    color: var(--primary-dark);
}

.total-row td {
    border-top: 2px solid var(--primary);
}

.monthly-reports {
    display: grid;
    gap: 14px;
}

.report-head {
    margin-bottom: 14px;
}

.report-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.report-card h3 {
    margin-bottom: 14px;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid var(--line);
    padding: 11px 10px;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    background: #f9fbfd;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.pill {
    background: #edf5f6;
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    margin: 0 5px 5px 0;
    padding: 5px 8px;
}

.pill.neutral {
    background: #f1f3f7;
    color: var(--muted);
}

.weekly-reports {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    margin-top: 14px;
}

.week-card {
    box-shadow: none;
}

.weekly-service {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.weekly-service:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.weekly-service h4 {
    font-size: 14px;
    margin: 0 0 8px;
}

.report-list {
    display: grid;
    gap: 8px;
}

.report-line {
    align-items: center;
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px;
}

.report-line strong {
    margin-right: auto;
}

.exams-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 18px;
}

.exam-form {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    margin-bottom: 16px;
    padding: 14px;
}

.exam-filter-form {
    align-items: end;
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
    margin-bottom: 16px;
    padding: 12px;
}

.exam-note {
    grid-column: span 2;
}

.exam-list {
    display: grid;
    gap: 12px;
}

.exam-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.exam-card.aberto {
    border-color: #d9ab36;
}

.exam-card.respondido {
    border-color: #0f766e;
}

.exam-card-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.exam-card h3 {
    margin: 6px 0 4px;
}

.status-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    text-transform: uppercase;
}

.status-badge.aberto {
    background: #fff3c4;
    color: #7a5200;
}

.status-badge.respondido {
    background: #dcfce7;
    color: #166534;
}

.status-badge.arquivado {
    background: #f1f3f7;
    color: var(--muted);
}

.exam-observation,
.exam-answer {
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 7px;
    margin: 0;
    padding: 10px;
}

.exam-answer p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.exam-audio {
    background: #f9fbfd;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

.exam-audio audio {
    width: 100%;
}

.exam-answer-form {
    display: grid;
    gap: 10px;
}

.audio-recorder {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

.audio-recorder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.audio-recorder .recorder-status {
    margin: 0;
}

.audio-recorder audio {
    width: 100%;
}

.button.danger {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.chat-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 18px;
}

.chat-layout {
    display: grid;
    gap: 14px;
    grid-template-columns: 280px 1fr;
}

.chat-sidebar,
.chat-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.chat-sidebar {
    background: #f9fbfd;
    padding: 12px;
}

.chat-sidebar h3 {
    font-size: 15px;
    margin: 0 0 10px;
}

.chat-sector-list {
    display: grid;
    gap: 8px;
}

.chat-sector {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
    padding: 10px;
    text-align: left;
}

.chat-sector.active {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.chat-sector strong,
.chat-sector span {
    display: block;
}

.chat-sector span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.chat-box {
    background: #fff;
    display: grid;
    grid-template-rows: auto minmax(320px, 52vh) auto;
}

.chat-box-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 12px;
}

.chat-box-head h3 {
    margin: 2px 0 0;
}

.chat-live {
    background: #dcfce7;
    border-radius: 999px;
    color: #166534;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    text-transform: uppercase;
}

.chat-messages {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 12px;
}

.chat-message {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: min(620px, 88%);
    padding: 9px 10px;
}

.chat-message.mine {
    align-self: flex-end;
    background: #e8f6f3;
    border-color: #a7d7ce;
}

.chat-message.task-message {
    border-color: #d9ab36;
    box-shadow: inset 4px 0 0 #d9ab36;
}

.chat-message div {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.chat-message span {
    color: var(--muted);
    font-size: 11px;
}

.chat-message p {
    margin: 6px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-form {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto auto;
    padding: 12px;
}

.chat-form textarea {
    min-height: 48px;
    resize: vertical;
}

.task-check {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    white-space: nowrap;
}

.task-done-button {
    background: #166534;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    margin-top: 8px;
    padding: 6px 12px;
}

@media (max-width: 980px) {
    .topbar,
    .admin-panel {
        grid-template-columns: 1fr;
    }

    .topbar,
    .login {
        align-items: stretch;
        flex-direction: column;
    }

    .app-tabs .backup-link {
        margin-left: 0;
    }

    .calendar-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .point-action-card {
        align-items: stretch;
        flex-direction: column;
    }

    .point-manual-form {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .point-actions,
    .point-actions form,
    .point-actions .button,
    .geolocation-form .button {
        width: 100%;
    }

    .vet-summary {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .request-card,
    .request-actions,
    .professional-row {
        align-items: stretch;
        flex-direction: column;
    }

    .professional-row {
        display: flex;
    }

    .calendar {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .pending-summary {
        grid-template-columns: 1fr;
    }

    .admin-create-form,
    .admin-row {
        grid-template-columns: 1fr;
    }

    .weekly-reports {
        grid-template-columns: 1fr;
    }

    .exam-form {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .exam-filter-form {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .exam-note {
        grid-column: span 2;
    }

    .exam-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }

    .day:not(:nth-child(7n))::after {
        content: none;
    }

    .day:not(:nth-child(2n))::after {
        content: "->";
    }
}

@media (max-width: 560px) {
    .calendar,
    .admin-panel,
    .vet-summary {
        grid-template-columns: 1fr;
    }

    .inline-form,
    .form-row {
        flex-direction: column;
    }

    .point-manual-form {
        grid-template-columns: 1fr;
    }

    .point-manual-note {
        grid-column: span 1;
    }

    .chat-form {
        grid-template-columns: 1fr;
    }

    .exam-form,
    .exam-filter-form,
    .exam-note {
        grid-template-columns: 1fr;
        grid-column: span 1;
    }

    .chat-form .button {
        width: 100%;
    }

    .day:not(:nth-child(2n))::after {
        content: none;
    }
}

@media print {
    .topbar,
    .month-bar,
    .app-tabs,
    .pending-summary,
    .admin-panel,
    .vet-panel,
    .production-panel,
    .calendar-tools,
    .calendar,
    .exams-panel,
    .chat-panel,
    .print-button,
    .button,
    .modal-backdrop {
        display: none !important;
    }

    body {
        background: #fff;
    }

    main {
        max-width: none;
        padding: 0;
    }

    .reports,
    .commission-reports {
        border: 0;
        margin: 0;
        padding: 0;
    }

    .report-card {
        box-shadow: none;
        break-inside: avoid;
    }
}
