:root {
    --ink: #243334;
    --muted: #687576;
    --paper: #fffdf9;
    --soft: #f5eadf;
    --warm: #c8795c;
    --warm-dark: #8f4d3d;
    --sage: #7f988f;
    --sage-dark: #496a61;
    --line: #e6d8ce;
    --white: #ffffff;
    --shadow: 0 20px 60px rgba(52, 46, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Inter", Arial, sans-serif;
    line-height: 1.6;
}

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

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

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px clamp(18px, 5vw, 72px);
    background: rgba(255, 253, 249, 0.9);
    border-bottom: 1px solid rgba(230, 216, 206, 0.8);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--white);
    background: var(--warm-dark);
    border-radius: 8px;
    font-size: 0.9rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 3vw, 34px);
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.nav a:hover {
    color: var(--warm-dark);
}

.profile-menu {
    position: relative;
    margin-left: 16px;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 4px;
}

.notification-menu {
    position: relative;
}

.notification-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
}

.notification-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.notification-icon svg {
    width: 100%;
    height: 100%;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--warm-dark);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 800;
}

.notification-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    display: grid;
    gap: 10px;
    width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.notification-heading {
    margin: 0;
    font-weight: 800;
}

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

.notification-item {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: inherit;
    text-align: left;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.notification-item:hover {
    border-color: #d6b9aa;
    background: #fff7f0;
}

.notification-title {
    font-size: 0.94rem;
}

.notification-item p,
.notification-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.notification-meta {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.history-item-highlight {
    border-color: var(--warm);
    box-shadow: 0 0 0 3px rgba(200, 121, 92, 0.18);
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 4px 8px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--white);
    background: var(--sage-dark);
    font-size: 0.85rem;
}

.profile-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    display: grid;
    min-width: 170px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.profile-dropdown a,
.profile-dropdown button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background: var(--soft);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--ink);
}

.hero {
    position: relative;
    min-height: 92vh;
    display: grid;
    align-items: end;
    overflow: hidden;
    padding: 130px clamp(18px, 5vw, 72px) 78px;
}

.hero-image,
.hero-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    object-fit: cover;
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(20, 31, 31, 0.72), rgba(20, 31, 31, 0.26) 56%, rgba(20, 31, 31, 0.08)),
        linear-gradient(0deg, rgba(20, 31, 31, 0.38), rgba(20, 31, 31, 0.06));
}

.hero-content {
    position: relative;
    max-width: 760px;
    color: var(--white);
}

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

.hero .eyebrow {
    color: #ffd6c2;
}

h1,
h2 {
    margin: 0;
    font-family: "Libre Baskerville", Georgia, serif;
    line-height: 1.08;
}

h1 {
    max-width: 730px;
    font-size: clamp(2.4rem, 6vw, 5.6rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.7rem);
}

h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.page-shell {
    padding-top: 88px;
}

.page-title {
    color: var(--ink);
    font-size: clamp(2.3rem, 5vw, 4.7rem);
}

.panel-title {
    margin: 0 0 8px;
    font-family: "Inter", Arial, sans-serif;
    font-size: 1.18rem;
    line-height: 1.25;
}

.hero-text {
    max-width: 600px;
    margin: 22px 0 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.08rem;
}

.hero-actions,
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.primary {
    color: var(--white);
    background: var(--warm-dark);
}

.secondary {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.08);
}

.secondary-dark {
    color: var(--sage-dark);
    border-color: var(--sage);
    background: var(--white);
}

.intro-band,
.section {
    padding: clamp(54px, 8vw, 110px) clamp(18px, 5vw, 72px);
}

.intro-band {
    background: var(--soft);
}

.service-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    max-width: 1180px;
    margin: 0 auto;
    background: var(--line);
    border: 1px solid var(--line);
}

.service-strip article {
    min-height: 190px;
    padding: clamp(22px, 4vw, 34px);
    background: var(--paper);
}

.service-strip span {
    color: var(--warm-dark);
    font-weight: 800;
}

.service-strip h2 {
    margin-top: 18px;
    font-family: "Inter", Arial, sans-serif;
    font-size: 1.3rem;
}

.section {
    max-width: 1320px;
    margin: 0 auto;
}

.dentist-section,
.contact-section {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
    gap: clamp(34px, 7vw, 90px);
    align-items: center;
}

.section-copy p,
.section-heading p {
    max-width: 620px;
    color: var(--muted);
}

.dentist-portrait {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dentist-portrait img {
    width: 100%;
    height: min(620px, 72vh);
    object-fit: cover;
}

.contact-section {
    border-top: 1px solid var(--line);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.contact-grid article,
.panel,
.admin-login {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.contact-grid article {
    padding: 20px;
}

.contact-grid p,
.footer p,
.form-note {
    color: var(--muted);
}

.contact-form,
.admin-login {
    display: grid;
    gap: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #d9c9bf;
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(200, 121, 92, 0.22);
    border-color: var(--warm);
}

input:disabled,
textarea:disabled,
select:disabled {
    color: #889495;
    background: #f1eeea;
    border-color: #ddd0c6;
    cursor: not-allowed;
}

.patient-section,
.admin-section {
    border-top: 1px solid var(--line);
}

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

.patient-layout,
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

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

.panel {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 24px;
}

.form-note {
    margin: 0;
    font-size: 0.9rem;
}

.dashboard,
.admin-dashboard {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.dashboard-header {
    justify-content: space-between;
    margin-bottom: 22px;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--warm-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.admin-login {
    max-width: 720px;
    box-shadow: none;
}

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

.admin-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.admin-filters .button {
    min-height: 44px;
    width: 100%;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.filter-actions .button {
    width: auto;
    min-width: 110px;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.92rem;
}

.admin-filters label {
    min-width: 0;
}

.admin-filters input,
.admin-filters select {
    min-width: 0;
}

.result-count {
    margin: 0 0 12px;
    color: var(--muted);
    font-weight: 800;
}

.consulta-item,
.history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.admin-list .consulta-item {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.consulta-item .reply-form {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.consulta-item .reply-form textarea {
    min-height: 90px;
}

.consulta-item p,
.history-item p {
    margin: 6px 0 0;
    color: var(--muted);
}

.consulta-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.inline-field {
    display: grid;
    gap: 7px;
    min-width: 240px;
    flex: 0 1 280px;
}

.admin-list .consulta-actions {
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.admin-list .consulta-actions .button {
    min-width: 156px;
    min-height: 44px;
    padding-inline: 18px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.pagination span {
    color: var(--muted);
    font-weight: 800;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.history-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

.patient-section .section-heading,
.patient-section .dashboard,
.patient-section .history-layout {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.admin-sections {
    display: grid;
    gap: 20px;
    margin-top: 18px;
}

.admin-view-tabs {
    display: flex;
    gap: 12px;
    margin: 10px 0 18px;
    flex-wrap: wrap;
}

.admin-view-tabs .button {
    min-width: 150px;
}

.patient-view-tabs {
    margin-bottom: 20px;
}

.patient-history-panels {
    display: grid;
    gap: 16px;
}

.patient-filters {
    margin-bottom: 14px;
}

.history-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.history-heading {
    margin-bottom: 16px;
}

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

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--soft);
    color: var(--warm-dark);
    font-size: 0.86rem;
    font-weight: 800;
}

.hidden {
    display: none !important;
}

.footer {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 34px;
    padding: 48px clamp(18px, 5vw, 72px) 28px;
    border-top: 1px solid var(--line);
    background: #f7f1eb;
}

.footer h2,
.footer h3 {
    margin: 0 0 10px;
}

.copyright {
    grid-column: 1 / -1;
    margin: 18px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.toast {
    position: fixed;
    top: 92px;
    left: 50%;
    z-index: 40;
    max-width: min(380px, calc(100vw - 36px));
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--white);
    background: var(--sage-dark);
    box-shadow: var(--shadow);
    transform: translate(-50%, -140%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

@media (max-width: 920px) {
    .nav-toggle {
        display: block;
    }

    .nav {
        position: absolute;
        top: 74px;
        right: 18px;
        display: none;
        flex-direction: column;
        width: min(280px, calc(100vw - 36px));
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--white);
        box-shadow: var(--shadow);
    }

    .nav.open {
        display: flex;
    }

    .nav-visible {
        position: static;
        display: flex;
        flex-direction: row;
        width: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .hero {
        min-height: 86vh;
    }

    .service-strip,
    .dentist-section,
    .contact-section,
    .patient-layout,
    .dashboard-grid,
    .history-layout,
    .footer {
        grid-template-columns: 1fr;
    }

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

    .consulta-item {
        grid-template-columns: 1fr;
    }

    .admin-filters {
        grid-template-columns: 1fr;
    }

    .pagination {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 14px 16px;
    }

    .brand span:last-child {
        display: none;
    }

    .profile-name {
        display: none;
    }

    .hero {
        padding: 112px 18px 60px;
    }

    .hero-actions,
    .button {
        width: 100%;
    }

    .section,
    .intro-band {
        padding-left: 18px;
        padding-right: 18px;
    }

    .panel,
    .contact-form,
    .admin-login {
        padding: 18px;
    }
}
