:root {
    --navy: #14264a;
    --navy-soft: #27395f;
    --teal: #078db1;
    --teal-dark: #047493;
    --cyan: #eaf8fb;
    --cyan-strong: #c9eff6;
    --mint: #e6f8f1;
    --green: #22b573;
    --amber: #f2b84b;
    --blue: #347ee8;
    --red: #f06464;
    --gray: #637083;
    --muted: #8a96a8;
    --line: #dce6ef;
    --line-soft: #edf3f7;
    --white: #ffffff;
    --surface: #f7fbfd;
    --shadow: 0 14px 35px rgba(20, 38, 74, 0.1);
    --shadow-soft: 0 8px 24px rgba(20, 38, 74, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--navy);
    background: var(--white);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(16px);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--teal);
}

.brand strong {
    display: block;
    font-size: 1.04rem;
    line-height: 1.05;
    text-transform: uppercase;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    color: var(--navy-soft);
    font-size: 0.95rem;
}

.main-nav a:hover {
    color: var(--teal);
}

.mobile-login-link {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0 20px;
    font-weight: 700;
    color: var(--navy);
    background: var(--white);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.btn-primary {
    color: var(--white);
    background: var(--teal);
    border-color: var(--teal);
}

.btn-primary:hover {
    background: var(--teal-dark);
}

.btn-secondary {
    color: var(--navy);
    background: var(--white);
    border-color: var(--line);
}

.btn-ghost {
    color: var(--teal-dark);
    background: var(--cyan);
    border-color: var(--cyan-strong);
}

.btn-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    line-height: 1;
}

.mobile-menu-button,
.sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.mobile-menu-button span,
.sidebar-toggle span {
    width: 18px;
    height: 2px;
    background: var(--navy);
}

.hero-section {
    position: relative;
    min-height: min(690px, calc(100vh - 72px));
    overflow: hidden;
    background: var(--surface);
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.96) 22%, rgba(255, 255, 255, 0.72) 43%, rgba(255, 255, 255, 0.08) 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0) 72%, rgba(247, 251, 253, 0.98) 100%);
}

.hero-content {
    position: relative;
    display: grid;
    min-height: min(690px, calc(100vh - 72px));
    grid-template-columns: minmax(0, 560px) 1fr;
    align-items: center;
    gap: 42px;
    padding: 58px 0 72px;
}

.hero-copy {
    max-width: 570px;
}

.pill,
.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0 0 14px;
    border-radius: 999px;
    padding: 0 14px;
    color: var(--teal-dark);
    background: var(--cyan);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.eyebrow {
    min-height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.hero-copy h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(2.3rem, 5vw, 4.55rem);
    line-height: 0.98;
}

.hero-copy h1 span,
.section-heading span {
    color: var(--teal);
}

.hero-copy > p:not(.pill) {
    max-width: 540px;
    margin: 22px 0 28px;
    color: var(--gray);
    font-size: 1.04rem;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.hero-features span {
    position: relative;
    min-height: 48px;
    padding-left: 34px;
    color: var(--navy-soft);
    font-size: 0.86rem;
    font-weight: 700;
}

.hero-features span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--teal);
    border-radius: 50%;
    background: var(--white);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.schedule-card {
    align-self: end;
    justify-self: center;
    display: flex;
    width: min(360px, 100%);
    gap: 16px;
    align-items: center;
    border-radius: var(--radius);
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.schedule-card p {
    margin: 0 0 5px;
    color: var(--teal-dark);
    font-weight: 800;
}

.schedule-card strong {
    font-size: 1.2rem;
}

.schedule-icon,
.lunch-box span {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--teal);
}

.schedule-icon::before,
.schedule-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: var(--white);
    transform-origin: left center;
}

.schedule-icon::before {
    width: 12px;
    height: 2px;
    transform: translate(-1px, -1px) rotate(0deg);
}

.schedule-icon::after {
    width: 2px;
    height: 15px;
    transform: translate(-1px, -13px);
}

.services-section,
.testimonials-section {
    padding: 58px 0 68px;
    background: var(--white);
}

.section-heading {
    margin-bottom: 32px;
}

.section-heading.centered {
    text-align: center;
}

.section-heading h2,
.about-grid h2,
.appointment-grid h2,
.panel h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.12;
}

.section-heading p,
.about-grid p,
.appointment-grid p,
.panel p {
    color: var(--gray);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.service-card,
.testimonial-grid article,
.panel,
.metric-card,
.kanban-column,
.appointment-card,
.login-card,
.login-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.service-card {
    min-height: 176px;
    padding: 22px 16px;
    text-align: center;
}

.service-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin: 0 auto 12px;
    color: var(--teal);
}

.service-card h3 {
    margin: 0 0 7px;
    font-size: 1rem;
}

.service-card p {
    margin: 0;
    color: var(--gray);
    font-size: 0.88rem;
}

.about-section {
    padding: 62px 0;
    color: var(--white);
    background: linear-gradient(110deg, var(--teal-dark), #62c3d2);
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
    align-items: center;
    gap: 54px;
}

.about-grid .eyebrow,
.about-grid h2,
.about-grid p {
    color: var(--white);
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.about-highlights article {
    min-height: 138px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: var(--radius);
    padding: 20px;
    background: rgba(255, 255, 255, 0.13);
}

.about-highlights strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.about-highlights span {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.testimonial-grid article {
    padding: 24px;
}

.testimonial-grid p {
    margin: 0 0 18px;
    color: var(--gray);
}

.appointment-public {
    padding: 68px 0;
    background: var(--surface);
}

.public-schedule-layout {
    display: grid;
    gap: 22px;
}

.public-schedule-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 0;
}

.public-date-form {
    flex: 0 0 auto;
}

.public-kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 12px;
}

.public-slot-card {
    display: grid;
    min-height: 126px;
    align-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.public-slot-card strong,
.public-slot-card span,
.public-slot-card p {
    display: block;
    margin: 0;
}

.public-slot-card span {
    width: max-content;
    border-radius: 999px;
    padding: 3px 9px;
    color: #0f6b43;
    background: var(--mint);
    font-size: 0.75rem;
    font-weight: 900;
}

.public-slot-card p {
    color: var(--muted);
    font-size: 0.86rem;
}

.busy-slot {
    background: #f4f7fa;
}

.busy-slot span {
    
    color:#a3456b;/* #505b6d;*/
    background:#edd0de;/* #e8edf2;*/
}

.public-slot-card.lunch-column span {
    color: #8b5d00;
    background: #fff0c8;
}

.public-form.public-form-collapsed {
    display: none;
}

.public-form.public-form-collapsed.is-open {
    display: grid;
}

.selected-slot-summary {
    border: 1px solid var(--cyan-strong);
    border-radius: var(--radius);
    padding: 13px 15px;
    color: var(--teal-dark);
    background: var(--cyan);
    font-weight: 900;
}

.appointment-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
    gap: 40px;
    align-items: start;
}

.contact-mini {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    color: var(--navy);
    font-weight: 700;
}

.public-form,
.stacked-form,
.form-grid {
    display: grid;
    gap: 16px;
}

.public-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    background: var(--white);
    box-shadow: var(--shadow);
}

label {
    display: grid;
    gap: 7px;
    color: var(--navy-soft);
    font-size: 0.88rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--navy);
    background: var(--white);
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(7, 141, 177, 0.12);
}

.full-field {
    grid-column: 1 / -1;
}

.site-footer {
    padding: 44px 0 18px;
    border-top: 1px solid var(--line);
    background: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1fr 1fr;
    gap: 36px;
}

.footer-grid h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.footer-grid p,
.footer-grid a {
    display: block;
    margin: 0 0 8px;
    color: var(--gray);
}

.footer-bottom {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
}

.alert {
    grid-column: 1 / -1;
    border-radius: var(--radius);
    padding: 13px 15px;
    font-weight: 700;
}

.alert-success {
    color: #0f6b43;
    background: var(--mint);
}

.alert-danger {
    color: #9d2d2d;
    background: #fff0f0;
}

.alert-warning {
    color: #785100;
    background: #fff6df;
}

.text-link {
    color: var(--teal);
    font-weight: 800;
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(120deg, var(--surface), var(--cyan));
}

.login-shell {
    display: grid;
    min-height: 100vh;
    width: min(980px, calc(100% - 40px));
    grid-template-columns: minmax(300px, 450px) minmax(260px, 1fr);
    align-items: center;
    gap: 24px;
    margin: 0 auto;
    padding: 40px 0;
}

.login-card {
    padding: 34px;
}

.login-heading {
    margin: 32px 0 24px;
}

.login-heading h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.login-heading p {
    margin: 0;
    color: var(--gray);
}

.login-panel {
    min-height: 420px;
    padding: 34px;
    color: var(--white);
    background: linear-gradient(145deg, var(--teal), var(--navy));
}

.login-panel p,
.login-panel span {
    color: rgba(255, 255, 255, 0.82);
}

.login-panel strong {
    display: block;
    margin: 18px 0;
    font-size: 2rem;
    line-height: 1.1;
}

.admin-page {
    background: var(--surface);
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: 258px;
    height: 100vh;
    flex: 0 0 258px;
    border-right: 1px solid var(--line);
    padding: 24px 18px;
    background: var(--white);
}

.brand-sidebar {
    margin-bottom: 34px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a,
.sidebar-group > a {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius);
    padding: 0 12px;
    color: var(--navy-soft);
    font-weight: 700;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-group > a.active,
.sidebar-group > a:hover {
    color: var(--white);
    background: var(--teal);
}

.nav-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: rgba(7, 141, 177, 0.12);
    color: inherit;
    font-size: 0.7rem;
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon,
.sidebar-group > a.active .nav-icon,
.sidebar-group > a:hover .nav-icon {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-group {
    display: grid;
    gap: 6px;
}

.sidebar-subnav {
    display: grid;
    gap: 4px;
    margin-left: 40px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.sidebar-subnav a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.86rem;
}

.sidebar-user {
    position: absolute;
    right: 18px;
    bottom: 24px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.sidebar-user > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--teal);
    font-weight: 900;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user small {
    color: var(--muted);
}

.admin-main {
    width: calc(100% - 258px);
    padding: 28px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-topbar h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    min-height: 150px;
    padding: 22px;
}

.metric-card p {
    margin: 16px 0 4px;
}

.metric-card strong {
    font-size: 2rem;
}

.metric-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--teal);
    font-weight: 900;
}

.metric-icon.pending {
    background: var(--amber);
}

.metric-icon.patients {
    background: var(--green);
}

.metric-icon.month {
    background: var(--blue);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.35fr);
    gap: 20px;
}

.panel {
    padding: 22px;
}

.wide-panel {
    grid-column: span 1;
}

.care-panel {
    color: var(--white);
    background: linear-gradient(145deg, var(--teal), var(--navy));
}

.care-panel h2,
.care-panel p,
.care-panel .eyebrow {
    color: var(--white);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.form-panel {
    align-self: start;
}

.narrow-panel {
    max-width: 720px;
}

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

.compact-form {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    width: min(620px, 88vw);
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
}

.form-hint {
    margin: -4px 0 18px;
    color: var(--teal-dark);
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 16px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

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

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.row-actions summary {
    color: var(--teal);
    cursor: pointer;
    font-weight: 800;
}

.inline-action-form {
    margin-top: 10px;
}

.status-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    padding: 0 9px;
    color: var(--navy);
    background: var(--line-soft);
    font-size: 0.76rem;
    font-weight: 900;
}

.status-confirmado {
    color: #0f6b43;
    background: #dff7ec;
    border-color: #bfe8d4;
}

.status-pendente {
    color: #8b5d00;
    background: #fff0c8;
    border-color: #f5d587;
}

.status-retorno {
    color: #195fb7;
    background: #e2eeff;
    border-color: #bfd8ff;
}

.status-cancelado {
    color: #9d2d2d;
    background: #ffe3e3;
    border-color: #ffc6c6;
}

.status-bloqueado,
.status-default {
    color: #505b6d;
    background: #e8edf2;
    border-color: #d5dee7;
}

.schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.date-actions,
.date-picker-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--navy);
    background: var(--white);
    font-weight: 900;
}

.icon-button.small {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
}

.appointment-form {
    margin-bottom: 0;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
    gap: 16px;
    margin-top: 20px;
    overflow: visible;
    padding-bottom: 12px;
}

.kanban-column {
    min-height: 320px;
    padding: 14px;
    background: #fbfdff;
}

.kanban-column header {
    display: flex;
    min-height: 54px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.kanban-column header strong,
.kanban-column header span {
    display: block;
}

.kanban-column header span {
    color: var(--muted);
    font-size: 0.82rem;
    text-align: right;
}

.lunch-column {
    background: #f4f7fa;
}

.lunch-box {
    display: grid;
    min-height: 182px;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--muted);
    text-align: center;
}

.lunch-box span {
    width: 42px;
    height: 42px;
    background: var(--line);
}

.lunch-box span::before,
.lunch-box span::after {
    content: "";
    position: absolute;
    background: var(--muted);
}

.lunch-box span::before {
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 4px;
    border-radius: 999px;
}

.lunch-box span::after {
    left: 16px;
    top: 10px;
    width: 10px;
    height: 12px;
    border-radius: 4px;
}

.empty-slot {
    display: grid;
    min-height: 116px;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--muted);
}

.empty-slot p {
    margin: 0 0 10px;
}

.appointment-card {
    display: grid;
    gap: 11px;
    margin-bottom: 12px;
    border-left: 4px solid currentColor;
    padding: 14px;
    box-shadow: none;
}

.appointment-card.dragging {
    opacity: 0.55;
}

.appointment-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.appointment-card-top > span:last-child {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.appointment-card h3 {
    margin: 0;
    color: var(--navy);
    font-size: 1.05rem;
}

.appointment-card p,
.appointment-card small {
    margin: 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.card-actions select {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.82rem;
}

.appointment-card-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.record-summary {
    display: grid;
    gap: 4px;
    border: 1px solid var(--cyan-strong);
    border-radius: var(--radius);
    padding: 10px;
    color: var(--teal-dark);
    background: var(--cyan);
}

.record-summary strong {
    font-size: 0.78rem;
    text-transform: uppercase;
}

.record-summary span {
    color: var(--navy-soft);
    font-size: 0.86rem;
}

.app-dialog {
    width: min(860px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    color: var(--navy);
    background: var(--white);
    box-shadow: 0 24px 70px rgba(20, 38, 74, 0.28);
}

.app-dialog::backdrop {
    background: rgba(20, 38, 74, 0.36);
    backdrop-filter: blur(3px);
}

.dialog-close-form {
    position: absolute;
    top: 14px;
    right: 14px;
}

.dialog-heading {
    display: grid;
    gap: 8px;
    margin: 0 44px 20px 0;
}

.dialog-heading h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 2rem);
}

.dialog-heading span {
    color: var(--gray);
    font-weight: 700;
}

.modal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-list {
    display: grid;
    gap: 10px;
    max-height: 220px;
    overflow: auto;
    margin-bottom: 18px;
}

.history-list article,
.patient-history article {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface);
}

.history-list strong,
.patient-history strong,
.patient-history span {
    display: block;
}

.history-list p,
.patient-history p {
    margin: 6px 0 0;
    color: var(--gray);
}

.patient-history {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.patient-history h3 {
    margin: 0;
    font-size: 1rem;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 4px 0 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--white);
}

.legend-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 0.86rem;
    font-weight: 700;
}

.legend-row i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.password-meter {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.password-meter span {
    height: 7px;
    border-radius: 999px;
    background: var(--line);
}

.password-meter.level-1 span:nth-child(-n + 1),
.password-meter.level-2 span:nth-child(-n + 2) {
    background: var(--red);
}

.password-meter.level-3 span:nth-child(-n + 3) {
    background: var(--amber);
}

.password-meter.level-4 span:nth-child(-n + 4),
.password-meter.level-5 span:nth-child(-n + 5) {
    background: var(--green);
}

.settings-list {
    display: grid;
    gap: 14px;
}

.settings-list div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface);
}

.settings-list span,
.settings-list strong {
    display: block;
}

.settings-list span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

@media (max-width: 1120px) {
    .service-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .content-grid,
    .appointment-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .public-schedule-heading {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .public-kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .container {
        width: min(100% - 28px, 680px);
    }

    .nav-actions {
        display: none;
    }

    .mobile-login-link {
        display: block;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        top: 72px;
        right: 14px;
        left: 14px;
        display: none;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 12px;
        background: var(--white);
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: grid;
        gap: 8px;
    }

    .main-nav a {
        padding: 10px 12px;
        border-radius: var(--radius);
    }

    .hero-section,
    .hero-content {
        min-height: auto;
    }

    .hero-image {
        opacity: 0.42;
        object-position: 62% center;
    }

    .hero-overlay {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.78));
    }

    .hero-content {
        grid-template-columns: 1fr;
        padding: 48px 0 38px;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .schedule-card {
        justify-self: start;
    }

    .service-grid,
    .testimonial-grid,
    .about-highlights,
    .footer-grid,
    .public-form,
    .form-grid,
    .login-shell {
        grid-template-columns: 1fr;
    }

    .full-field {
        grid-column: auto;
    }

    .admin-shell {
        display: block;
    }

    .sidebar-toggle {
        position: fixed;
        right: 16px;
        bottom: 16px;
        z-index: 90;
        display: inline-flex;
        box-shadow: var(--shadow);
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 80;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow);
    }

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

    .admin-main {
        width: 100%;
        padding: 18px 14px 82px;
    }

    .admin-topbar,
    .schedule-toolbar,
    .date-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .date-picker-form {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .login-panel {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .hero-copy h1 {
        font-size: 2.35rem;
    }

    .hero-actions,
    .date-picker-form,
    .search-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .public-kanban-board {
        grid-template-columns: 1fr;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .app-dialog {
        width: calc(100vw - 18px);
        max-height: calc(100vh - 18px);
        padding: 18px;
    }

    .dialog-heading {
        margin-right: 38px;
    }

    .panel,
    .public-form,
    .login-card,
    .login-panel {
        padding: 18px;
    }
}
