.m-nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    flex-shrink: 1;
    min-width: 0;
}

.m-nav-menu li {
    margin-bottom: 0;
    flex-shrink: 0;
}

.m-nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    display: block;
    position: relative;
}

.m-nav-menu a.is-active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--secondary-color);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
    opacity: 0.9;
}

.m-dashboard {
    background-color: var(--white);
    padding: 1.75rem 2rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary-color);
}

.m-dashboard p {
    color: var(--muted-color);
    font-size: 1.1rem;
    font-weight: 400;
}

.m-dashboard strong {
    color: var(--primary-color);
    font-weight: 600;
}

.m-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.m-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.m-card h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.m-card p {
    color: var(--muted-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.m-card ul,
.m-card ol {
    color: var(--muted-color);
    font-size: 0.95rem;
    padding-left: 1.5rem;
}

.m-card li {
    margin-bottom: 0.5rem;
}

.m-card strong {
    color: var(--primary-color);
    font-weight: 600;
}

.m-card em {
    color: var(--primary-color);
    font-style: italic;
    font-weight: 500;
}

.m-card del {
    color: var(--danger-color);
    text-decoration: line-through;
}

.m-card ins {
    color: var(--success-color);
    text-decoration: none;
    font-weight: 500;
}

/* Module: Grid */
.m-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}

.m-grid--patients {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.m-grid--doctors {
    grid-template-columns: 1fr 1fr;
}

.m-grid--schedule {
    grid-template-columns: 2fr 1fr;
}

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

.m-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.m-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
    background-color: var(--light-color);
}

.m-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.m-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.m-service-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.m-service-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.m-service-description {
    color: var(--muted-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
}

.m-service-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.m-service-price {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.m-service-price strong {
    color: var(--secondary-color);
    font-weight: 600;
}

.m-service-duration {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.m-service-specialty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--light-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    align-self: flex-start;
}

/* Tabs */
.m-inventory-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.m-tab-button {
    padding: 0.875rem 2rem;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--muted-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    position: relative;
    top: 2px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.m-tab-button:hover {
    color: var(--primary-color);
    background: var(--light-color);
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
}

.m-tab-button.is-active {
    color: var(--secondary-color);
    background: var(--white);
    border-color: var(--secondary-color);
    border-bottom-color: var(--white);
    font-weight: 600;
    box-shadow: 0 -4px 8px rgba(52, 152, 219, 0.15);
    z-index: 1;
}

.m-tab-button.is-active:hover {
    transform: translateY(0);
    box-shadow: 0 -4px 8px rgba(52, 152, 219, 0.15);
}

/* Modal overlay: centers one panel (use with .m-modal-content inside) */
.m-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 1rem;
}

/* Full-screen flex layer (legacy; prefer .m-modal-overlay + .m-modal-content) */
.m-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 1rem;
}

.m-slot-booking-highlight {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--light-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.m-modal-content {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.m-modal-content h3 {
    margin-bottom: 1.5rem;
}

.m-modal-content label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
}

.m-modal-content label > * {
    margin-top: 0.5rem;
}

/* Audit styles */
.m-audit-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.m-audit-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.m-audit-table-wrapper {
    overflow-x: auto;
}

.m-audit-diff {
    font-size: 0.875rem;
    color: var(--muted-color);
    max-width: 300px;
    word-break: break-word;
}

/* Inventory styles */
.m-inventory-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.m-inventory-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.m-inventory-stock-wrapper,
.m-inventory-movement-wrapper {
    overflow-x: auto;
}

.m-row-warning {
    background-color: #fff3cd !important;
}

.m-status-ok {
    background-color: var(--success-color);
    color: var(--white);
}

.m-status-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.m-button--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.m-inventory-operations {
    margin-top: 1rem;
}

.m-table {
    display: grid;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1rem;
    width: 100%;
}

.m-table thead {
    display: contents;
}

.m-table tbody {
    display: contents;
}

.m-table tr {
    display: grid;
    grid-column: 1 / -1;
}

.m-table thead tr {
    grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.m-table tbody tr {
    grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.m-table.m-table--services thead tr,
.m-table.m-table--services tbody tr {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.m-table.m-table--doctors thead tr,
.m-table.m-table--doctors tbody tr {
    grid-template-columns: 2fr 1fr 2fr 1.5fr 1fr;
}

.m-table th,
.m-table td {
    padding: 1rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.m-table th:last-child,
.m-table td:last-child {
    border-right: none;
}

.m-table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    text-align: left;
}

.m-table tbody tr:nth-child(even) {
    background-color: var(--light-color);
}

.m-table tbody tr:nth-child(odd) {
    background-color: var(--white);
}

.m-table tbody tr:last-child td {
    border-bottom: none;
}

.m-aside {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.m-aside h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.m-aside ul {
    color: var(--muted-color);
    font-size: 0.95rem;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.m-aside li {
    margin-bottom: 0.5rem;
}

.m-aside strong {
    color: var(--primary-color);
    font-weight: 600;
}

.m-aside em {
    color: var(--text-muted);
    font-style: italic;
}

.m-blockquote {
    background-color: var(--light-color);
    border-left: 4px solid var(--secondary-color);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 5px 5px 0;
}

.m-blockquote p {
    color: var(--muted-color);
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.m-blockquote cite {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: normal;
}

/* Module: Code */
.m-code {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.m-code code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    line-height: 1.4;
}

/* Module: Button */
.m-button {
    font-family: inherit;
    font-size: inherit;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    background-color: var(--secondary-color);
    color: var(--white);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Module: Form */
.m-input,
.m-textarea,
.m-select {
    font-family: inherit;
    font-size: inherit;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--white);
}

/* Utility classes */
.u-text-center {
    text-align: center;
}

.u-text-uppercase {
    text-transform: uppercase;
}

.u-text-lowercase {
    text-transform: lowercase;
}

.u-text-capitalize {
    text-transform: capitalize;
}

.u-font-weight-light {
    font-weight: 300;
}

.u-font-weight-normal {
    font-weight: 400;
}

.u-font-weight-medium {
    font-weight: 500;
}

.u-font-weight-bold {
    font-weight: 700;
}

.u-text-decoration-underline {
    text-decoration: underline;
}

.u-text-decoration-line-through {
    text-decoration: line-through;
}

.u-text-decoration-none {
    text-decoration: none;
}

/* Module: Appointment Form */
.m-appointment-form {
    max-width: 800px;
    margin: 2rem 0;
}

.m-form-group {
    margin-bottom: 1.5rem;
}

.m-form-label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.m-form-required {
    color: var(--danger-color);
}

.m-input,
.m-textarea,
.m-select {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.m-input:focus,
.m-textarea:focus,
.m-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.m-input.is-invalid,
.m-textarea.is-invalid,
.m-select.is-invalid {
    border-color: var(--danger-color);
}

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

/**
 * CRM shell (Vue pages): inputs without explicit .m-input / .m-select / .m-textarea
 * inherit Inter, body font-size, and the same borders as themed form controls.
 */
.l-main-content [id$="-app"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="reset"]),
.l-main-content [id$="-app"] select,
.l-main-content [id$="-app"] textarea {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--white);
    color: var(--primary-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.l-main-content [id$="-app"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.l-main-content [id$="-app"] select:focus,
.l-main-content [id$="-app"] textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.l-main-content [id$="-app"] input[type="file"] {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
    padding: 0.5rem 0;
    max-width: 100%;
}

.l-main-content [id$="-app"] .m-form label,
.l-main-content [id$="-app"] form label,
.l-main-content [id$="-app"] .m-tab-content p > label,
.l-main-content [id$="-app"] .m-card p > label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    line-height: 1.5;
}

/**
 * MVC (Thymeleaf): forms under `.m-dashboard` / `form.m-card` (no `*-app` wrapper).
 * Same control chrome as Vue pages so raw inputs match the rest of the CRM shell.
 */
.l-main-content .m-dashboard input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="reset"]),
.l-main-content .m-dashboard select,
.l-main-content .m-dashboard textarea {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--white);
    color: var(--primary-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.l-main-content .m-dashboard input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.l-main-content .m-dashboard select:focus,
.l-main-content .m-dashboard textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.l-main-content .m-dashboard input[type="file"] {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
    padding: 0.5rem 0;
    max-width: 100%;
}

.l-main-content .m-dashboard form label,
.l-main-content .m-dashboard .m-card p > label,
.l-main-content .m-dashboard fieldset label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    line-height: 1.5;
}

.l-main-content .m-dashboard fieldset.m-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem 1.25rem;
    margin: 1rem 0;
}

.l-main-content .m-dashboard fieldset.m-section legend {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 0.35rem;
}

/* MVC dashboard: page title */
.l-main-content .m-dashboard > h2 {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* MVC forms: single column, comfortable row spacing */
.l-main-content .m-dashboard form.m-card,
.l-main-content .m-dashboard form.m-section {
    max-width: 42rem;
    padding: 1.5rem 1.75rem;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}

.l-main-content .m-dashboard form p {
    margin: 0 0 1.15rem;
}

.l-main-content .m-dashboard form fieldset p {
    margin-bottom: 0.65rem;
}

.l-main-content .m-dashboard form p:last-child {
    margin-bottom: 0;
}

/* Stack label text above control; hide <br> spacing (templates still use <br>) */
.l-main-content .m-dashboard form p > label br {
    display: none;
}

.l-main-content .m-dashboard form p > label {
    display: block;
    line-height: 1.4;
}

.l-main-content .m-dashboard form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="reset"]),
.l-main-content .m-dashboard select,
.l-main-content .m-dashboard textarea {
    max-width: min(100%, 36rem);
    width: 100%;
}

/* Checkbox rows: label stays horizontal */
.l-main-content .m-dashboard form p > label:has(input[type="checkbox"]:first-child) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.l-main-content .m-dashboard form fieldset label:has(input[type="checkbox"]) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Hint / notice paragraphs outside fieldsets */
.l-main-content .m-dashboard > p.m-section {
    max-width: 42rem;
    padding: 0.65rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
    border-radius: 8px;
    background: var(--light-color);
    border: 1px dashed var(--border-color);
    color: var(--muted-color);
}

.l-main-content .m-dashboard form p.m-section {
    padding: 0.65rem 0.85rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    border-radius: 8px;
    background: rgba(52, 152, 219, 0.06);
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: var(--muted-color);
}

/* Form actions: primary + secondary, not tab chrome */
.l-main-content .m-dashboard form p:has(> button.m-tab-button),
.l-main-content .m-dashboard form p:has(> a.m-tab-button) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/**
 * `.m-tab-button` is tab-shaped elsewhere; inside `.m-dashboard` it is used as a plain action.
 */
.l-main-content .m-dashboard .m-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    margin: 0;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--white);
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    position: static;
    top: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
        box-shadow 0.2s ease, transform 0.15s ease;
}

.l-main-content .m-dashboard .m-tab-button:hover {
    color: var(--primary-color);
    background: var(--light-color);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.l-main-content .m-dashboard .m-tab-button.is-active {
    border-radius: 8px;
    border-bottom-width: 2px;
    margin-bottom: 0;
    top: auto;
}

.l-main-content .m-dashboard form button.m-tab-button[type="submit"] {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
}

.l-main-content .m-dashboard form button.m-tab-button[type="submit"]:hover {
    background: rgb(41, 128, 185);
    border-color: rgb(41, 128, 185);
    color: var(--white);
}

.l-main-content .m-dashboard form a.m-tab-button {
    background: var(--white);
    color: var(--primary-color);
}

.l-main-content .m-dashboard #mvc-del.m-tab-button {
    border-color: var(--danger-color);
    color: var(--white);
    background: var(--danger-color);
}

.l-main-content .m-dashboard #mvc-del.m-tab-button:hover {
    background: rgb(192, 57, 43);
    border-color: rgb(192, 57, 43);
    color: var(--white);
}

/* List pages: lone Add link right under the heading */
.l-main-content .m-dashboard > h2 + p > a.m-tab-button:only-child {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
}

.l-main-content .m-dashboard > h2 + p > a.m-tab-button:only-child:hover {
    background: rgb(41, 128, 185);
    border-color: rgb(41, 128, 185);
    color: var(--white);
}

/* Detail / list toolbars: direct child <p> whose first control is a link (not form rows; those use <button> first) */
.l-main-content .m-dashboard > p:has(> a.m-tab-button:first-child) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.l-main-content .m-dashboard > p > a.m-tab-button:not(:only-child) {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--border-color);
}

.l-main-content .m-dashboard > p > a.m-tab-button:not(:only-child):hover {
    background: var(--light-color);
}

.l-main-content .m-dashboard > p > a.m-tab-button:not(:only-child) + a.m-tab-button {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.m-form-error {
    display: none;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.m-button {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    background-color: var(--secondary-color);
    color: var(--white);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: 500;
}

.m-button:hover {
    background-color: rgb(41, 128, 185);
    transform: translateY(-1px);
}

.m-button:active {
    transform: translateY(0);
}

.m-button--edit {
    background-color: var(--warning-color);
}

.m-button--edit:hover {
    background-color: rgb(230, 126, 34);
}

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

.m-button--delete:hover {
    background-color: rgb(192, 57, 43);
}

/* Module: Appointment List */
.m-appointment-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.m-appointment-empty {
    text-align: center;
    color: var(--muted-color);
    font-style: italic;
    padding: 2rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.m-appointment-item {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.m-appointment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.m-appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.m-appointment-author {
    flex: 1;
    min-width: 200px;
}

.m-appointment-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.25rem 0;
}

.m-appointment-email {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.m-appointment-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.m-appointment-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.m-appointment-content {
    margin-bottom: 1rem;
}

.m-appointment-message {
    color: var(--primary-color);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}


.m-appointment-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.m-appointment-actions .m-button {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.m-appointment-service,
.m-appointment-doctor,
.m-appointment-datetime,
.m-appointment-phone {
    color: var(--primary-color);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.m-appointment-service strong,
.m-appointment-doctor strong,
.m-appointment-datetime strong,
.m-appointment-phone strong {
    color: var(--primary-color);
    font-weight: 600;
}

.m-status-new {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.m-status-confirmed {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--success-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.m-status-cancelled {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--danger-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Login page */
.l-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.m-login-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.m-login-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.m-login-error {
    background: #fee;
    color: var(--danger-color);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none;
}

.m-login-error.is-visible {
    display: block;
}

/* Patient booking page */
.m-public-hero {
    text-align: center;
    padding: 2rem 1rem;
}

.m-public-hero h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.m-booking-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .m-booking-grid {
        grid-template-columns: 1fr;
    }
}

.m-slot-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
}

.m-slot-card {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background: var(--white);
    transition: all 0.2s;
}

.m-slot-card:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.m-slot-card.is-busy {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f6f6f6;
}

.m-slot-card.is-selected {
    border-color: var(--secondary-color);
    background: #e8f4ff;
}

/* Patient online booking: one day, free vs busy (same idea as doctor schedule) */
.m-patient-day-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--muted-color, #666);
}

.m-patient-day-legend__item {
    padding-left: 1rem;
    position: relative;
}

.m-patient-day-legend__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
}

.m-patient-day-legend__item--free::before {
    background: #66bb6a;
}

.m-patient-day-legend__item--busy::before {
    background: #bdbdbd;
}

.m-patient-day-schedule {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: min(52vh, 28rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.m-patient-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.m-patient-slot--free {
    background: #e8f5e9;
    border-color: #a5d6a7;
    cursor: pointer;
}

.m-patient-slot--free:hover {
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
}

.m-patient-slot--busy {
    background: #f5f5f5;
    border-color: #e0e0e0;
    cursor: default;
    opacity: 0.95;
}

.m-patient-slot--selected.m-patient-slot--free {
    border-color: var(--secondary-color, #1976d2);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
    background: #e3f2fd;
}

.m-patient-slot-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.m-patient-slot-time {
    font-weight: 600;
    font-size: 0.95rem;
}

.m-patient-slot-room {
    font-size: 0.8rem;
    color: var(--muted-color, #666);
}

.m-patient-slot-status {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.m-patient-slot-status--free {
    color: #2e7d32;
}

.m-patient-slot-status--busy {
    color: #c62828;
}

.m-patient-slot-dot {
    font-size: 0.55rem;
    line-height: 1;
    color: #c62828;
}

.m-info-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Tabs */
.m-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.m-tab-content {
    padding: 1.5rem 0;
}

/* Form Grid */
.m-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.m-form-group--full {
    grid-column: 1 / -1;
}

.m-form-value {
    padding: 0.5rem;
    background: var(--light-color);
    border-radius: 4px;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

/* Lock Banner */
.m-lock-banner {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.m-lock-banner p {
    margin: 0;
    color: #856404;
}

/* Signature Status */
.m-signature-status {
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.m-status-signed {
    color: var(--success-color);
    font-weight: 600;
}

.m-status-not-signed {
    color: var(--danger-color);
    font-weight: 600;
}

/* Icons */
.m-icons-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.m-icon-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.m-icon-checkbox:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
}

.m-icon-checkbox input[type="checkbox"] {
    margin: 0;
}

.m-icon-emoji {
    font-size: 1.5rem;
}

.m-icon-label {
    font-size: 0.9rem;
}

/* Timeline */
.m-timeline {
    position: relative;
    padding-left: 2rem;
}

.m-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.m-timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.m-timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.m-timeline-content {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
}

.m-timeline-content p {
    margin: 0.25rem 0;
}

/* File Items */
.m-file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.m-file-item p {
    margin: 0;
    flex: 1;
}

.m-file-upload {
    margin-top: 1rem;
}

/* Medical Sections */
.m-medical-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
}

.m-medical-section strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.m-medical-edit-form {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.m-diagnosis-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.m-diagnosis-item input {
    flex: 1;
}

/* Consent Items */
.m-consent-item {
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.m-consent-item p {
    margin: 0.25rem 0;
}

/* Audit Items */
.m-audit-item {
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.m-audit-item p {
    margin: 0.25rem 0;
}

/* History Stats */
.m-history-stats {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.m-history-stats p {
    margin: 0.5rem 0;
}

/* Form Actions */
.m-form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Patient Title Block */
.m-patient-title-block {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.m-patient-title-block h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Settings Page Styles */
.m-settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.m-settings-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    transition: all 0.2s;
}

.m-settings-tab:hover {
    background: var(--bg-hover);
}

.m-settings-tab.is-active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.m-settings-content {
    display: none;
}

.m-settings-content.is-active {
    display: block;
}

.m-settings-section {
    margin-bottom: 2rem;
}

.m-settings-section h3 {
    margin-bottom: 1rem;
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    visibility: visible;
}

/* Settings table - uses traditional table layout */
.m-settings-section .m-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    display: table;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.m-settings-section .m-table thead {
    display: table-header-group;
}

.m-settings-section .m-table tbody {
    display: table-row-group;
}

.m-settings-section .m-table tr {
    display: table-row;
}

.m-settings-section .m-table th,
.m-settings-section .m-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    display: table-cell;
}

.m-settings-section .m-table th:last-child,
.m-settings-section .m-table td:last-child {
    border-right: none;
}

.m-settings-section .m-table tbody tr:last-child td {
    border-bottom: none;
}

.m-settings-section .m-table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.m-settings-section .m-table tbody tr:nth-child(even) {
    background-color: var(--light-color);
}

.m-settings-section .m-table tbody tr:nth-child(odd) {
    background-color: var(--white);
}

.m-settings-section .m-table tr:hover {
    background-color: var(--light-color);
}

.m-settings-section .m-table thead th {
    display: table-cell !important;
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.m-settings-section .m-table thead th:last-child {
    border-right: none;
}

/* Settings modal - overrides default modal for visibility control */
.m-settings-section .m-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 1rem;
}

.m-settings-section .m-modal-content {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.m-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.m-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.m-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    background: var(--bg-secondary);
}

.m-badge.is-active {
    background: var(--success-color);
    color: white;
}

.m-badge.is-inactive {
    background: var(--muted-color);
    color: white;
}
