html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}


/* ── Login page ── */
.login-card {
    background-color: #0c331c;
    border-radius: 16px;
    padding: 40px 28px 32px;
    width: 420px;
    max-width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-paw-icon {
    font-size: 3.5rem;
    color: #bbb826;
    filter: drop-shadow(0 0 14px rgba(187,184,38,0.45));
}

.login-app-name {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #bbb826;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-subtitle {
    color: white;
    text-align: center;
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 600;
    opacity: 0.8;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    background-color: rgba(255,255,255,0.95);
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: #bbb826;
}

.login-btn-primary {
    width: 100%;
    padding: 13px;
    margin-top: 4px;
    background-color: #bbb826;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: filter 0.2s, transform 0.1s;
}

.login-btn-primary:hover {
    filter: brightness(1.1);
}

.login-btn-primary:active {
    transform: scale(0.98);
}

.login-error {
    color: #ff6b6b;
    text-align: center;
    margin: 0;
    font-size: 14px;
}

.login-register {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.login-register span {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
}

.login-btn-secondary {
    background: transparent;
    color: #bbb826;
    border: 2px solid #bbb826;
    padding: 9px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn-secondary:hover {
    background-color: rgba(187,184,38,0.12);
}

@media (max-width: 576px) {
    .login-card {
        border-radius: 0;
        width: 100vw;
        min-height: 100vh;
        padding: 0 24px;
        justify-content: center;
        box-shadow: none;
    }
}

/* EDIT HERE */
.top-row {
    -webkit-box-shadow: 0px 10px 13px -7px #000000, 5px 5px 15px 5px rgba(0, 0, 0, 0);
    border-bottom: 0 !important;
    z-index: 3000;
}

.emr-dark {

    height: 94px;
}

.navbar-brand {
    color: #b79f2d !important;
    background-color: white;
    padding: 20px;
    text-align: center;
    border-radius: 0px 0px 20px 20px;
    position: relative;
    bottom: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bolder;
    -webkit-box-shadow: 0px 10px 13px -7px #000000, 5px 5px 15px 5px rgba(0, 0, 0, 0);
}

.sidebar {
    webkit-box-shadow: 10px 0px 13px -7px #000000, -7px 21px 21px 11px rgba(0, 0, 0, 0);
    box-shadow: 10px 0px 13px -7px #000000, -7px 21px 21px 11px rgba(0, 0, 0, 0);
}

.signed-in-button {
    border: 2px solid #b79f2d;
    background-color: #b79f2d;
    color: white;
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    margin-left: 8px;
    margin-bottom: 0px;
}

.btn-primary:active {
    background-color: #193020 !important;
}

.btn-primary:focus {
    outline: #193020 !important;
    border-color: white !important;
    box-shadow: 0 0 0 .25rem rgb(3 104 16 / 50%) !important;

}

.btn-primary:focus {
    background-color: #193020 !important;
}

/* END */

:root {
    --pet-primary: #112818;
    /* default fallback */
    --pet-primary-dark: white;
    --pet-primary-light: #112818;
    --primary: #193020;
    --primary-hover: #193020 !important;
    --danger: #d13438;
    --danger-hover: #a80000;
    --surface: #ffffff;
    --background: #f3f2f1;
    --text-primary: #323130;
    --text-secondary: #605e5c;
    --border: #e1dfdd;
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}


/* Mar Page*/
/* Container for the vet docs section */
.vet-documents-section {
    margin-top: 1.5rem;
}

/* Each vet trip card */
.vet-trip-card {
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.vet-trip-card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.vet-trip-card h4 {
    margin: 0.25rem 0 0.75rem;
    font-size: 0.95rem;
    color: #666;
}

.documents-list {
    margin-top: 0.5rem;
}

/* Layout for file cards */
.documents-grid {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual file card */
.document-card {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Thumbnail area */
.document-thumb {
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-thumb-img {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Generic icon-style thumb */
.document-thumb-icon {
    width: 48px;
    height: 64px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pdf-icon {
    background: #fbe9e7;
    border-color: #f4511e;
    color: #c62828;
}

.file-icon {
    background: #e3f2fd;
    border-color: #1e88e5;
    color: #1565c0;
}

/* Info area */
.document-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.document-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
    word-break: break-all;
}

.document-meta {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.5rem;
}

/* Actions */
.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-doc {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 999px;
    border: none;
    text-decoration: none;
    background: #1976d2;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-doc.secondary {
    background: #eeeeee;
    color: #333;
}

/* PDF overlay */
.pdf-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-preview-dialog {
    background: #ffffff;
    border-radius: 8px;
    width: min(1000px, 95vw);
    padding: 0.5rem 0.75rem 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: relative;
}

.pdf-close-btn {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    position: absolute;
    top: 4px;
    right: 8px;
}

.mar-page-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16), 0 1px 0 rgba(148, 163, 184, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    border: 1px solid #e2e8f0;
}

/* Header */

.mar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.mar-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #a8a17a;
    color: #eed91a;
    border: 1px solid #ecd77a;
}

.mar-title {
    margin: 0.5rem 0 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
}

.mar-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    color: #64748b;
}

.mar-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.mar-pet-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
}

.mar-hour-chip {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: linear-gradient(135deg, #d8bc1d, #133f23);
    color: #ffffff;
}

/* Summary ribbon */

.mar-summary {
    display: flex;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.mar-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 90px;
}

.mar-summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 600;
}

.mar-summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

/* Layout */

.mar-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.mar-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mar-section-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.mar-section-header p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

/* Med cards */

.mar-med-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    align-items: flex-start;
}

.mar-med-card-prn {
    border-left: 3px solid #f97316;
}

.mar-med-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.2rem;
    cursor: pointer;
}

/* Hide default checkbox */
.mar-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mar-checkbox-custom {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 0.35rem;
    border: 1.8px solid #cbd5f5;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(224, 236, 166, 0.3);
    position: relative;
}

.mar-checkbox:checked+.mar-checkbox-custom {
    border-color: #c2c523;
    background: #c2c523;
    box-shadow: 0 0 0 3px rgba(221, 235, 146, 0.25);
}

.mar-checkbox:checked+.mar-checkbox-custom::after {
    content: "";
    position: absolute;
    inset: 2px 3px 3px 2px;
    border-radius: 0.25rem;
    border: 2px solid #ffffff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

/* Med content */

.mar-med-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mar-med-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.mar-med-details {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.mar-med-meta {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Chips */

.mar-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.mar-chip-primary {
    background: #e4db60;
    color: #fcfbfa;
    border: 1px solid #ebdc87;
}

.mar-chip-muted {
    background: #87a58c;
    color: #eaf0ec;
    border: 1px solid #e2e8f0;
}

.mar-chip-prn {
    background: #f97316;
    color: #ffffff;
}

.mar-med-card--locked {
    opacity: 0.55;
    pointer-events: none;
    background: #f1f5f9;
    filter: grayscale(0.4);
}

.mar-med-card-prn.mar-med-card--locked {
    border-left-color: #94a3b8;
}

.mar-chip-locked {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5f5;
    font-style: italic;
}

/* Empty state */

.mar-empty {
    margin: 0.5rem 0 0;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px dashed #cbd5f5;
    font-size: 0.85rem;
    color: #64748b;
}

/* Actions bar */

.mar-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.mar-actions .epic-pet-button {
    min-width: 130px;
}

/* Scoped button styling */

.mar-page-container .epic-pet-button {
    border-radius: 999px;
    padding: 0.55rem 1.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #d8bc1d, #133f23);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s ease-out, opacity 0.08s ease-out;
}

.mar-page-container .epic-pet-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.3);
    filter: brightness(1.03);
}

.mar-page-container .epic-pet-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 5px 12px rgba(37, 99, 235, 0.25);
}

.mar-page-container .epic-pet-button:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

.mar-page-container .epic-pet-button.epic-pet-button-outlined {
    background: rgba(33, 77, 53, 0.65) ;
    color: #ffffff;
    border: 1px solid #706209;
    box-shadow: none;
}

/* ── Unified Modal System ─────────────────────────────────────────────────
   .modal-overlay   → full-screen backdrop (all modals)
   .modal-container → white dialog box (MAR / Families inline modals)
   .modal-box       → white dialog box (AddMedication / AddVetTrip / Form)
   .modal-backdrop  → alias for .modal-overlay used by delete confirms
   .modal-content   → white dialog box used by delete confirms
   All use fixed centering, scroll on small screens, no magic offsets.
   ──────────────────────────────────────────────────────────────────────── */

.modal-overlay,
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(33, 77, 53, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-container,
.modal-box,
.modal-content {
    width: min(520px, 100%);
    background: #0e2817;
    color: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(107, 95, 180, 0.4);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.15s ease-out;
}

/* header strip */
.modal-box .modal-header,
.modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem 1rem 0 0;
}

.modal-box .modal-header h3,
.modal-content .modal-header h4,
.modal-container h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
}

/* body */
.modal-box .modal-body,
.modal-content .modal-body {
    padding: 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* container variant (MAR / Families — no explicit header element) */
.modal-container {
    padding: 1.5rem 1.75rem;
    gap: 0.75rem;
}

.modal-container p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* footer */
.modal-box .modal-footer,
.modal-content .modal-footer {
    padding: 0.9rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 0 1rem 1rem;
}

/* warning variant (delete confirm) */
.modal-content .modal-header.warning {
    background: rgba(255, 80, 80, 0.15);
    color: #fca5a5;
}

.hold-textarea {
    margin-top: 0.4rem;
    width: 100%;
    min-height: 110px;
    padding: 0.7rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5f5;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
    outline: none;
    background: #f8fafc;
}

.hold-textarea:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px #1d4ed8, 0 0 0 4px rgba(59, 130, 246, 0.25);
    background: #ffffff;
}

/* inputs/selects/labels inside purple modals */
.modal-box .modal-body input,
.modal-box .modal-body select,
.modal-box .modal-body textarea,
.modal-box .modal-body .form-control,
.modal-box .modal-body .form-select,
.modal-container input,
.modal-container select,
.modal-container textarea,
.modal-container .form-control,
.modal-container .form-select {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 6px;
}

.modal-box .modal-body input::placeholder,
.modal-box .modal-body textarea::placeholder,
.modal-container input::placeholder,
.modal-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.modal-box .modal-body input:focus,
.modal-box .modal-body select:focus,
.modal-box .modal-body textarea:focus,
.modal-container input:focus,
.modal-container select:focus,
.modal-container textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(107, 95, 180, 0.4);
    background: rgba(255, 255, 255, 0.18);
}

.modal-box .modal-body label,
.modal-box .modal-body .form-label,
.modal-container label {
    color: rgba(255, 255, 255, 0.85);
}

.modal-box .modal-body option,
.modal-container option {
    background: #0e2817;
    color: #fff;
}

.hold-textarea {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

.modal-buttons {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
}

/* Loading / error states */

.mar-state {
    max-width: 480px;
    margin: 4rem auto;
    padding: 2rem;
    border-radius: 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    text-align: center;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.16);
}

.mar-state-loading p,
.mar-state-error p {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: #64748b;
}

.mar-state-error h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #b91c1c;
}

.mar-spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 3px solid #e2e8f0;
    border-top-color: #1d4ed8;
    margin: 0 auto;
    animation: mar-spin 0.65s linear infinite;
}

@keyframes mar-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */

@media (max-width: 900px) {
    .mar-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .mar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mar-header-meta {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .mar-page-container {
        padding: 1.4rem 1.1rem;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }

    .mar-summary {
        flex-wrap: wrap;
    }

    .modal-container {
        padding: 1.25rem 1.2rem;
    }
}


.pet-profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* --- Header --- */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.profile-header h1 {
    margin: 0;
    font-size: 2rem;
    display: inline-block;
    margin-right: 1rem;
}

.badge.species {
    background-color: var(--pet-primary-light);
    color: var(--pet-primary-dark);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    vertical-align: middle;
}

.header-details {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
}

/* --- Layout Grid --- */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.photo-card {
    max-width: 250px
}

.edit-buttons-container {
    left: -63px;
}

/* ── Mobile: pet profile & pets table ── */
@media (max-width: 768px) {
    .profile-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .edit-buttons-container {
        left: 0;
    }

    /* Flatten profile-grid and profile-sidebar into pet-profile-container's
       flex context so we can use order freely across the whole page column */
    .pet-profile-container {
        display: flex;
        flex-direction: column;
        padding: 0.75rem !important;
    }

    .profile-grid    { display: contents; }
    .profile-sidebar { display: contents; }

    .photo-card          { order: 1; max-width: none; }
    .profile-header      { order: 2; }
    .tab-switcher-container { order: 3; }
    .profile-content     { order: 4; }
    .profile-sidebar > * { order: 5; }  /* buttons + conditions go last */
    /* photo-card is also a .profile-sidebar > * child — re-assert its order */
    .photo-card          { order: 1; }

    /* tables scroll horizontally instead of breaking layout */
    .table-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .content {
        max-width: 100vw !important;
        overflow-x: hidden;
    }

    .pet-page-pet {
        justify-content: center;
    }
}

/* ── Mobile: avatar tab ── */
@media (max-width: 640px) {
    .avatar-main {
        overflow: visible;
    }

    .avatar-container {
        /* Push the container so its center (300px in) sits at 50vw,
           then scale from that center — image and grid move together */
        margin-left: calc(50vw - 336px);
        transform-origin: top center;
        transform: scale(0.6);
        margin-bottom: -240px;
        /* 600px * (1 - 0.6) — reclaim layout space */
    }
}

/* ── Mobile: modals go full-width, body scrolls ── */
@media (max-width: 560px) {

    .modal-overlay,
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-container,
    .modal-box,
    .modal-content {
        width: 100%;
        border-radius: 1rem 1rem 0 0;
        max-height: 90dvh;
        overflow-y: auto;
    }
}

/* ── Mobile: form grids collapse to single column ── */
@media (max-width: 560px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: span 1;
    }

    .mar-page-container {
        padding: 1rem 0.75rem;
    }

    .mar-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .mar-actions .epic-pet-button {
        width: 100%;
    }

    .modal-container {
        width: 95vw !important;
        padding: 1rem !important;
    }

    .pet-profile-container {
        padding: 0.5rem !important;
    }

    /* shift selector on Brain page */
    .shift-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Sidebar / Photo --- */
.photo-card {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background-color: #f0f0f0;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Medication Content --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.medication-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Medication Card --- */
.med-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.med-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.med-card-header {
    background-color: var(--pet-primary);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.med-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--pet-primary-dark);
}

.med-dose {
    font-weight: 700;
    font-size: 0.9rem;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.med-card-body {
    padding: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.med-instructions {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #fafafa;
    padding: 0.5rem;
    border-radius: 4px;
    font-style: italic;
}

.med-card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* --- Forms (Inside Modal) --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: -1.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.checkbox-group {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--pet-primary-light);
    color: var(--pet-primary-light);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 1rem;

}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline-secondary {
    display: inline-block;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

.btn-icon-danger {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-icon-danger:hover {
    color: var(--danger-hover);
    text-decoration: underline;
}

.btn-full-width {
    width: 100%;
    box-sizing: border-box;
}

/* modal-backdrop / modal-content / modal-header / modal-body / modal-footer
   are all defined in the Unified Modal System block above */

.btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

.btn-primary {
    color: var(--pet-primary-dark);
    margin-bottom: 1rem !important;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress { display: none; }
.loading-progress-text { display: none; }

/* ── App splash / boot screen ── */
@keyframes splashFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pawFloat {
    0%, 100% {
        transform: translateY(0) rotate(-12deg);
        filter: drop-shadow(0 0 10px color-mix(in srgb, var(--pet-primary) 30%, transparent));
    }
    50% {
        transform: translateY(-20px) rotate(12deg);
        filter: drop-shadow(0 0 28px color-mix(in srgb, var(--pet-primary) 80%, transparent));
    }
}

@keyframes splashFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1f12;
}

.app-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: splashFadeIn 0.5s ease forwards;
}

.app-splash-icon {
    font-size: 4rem;
    color: var(--pet-primary);
    animation: pawFloat 4s ease-in-out infinite;
}

.app-splash-title {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--pet-primary);
    opacity: 0.9;
}

.app-splash-hide {
    animation: splashFadeOut 0.6s ease forwards;
    pointer-events: none;
}

code {
    color: #c02d76;
}

/* === Patient Grid Styles === */

/* Put the CSS variables on .board so they work with scoped CSS */
.board {
    --cell: 160px;
    /* width of each hour column */
    --row-h: 160px;
    /* height of each row */
    --left-col: 220px;
    /* width of patient name column */
    --gap: 0px;
    /* gap between cells (keep 0 for table feel) */
    --border: 1px solid #e3e3e3;
    --bg-header: #fafafa;
    --bg-sticky: #fff;
    --bg-alt: #fcfcff;
    width: 100%;

    border-top: var(--border);
    border-left: var(--border);
    background: white;
    position: relative;
    overflow-y: auto;
    transform: rotateX(180deg);
}

/* Grid: 1 sticky left column + N hour columns (N set inline from Razor) */
.grid {
    display: grid;
    grid-auto-rows: var(--row-h);
    /* DO NOT set grid-template-columns here; it's set inline via @GridTemplateColumns */
    gap: var(--gap);
    position: relative;
    transform: rotateX(180deg);

}

/* Cells */
.cell {
    border-right: var(--border);
    border-bottom: var(--border);
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: #fff;
    min-width: 0;
    /* prevent overflow in sticky cols */
}

/* Header row */
.header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-header);
    font-weight: 600;
}

/* Left sticky column (patient names) */
.sticky-left {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-sticky);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header cell for the top-left corner */
.corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
    background: var(--bg-header);
    font-weight: 700;
}

/* Subtle row striping (for data rows only) */
.row-even .cell:not(.header):not(.sticky-left) {
    background: var(--bg-alt);
}

/* Task visuals */
.task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex: 0 0 auto;
    background: #3a86ff;
}

.tab-button {
    background-color: var(--pet-primary-light);
    color: var(--pet-primary-dark);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 1rem;
}

.finding-icon {
    position: relative;
    align-items: center;
    justify-content: center;
    display: flex !important;
    width: 52px !important;
    height: 25px;
    border-radius: 45px;
    border: 3px solid #B3A795 !important;
    background-color: papayawhip;
}

.avatarclicks {
    background: none !important;
}

.edit-buttons-container button {
    margin-top: 0 !important;
}

.pet-page-pet {
    display: flex;
    flex-direction: row;
}

.pet-page-pet a {
    background-color: var(--pet-primary-light);
    color: var(--pet-primary-dark);
    border: none;
    padding: 1px 16px;
    border-radius: 4px;
    cursor: pointer;
    max-width: 100px;
    display: flex;
    margin-top: 0.5rem;
    margin-left: 4px;
    text-align: center;
    font-weight: 500;
    height: 30px;
    font-size: 12px;
    justify-content: center;
    align-items: center;
}

.active-tab {
    background-color: var(--pet-primary-dark);
    color: var(--pet-primary-light);
    -webkit-box-shadow: 0px 10px 13px -7px #000000, 5px 5px 15px 5px rgba(0, 0, 0, 0);
    box-shadow: 0px 0px 13px -7px #000000, 1px 1px 28px -19px rgba(0, 0, 0, 0);
}

.button-plain {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
}

.button-plain:focus {
    outline: none;
}

.task {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* click-to-complete visual */
.done {}


/* Make the scroll container define the sticky context */
.board {
    position: relative;
    /* ensures sticky works predictably */
    overflow: auto;
    /* you already have this */
}

/* Header row stays at top while vertical scrolling */
.header {
    position: sticky;
    top: 0;
    z-index: 6;
    /* above the left column so they don't overlap weirdly */
    background: var(--bg-header);
    font-weight: 600;
}

/* Left patient-name column stays visible while horizontal scrolling */
.sticky-left {
    position: sticky;
    left: 0;
    z-index: 5;
    /* below header, above normal cells */
    background: var(--bg-sticky);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* add a visual separator so it feels like a fixed column */
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
}

.content {
    max-width: 90vw;
    overflow: scroll;
}

/* Top-left corner (fixed for both directions) */
.corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 7;
    /* above everything */
    background: var(--bg-header);
    font-weight: 700;
}

/* modal-overlay / modal-box / modal-backdrop defined in Unified Modal System above */

.close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}

.close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-confirm {
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #efde62, #185338);
    color: #fff;
    transition: opacity 0.15s;
}

#isActive {
    accent-color: #b79f2d !important;
}

.btn-confirm:hover {
    opacity: 0.88;
}

.btn-cancel {
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: background 0.15s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.18);
}

.med-row {
    gap: 9px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.pet-profile {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
}

.epic-pet-button {
    margin-bottom: 1rem;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #425f28, #c3c459);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .3px;
    transition: all 1s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.epic-pet-button:hover {
    background: linear-gradient(135deg, #113b1a, #1c945c);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.epic-pet-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.epic-pet-button:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
    box-shadow: none;
}

.med-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.med-icon {
    font-size: 1.4rem;
    color: #6b5fb4;
}

.med-line {
    margin: 4px 0;
    font-size: 1rem;
    color: #444;
}

.current-medication-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Container button */
.epic-pet-file-upload {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #6b5fb4, #483a73);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

/* Hover */
.epic-pet-file-upload:hover {
    background: linear-gradient(135deg, #7c70c8, #5a4a8a);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

/* Icon */
.epic-pet-file-upload i {
    font-size: 1.2rem;
}

/* Hide actual file input */
.epic-pet-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.medication-container {
    margin-bottom: 1rem;
    padding: 15px;
    background: lightblue;
    border-radius: 20px;
}

.epic-pet-delete-button {
    font-size: 12px;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #e8504f, #c62828);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
    letter-spacing: .3px;
}

.epic-pet-delete-button:hover {
    background: linear-gradient(135deg, #ff6161, #d32f2f);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.epic-pet-delete-button:active {
    transform: translateY(0);
}

.epic-pet-delete-button i {
    font-size: 12px;
}


.pet-profile-image {
    border-radius: 20px;
}

.profile-picture-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column-reverse;
    gap: 10px;
}

button {
    margin-bottom: 1rem !important;
    margin-top: 1rem !important;
}

/* nice fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Medium screens: shrink grid columns but keep grid layout */
@media (max-width: 800px) and (min-width: 641px) {
    .board {
        --cell: 64px;
        --left-col: 180px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .task {
        display: none;
    }

    .cell {
        min-height: 48px;
        font-size: 0.75rem;
    }

    .task-badge {
        display: none;
    }

    .task-icon {
        opacity: 1 !important;
    }
}

.upload-error {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #e05c5c;
    text-align: center;
}