/* TT MVP Management — frontend dashboard styles (light, KiviCare-inspired) */

:root {
    --tt-bg:            #f4f5fa;
    --tt-surface:       #ffffff;
    --tt-border:        #e6e8ef;
    --tt-text:          #1f2937;
    --tt-text-muted:    #6b7280;
    --tt-text-faint:    #9aa0ac;

    --tt-primary:       #f2706e;   /* coral — primary "Add" actions */
    --tt-primary-hover: #e85b59;
    --tt-accent:        #4f5bd5;   /* indigo — table headers, links, active nav */
    --tt-accent-hover:  #4049b8;
    --tt-accent-soft:   #eef0fe;   /* active nav / avatar / icon-tile background */

    --tt-green:         #15803d;
    --tt-green-soft:    #dcfce7;
    --tt-red:           #dc2626;
    --tt-red-soft:      #fee2e2;
    --tt-gray:          #6b7280;
    --tt-gray-soft:     #f1f2f6;

    --tt-sidebar-w:     248px;
    --tt-sidebar-cw:    74px;
    --tt-topbar-h:      60px;
    --tt-radius:        12px;

    --tt-shadow-sm:     0 1px 2px rgba(16, 24, 40, 0.04);
    --tt-shadow-md:     0 4px 16px rgba(16, 24, 40, 0.06);
}

html, body.tt-mvp-body {
    margin: 0;
    padding: 0;
    background: var(--tt-bg);
    color: var(--tt-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
a { color: var(--tt-accent); }

/* ============================ Login page ============================ */

.tt-mvp-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 100% -10%, var(--tt-accent-soft), transparent 60%),
        var(--tt-bg);
}

.tt-mvp-login-wrap { width: 100%; max-width: 400px; }

.tt-mvp-login-card {
    background: var(--tt-surface);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow-md);
    padding: 32px 28px;
}

.tt-mvp-login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tt-accent);
    margin-bottom: 20px;
}
.tt-mvp-login-brand .dashicons { font-size: 26px; width: 26px; height: 26px; }
.tt-mvp-login-brand-name { font-weight: 600; font-size: 16px; color: var(--tt-text); }

.tt-mvp-login-title { margin: 0 0 4px; font-size: 22px; color: var(--tt-text); }
.tt-mvp-login-sub { margin: 0 0 20px; color: var(--tt-text-muted); }

.tt-mvp-login-error {
    background: var(--tt-red-soft);
    color: var(--tt-red);
    border: 1px solid var(--tt-red);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.tt-mvp-login-field { display: block; margin-bottom: 16px; }
.tt-mvp-login-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tt-text);
}
.tt-mvp-login-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--tt-text);
    background: #fff;
}
.tt-mvp-login-field input:focus {
    outline: none;
    border-color: var(--tt-accent);
    box-shadow: 0 0 0 3px var(--tt-accent-soft);
}

.tt-mvp-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 13px;
}
.tt-mvp-login-remember { display: flex; align-items: center; gap: 6px; color: var(--tt-text-muted); }
.tt-mvp-login-forgot { text-decoration: none; }
.tt-mvp-login-forgot:hover { text-decoration: underline; }

.tt-mvp-login-submit {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: var(--tt-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.tt-mvp-login-submit:hover { background: var(--tt-accent-hover); }

.tt-mvp-app {
    display: flex;
    min-height: 100vh;
}

/* ============================ Sidebar ============================ */

.tt-mvp-sidebar {
    width: var(--tt-sidebar-w);
    flex-shrink: 0;
    background: var(--tt-surface);
    border-right: 1px solid var(--tt-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.tt-mvp-brand {
    height: var(--tt-topbar-h);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tt-text);
    border-bottom: 1px solid var(--tt-border);
}

.tt-mvp-brand .tt-mvp-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
    flex-shrink: 0;
}

.tt-mvp-nav {
    flex-grow: 1;
    padding: 10px 20px;
}

.tt-mvp-nav-group {
    margin: 1rem 0 1rem;
    padding: 0 0.65rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
    border-bottom: 1px solid #0000001c;
    padding-bottom: 10px;
}

.tt-mvp-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-bottom: 20px;
}

.tt-mvp-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    margin-bottom: 2px;
    color: var(--tt-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 9px;
    transition: background 0.15s ease, color 0.15s ease;
}

.tt-mvp-nav-item a:hover {
    background: var(--tt-gray-soft);
    color: var(--tt-text);
}

.tt-mvp-nav-item.is-active a {
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
    font-weight: 600;
}

.tt-mvp-nav-item .dashicons {
    font-size: 19px;
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

/* User card pinned to the bottom of the sidebar. */
.tt-mvp-user-card {
    border-top: 1px solid var(--tt-border);
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tt-mvp-user-card .tt-mvp-avatar { flex-shrink: 0; }

.tt-mvp-user-meta { min-width: 0; flex-grow: 1; }

.tt-mvp-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--tt-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-mvp-user-email {
    font-size: 0.75rem;
    color: var(--tt-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-mvp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--tt-text-muted);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.tt-mvp-icon-btn:hover { background: var(--tt-gray-soft); color: var(--tt-text); }

/* ============================ Main ============================ */

.tt-mvp-main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tt-mvp-topbar {
    height: var(--tt-topbar-h);
    background: var(--tt-surface);
    border-bottom: 1px solid var(--tt-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tt-mvp-topbar-left,
.tt-mvp-topbar-right { display: flex; align-items: center; gap: 0.4rem; }

.tt-mvp-content {
    padding: 1.5rem 1.75rem;
    flex-grow: 1;
}

/* Breadcrumb */
.tt-mvp-breadcrumb {
    font-size: 0.85rem;
    color: var(--tt-text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tt-mvp-breadcrumb a { text-decoration: none; color: var(--tt-text-muted); }
.tt-mvp-breadcrumb a:hover { color: var(--tt-accent); }
.tt-mvp-breadcrumb .sep { color: var(--tt-text-faint); }
.tt-mvp-breadcrumb .current { color: var(--tt-text); font-weight: 600; }

/* Page header row */
.tt-mvp-page-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--tt-text);
}

.tt-mvp-page-header--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tt-mvp-page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ============================ Buttons ============================ */

.tt-mvp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    background: var(--tt-surface);
    color: var(--tt-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}

.tt-mvp-btn:hover { background: var(--tt-gray-soft); }

.tt-mvp-btn-primary {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
    color: #fff;
    box-shadow: var(--tt-shadow-sm);
}
.tt-mvp-btn-primary:hover { background: var(--tt-primary-hover); color: #fff; }

.tt-mvp-btn-accent {
    background: var(--tt-accent);
    border-color: var(--tt-accent);
    color: #fff;
}
.tt-mvp-btn-accent:hover { background: var(--tt-accent-hover); color: #fff; }

.tt-mvp-btn .dashicons { font-size: 17px; width: 17px; height: 17px; }
.tt-mvp-btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ============================ Cards ============================ */

.tt-mvp-card {
    background: var(--tt-surface);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--tt-shadow-sm);
}

.tt-mvp-card p { margin: 0; color: var(--tt-text-muted); }
.tt-mvp-card-title {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tt-text);
}

.tt-mvp-form .tt-mvp-card-title{
    padding-bottom: 10px;
    font-size: 1.5rem;
    border-bottom: 1px solid #0000002b;
}

.tt-mvp-card--table { padding: 0; overflow: hidden; }
.tt-mvp-card--table > p { padding: 1.25rem; }

/* ============================ Stat cards ============================ */

.tt-mvp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.tt-mvp-stat {
    background: var(--tt-surface);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    padding: 1.25rem;
    box-shadow: var(--tt-shadow-sm);
    text-align: center;
}

.tt-mvp-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
    margin-bottom: 0.75rem;
}

.tt-mvp-stat-icon .dashicons { font-size: 26px; width: 26px; height: 26px; }
.tt-mvp-stat-value { font-size: 1.9rem; font-weight: 700; color: var(--tt-text); line-height: 1.1; }
.tt-mvp-stat-label { font-size: 0.85rem; font-weight: 600; color: var(--tt-text-muted); margin-top: 0.25rem; }

/* ============================ Toolbar ============================ */

.tt-mvp-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tt-mvp-toolbar .tt-mvp-search {
    margin-left: auto;
    position: relative;
}

.tt-mvp-toolbar .tt-mvp-search .dashicons {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tt-text-faint);
    font-size: 18px;
}

.tt-mvp-toolbar input[type="search"],
.tt-mvp-toolbar select {
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    font-size: 0.875rem;
    background: var(--tt-surface);
    color: var(--tt-text);
    font-family: inherit;
}

.tt-mvp-toolbar input[type="search"] { padding-left: 2.1rem; min-width: 240px; }
.tt-mvp-toolbar input:focus,
.tt-mvp-toolbar select:focus {
    outline: none;
    border-color: var(--tt-accent);
    box-shadow: 0 0 0 3px var(--tt-accent-soft);
}

/* ============================ Table ============================ */

.tt-mvp-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.tt-mvp-table thead th {
    background: var(--tt-accent);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}
.tt-mvp-table thead th:first-child { border-top-left-radius: 0; }

.tt-mvp-table td {
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--tt-border);
    vertical-align: middle;
}

.tt-mvp-table tbody tr:last-child td { border-bottom: 0; }
.tt-mvp-table tbody tr:hover { background: #fafbff; }

/* Identity cell: avatar + name/subtext */
.tt-mvp-identity { display: flex; align-items: center; gap: 0.7rem; }
.tt-mvp-identity-main { font-weight: 600; color: var(--tt-text); }
.tt-mvp-identity-sub { font-size: 0.8rem; color: var(--tt-text-muted); }

.tt-mvp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Row action icons */
.tt-mvp-row-actions { display: flex; align-items: center; gap: 0.15rem; }
.tt-mvp-row-actions form { display: inline-flex; margin: 0; }
.tt-mvp-table .tt-mvp-icon-btn { color: var(--tt-green); }
.tt-mvp-table .tt-mvp-icon-btn:hover { background: var(--tt-green-soft); color: var(--tt-green); }
.tt-mvp-table .tt-mvp-icon-btn--accent { color: var(--tt-accent); }
.tt-mvp-table .tt-mvp-icon-btn--accent:hover { background: var(--tt-accent-soft); color: var(--tt-accent); }
.tt-mvp-table .tt-mvp-icon-btn--danger { color: var(--tt-red); }
.tt-mvp-table .tt-mvp-icon-btn--danger:hover { background: var(--tt-red-soft); color: var(--tt-red); }

.tt-mvp-id { color: var(--tt-text-muted); font-weight: 600; font-size: 0.85rem; }

/* Danger button */
.tt-mvp-btn-danger { background: var(--tt-red); border-color: var(--tt-red); color: #fff; }
.tt-mvp-btn-danger:hover { background: #b91c1c; color: #fff; }

/* Modal */
.tt-mvp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.tt-mvp-modal-backdrop.is-open { display: flex; }
.tt-mvp-modal {
    background: var(--tt-surface);
    border-radius: var(--tt-radius);
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}
.tt-mvp-modal-title { margin: 0 0 0.6rem; font-size: 1.15rem; font-weight: 700; color: var(--tt-text); }
.tt-mvp-modal-body { margin: 0 0 1rem; color: var(--tt-text-muted); font-size: 0.9rem; }
.tt-mvp-modal-body code { background: var(--tt-gray-soft); padding: 0.05rem 0.35rem; border-radius: 4px; color: var(--tt-red); font-weight: 600; }
.tt-mvp-modal-input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 1.25rem;
}
.tt-mvp-modal-input:focus { outline: none; border-color: var(--tt-red); box-shadow: 0 0 0 3px var(--tt-red-soft); }
.tt-mvp-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Badges */
.tt-mvp-badge {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--tt-gray-soft);
    color: var(--tt-gray);
}
.tt-mvp-badge--green { background: var(--tt-green-soft); color: var(--tt-green); }
.tt-mvp-badge--red   { background: var(--tt-red-soft);   color: var(--tt-red); }
.tt-mvp-status-form { display: inline-flex; margin: 0; }
.tt-mvp-status-toggle {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}
.tt-mvp-status-toggle:hover { filter: brightness(0.96); }

/* Pagination / table footer */
.tt-mvp-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--tt-border);
    font-size: 0.85rem;
    color: var(--tt-text-muted);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ============================ Forms ============================ */

.tt-mvp-form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.tt-mvp-field { flex: 1 1 220px; margin-bottom: 1rem; display: flex; flex-direction: column; }
.tt-mvp-field--full { flex-basis: 100%; }

.tt-mvp-field label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tt-text);
    margin-bottom: 0.35rem;
}
.tt-mvp-req { color: var(--tt-primary); }

.tt-mvp-field input,
.tt-mvp-field select,
.tt-mvp-field textarea {
    padding: 10px 15px;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    font-size: 0.9rem;
    background: #f5f6fa;
    color: var(--tt-text);
    font-family: inherit;
    width: 100%;
    margin-top: 10px;
}
.tt-mvp-field textarea { resize: vertical; }

.tt-mvp-field input:focus,
.tt-mvp-field select:focus,
.tt-mvp-field textarea:focus {
    outline: none;
    border-color: var(--tt-accent);
    box-shadow: 0 0 0 3px var(--tt-accent-soft);
}

.tt-mvp-form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.tt-mvp-field-note { font-size: 0.78rem; color: var(--tt-text-muted); margin-top: 0.4rem; }

/* Radio row (e.g. Gender) */
.tt-mvp-radio-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 40px;
    margin-top: 10px;
}
.tt-mvp-radio { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; cursor: pointer; }
.tt-mvp-radio input {
    width: 15px;
    margin: 0;
    height: 15px;
}

.tt-mvp-field-input--date{
    /* margin-top: 0 !important; */
}

/* Soft-deleted rows */
.tt-mvp-table tr.tt-mvp-row-deleted { color: var(--tt-text-faint); background: #fafafa; }
.tt-mvp-table tr.tt-mvp-row-deleted .tt-mvp-identity-main,
.tt-mvp-table tr.tt-mvp-row-deleted .tt-mvp-identity-sub { color: var(--tt-text-faint); }
.tt-mvp-table tr.tt-mvp-row-deleted .tt-mvp-avatar { background: var(--tt-gray-soft); color: var(--tt-text-faint); }

/* Tag/pill display (list cells) */
.tt-mvp-tags-display { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tt-mvp-tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Tag multi-select widget */
.tt-mvp-tagselect { position: relative; }
.tt-mvp-tagselect-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    background: #fff;
    cursor: text;
}
.tt-mvp-tagselect-box.is-focus {
    border-color: var(--tt-accent);
    box-shadow: 0 0 0 3px var(--tt-accent-soft);
}
.tt-mvp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    background: var(--tt-gray-soft);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--tt-text);
    padding: 10px 15px;
}
.tt-mvp-chip button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--tt-text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}
.tt-mvp-chip button:hover { color: var(--tt-red); }
.tt-mvp-tagselect-input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 140px;
    font-size: 0.9rem;
    padding: 0.25rem;
    font-family: inherit;
    background: transparent;
    color: var(--tt-text);
    margin-top: 0 !important;
}
.tt-mvp-tagselect-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    background: #fff;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    box-shadow: var(--tt-shadow-md);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.tt-mvp-tagselect-menu.is-open { display: block; }
.tt-mvp-tagselect-option { padding: 0.55rem 0.8rem; cursor: pointer; font-size: 0.9rem; }
.tt-mvp-tagselect-option:hover { background: var(--tt-accent-soft); color: var(--tt-accent); }
.tt-mvp-tagselect-option .add { color: var(--tt-accent); font-weight: 600; }


/* Patient registration extras */
.tt-mvp-radio-row--wrap { flex-wrap: wrap; }
.tt-mvp-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem 1rem;
    margin-top: 0.25rem;
}
.tt-mvp-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    color: var(--tt-text);
}
.tt-mvp-check input {
    width: 15px;
    height: 15px;
    margin: 0;
}
.tt-mvp-check--single { margin-top: 10px; min-height: 40px; }
.tt-mvp-consent-box {
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    background: #f8f9fc;
    padding: 1rem;
    margin-top: 0.25rem;
}
.tt-mvp-consent-list {
    margin: 0 0 1rem 1.2rem;
    padding: 0;
    color: var(--tt-text-muted);
    font-size: 0.9rem;
}
.tt-mvp-consent-list li { margin-bottom: 0.45rem; }
.tt-mvp-consent-agree {
    border-top: 1px solid var(--tt-border);
    padding-top: 0.85rem;
    color: var(--tt-text);
    font-weight: 700;
}
.tt-mvp-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.tt-mvp-file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: var(--tt-surface);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}
.tt-mvp-file-link .dashicons { font-size: 17px; width: 17px; height: 17px; }


/* Encounter wizard */
.tt-mvp-wizard-steps {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.tt-mvp-wizard-step {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: #fff;
    color: var(--tt-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}
.tt-mvp-wizard-step.is-active {
    border-color: var(--tt-accent);
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
}
.tt-mvp-encounter-panel {
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
    background: #fff;
}
.tt-mvp-encounter-panel h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--tt-text);
}
.tt-mvp-encounter-consent { margin-top: 0.5rem; }
.tt-mvp-wizard-actions { align-items: center; }

.tt-mvp-btn-create[disabled] {
    opacity: 1;
    background: #e5e7eb;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}
.tt-mvp-btn-create[disabled]::after {
    content: "Required fields incomplete";
    margin-left: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.tt-mvp-related-box {
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
    background: #f8fafc;
}
.tt-mvp-form-section-title {
    margin: 1.5rem 0 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--tt-border);
    font-size: 1rem;
}
.tt-mvp-tongue-row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.tt-mvp-tongue-fields {
    flex: 1 1 320px;
    min-width: 260px;
}
.tt-mvp-tongue-map {
    flex: 0 0 auto;
    margin: 0;
}
.tt-mvp-tongue-map img {
    display: block;
    width: 220px;
    height: auto;
}
.tt-mvp-related-results {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: #fff;
    max-height: 260px;
    overflow-y: auto;
}
.tt-mvp-related-results li + li { border-top: 1px solid var(--tt-border); }
.tt-mvp-related-results button {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.tt-mvp-related-results button:hover,
.tt-mvp-related-results button:focus {
    background: #eff6ff;
}
.tt-mvp-related-results strong { display: block; }
.tt-mvp-related-results button.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.tt-mvp-related-results button.is-disabled:hover,
.tt-mvp-related-results button.is-disabled:focus {
    background: #fef2f2;
}
.tt-mvp-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
}
/* Inside the list toolbar the tabs sit on the same row as the search box. */
.tt-mvp-toolbar .tt-mvp-filter-tabs {
    margin: 0;
}
.tt-mvp-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--tt-border);
    border-radius: 999px;
    background: #fff;
    color: var(--tt-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tt-mvp-filter-tab:hover {
    color: var(--tt-text);
    border-color: var(--tt-primary, #2563eb);
}
.tt-mvp-filter-tab.is-active {
    background: var(--tt-primary, #2563eb);
    border-color: var(--tt-primary, #2563eb);
    color: #fff;
}
.tt-mvp-filter-tab--danger.is-active {
    background: #dc2626;
    border-color: #dc2626;
}
.tt-mvp-filter-tab-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    line-height: 18px;
    text-align: center;
}
.tt-mvp-filter-tab.is-active .tt-mvp-filter-tab-count {
    background: rgba(255, 255, 255, 0.25);
}
.tt-mvp-changelog-entry {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--tt-border);
}
.tt-mvp-changelog-entry:last-child { border-bottom: 0; padding-bottom: 0; }
.tt-mvp-changelog-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    font-size: 1rem;
}
.tt-mvp-changelog-date {
    color: var(--tt-text-muted);
    font-size: 0.82rem;
    font-weight: 400;
}
.tt-mvp-changelog-items {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--tt-text);
    font-size: 0.875rem;
}
.tt-mvp-changelog-items li { margin: 0.25rem 0; }
.tt-mvp-count-stat {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.tt-mvp-count-stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--tt-primary, #2563eb);
}
.tt-mvp-count-stat-label {
    color: var(--tt-text-muted);
    font-size: 0.9rem;
}
.tt-mvp-tab-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--tt-border);
    font-size: 0.75rem;
    line-height: 18px;
    text-align: center;
}
.tt-mvp-related-phone,
.tt-mvp-related-meta {
    display: inline-block;
    margin-right: 0.6rem;
    color: var(--tt-text-muted);
    font-size: 0.82rem;
}
.tt-mvp-related-empty {
    padding: 0.6rem 0.75rem;
    color: var(--tt-text-muted);
    font-size: 0.85rem;
}
.tt-mvp-related-placeholder {
    margin: 0;
    color: var(--tt-text-muted);
    font-size: 0.85rem;
}
.tt-mvp-related-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    background: #fff;
}
.tt-mvp-related-info-text strong { display: block; }
.tt-mvp-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 20px;
}
.tt-mvp-detail-item {
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 0.75rem;
    background: #fff;
}
.tt-mvp-detail-item span {
    display: block;
    color: var(--tt-text-muted);
    font-size: 14px;
    margin-bottom: 0.25rem;
}
.tt-mvp-detail-item strong {
    color: var(--tt-text);
    font-size: 14px;
}
.tt-mvp-acup-first {
    border-left: 3px solid var(--tt-accent);
    padding-left: 1rem;
    margin: 1rem 0;
}
/* ============================ Notices ============================ */

.tt-mvp-notice {
    padding: 0.7rem 1rem;
    border-radius: 9px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}
.tt-mvp-notice-success { background: var(--tt-green-soft); border-color: #a7f3d0; color: #065f46; }
.tt-mvp-notice-error   { background: var(--tt-red-soft);   border-color: #fecaca; color: #991b1b; }

/* ============================ Panels grid ============================ */

.tt-mvp-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.tt-mvp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.tt-mvp-panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }

/* ============================ Footer ============================ */

.tt-mvp-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--tt-text-faint);
    border-top: 1px solid var(--tt-border);
    background: var(--tt-surface);
}

/* ============================ Collapsed sidebar ============================ */

.tt-mvp-app.is-sidebar-collapsed .tt-mvp-sidebar { width: var(--tt-sidebar-cw); }
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-brand-name,
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-nav-group,
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-nav-label,
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-user-meta,
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-user-card .tt-mvp-icon-btn { display: none; }
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-nav-item a { justify-content: center; padding: 0.6rem 0; }
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-brand { justify-content: center; padding: 0; }
.tt-mvp-app.is-sidebar-collapsed .tt-mvp-user-card { justify-content: center; }

/* ============================ Responsive ============================ */

@media (max-width: 782px) {
    .tt-mvp-sidebar { width: var(--tt-sidebar-cw); }
    .tt-mvp-brand-name, .tt-mvp-nav-group, .tt-mvp-nav-label,
    .tt-mvp-user-meta, .tt-mvp-user-card .tt-mvp-icon-btn { display: none; }
    .tt-mvp-nav-item a { justify-content: center; padding: 0.6rem 0; }
    .tt-mvp-brand { justify-content: center; padding: 0; }
    .tt-mvp-toolbar .tt-mvp-search { margin-left: 0; width: 100%; }
    .tt-mvp-toolbar input[type="search"] { width: 100%; }
}

/* ============================ Encounter status switch ============================ */

.tt-mvp-status-form { display: inline-flex; margin: 0; }
.tt-mvp-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: var(--tt-text-muted);
}
.tt-mvp-switch-track {
    display: inline-block;
    width: 38px;
    height: 21px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.tt-mvp-switch-thumb {
    position: absolute;
    top: 2.5px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: left 0.15s ease;
}
.tt-mvp-switch.is-on .tt-mvp-switch-track { background: var(--tt-green); }
.tt-mvp-switch.is-on .tt-mvp-switch-thumb { left: 19px; }
.tt-mvp-switch.is-on .tt-mvp-switch-label { color: var(--tt-green); font-weight: 600; }
.tt-mvp-switch-label { text-transform: capitalize; }

/* ============================ Encounter detail layout ============================ */

.tt-mvp-encounter-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.tt-mvp-encounter-side {
    flex: 0 0 300px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tt-mvp-encounter-main { flex: 1 1 auto; min-width: 0; }
@media (max-width: 960px) {
    .tt-mvp-encounter-layout { flex-direction: column; }
    .tt-mvp-encounter-side { flex-basis: auto; width: 100%; }
}

.tt-mvp-side-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}
.tt-mvp-side-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--tt-border);
    font-size: 0.85rem;
}
.tt-mvp-side-list li span { color: var(--tt-text-muted); flex-shrink: 0; }
.tt-mvp-side-list li strong { text-align: right; font-weight: 500; word-break: break-word; }
.tt-mvp-side-muted { color: var(--tt-text-muted); font-size: 0.8rem; }

.tt-mvp-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.tt-mvp-card-head .tt-mvp-card-title { margin: 0; }

.tt-mvp-card-settings-page{
    padding: 20px;
}

/* Tabs */
.tt-mvp-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--tt-border);
    margin-bottom: 1rem;
}
.tt-mvp-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: none;
    padding: 0.6rem 0.9rem;
    margin-bottom: -2px;
    font: inherit;
    font-weight: 500;
    color: var(--tt-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.tt-mvp-tab:hover { color: var(--tt-text); }
.tt-mvp-tab.is-active {
    color: var(--tt-accent);
    border-bottom-color: var(--tt-accent);
    font-weight: 600;
}
.tt-mvp-tab .dashicons { font-size: 17px; width: 17px; height: 17px; }

/* Problems & observations */
.tt-mvp-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.tt-mvp-notes-col h3 { margin: 0 0 0.6rem; }
.tt-mvp-note-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.tt-mvp-note-form input[type="text"] { flex: 1 1 auto; min-width: 0; }
.tt-mvp-note-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: #fff;
}
.tt-mvp-note-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
}
.tt-mvp-note-list li + li { border-top: 1px solid var(--tt-border); }
.tt-mvp-note-content { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.tt-mvp-note-meta { color: var(--tt-text-faint); font-size: 0.75rem; white-space: nowrap; }
.tt-mvp-note-empty { color: var(--tt-text-muted); justify-content: center; }
.tt-mvp-note-list form { margin: 0; }

/* Reports */
.tt-mvp-report-form {
    border: 1px dashed var(--tt-border);
    border-radius: 8px;
    padding: 0.9rem;
    margin-bottom: 1rem;
    background: #f8fafc;
}
.tt-mvp-field--submit { display: flex; align-items: flex-end; }

.tt-mvp-icon-btn--danger:hover { background: var(--tt-red-soft); color: var(--tt-red); }

/* ============================ Detail-page popup ============================
   Note: `.tt-mvp-modal` is already taken by the legacy JS-built delete-confirm
   dialog (see ~line 568), so the detail-page popups use `.tt-mvp-popup`. */

body.tt-mvp-popup-open { overflow: hidden; }
.tt-mvp-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 16px;
}
.tt-mvp-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}
.tt-mvp-popup-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--tt-surface);
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow-md);
    padding: 1.25rem 1.5rem 1.5rem;
}
.tt-mvp-popup-dialog--wide { max-width: 860px; }
.tt-mvp-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--tt-border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
.tt-mvp-popup-head h2 { margin: 0; font-size: 1.15rem; }

/* Inside the edit popup the type panel must render as a normal form:
   files are managed in the Reports tab and consent is locked at creation. */
.tt-mvp-popup .tt-mvp-encounter-panel { border: 0; padding: 0; margin: 0; }
.tt-mvp-popup .tt-mvp-encounter-panel > h3 { display: none; }
.tt-mvp-popup .tt-mvp-file-upload-field { display: none; }

/* Author display values (flex/inline-flex on buttons, modals, info cards)
   beat the UA stylesheet's [hidden] rule — restore hidden semantics globally.
   The dashboard canvas is entirely plugin-rendered, so this is safe. */
[hidden] { display: none !important; }

/* Encounter detail header actions + PDF log */
.tt-mvp-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tt-mvp-header-actions .tt-mvp-status-form { display: inline-flex; }
.tt-mvp-btn-small { padding: 0.25rem 0.6rem; font-size: 0.78rem; }
.tt-mvp-badge--gray { background: var(--tt-gray-soft); color: var(--tt-gray); }

/* Locked (closed) encounter banner */
.tt-mvp-notice-info {
    background: var(--tt-accent-soft);
    color: var(--tt-accent);
    border: 1px solid var(--tt-accent);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 1rem;
}
.tt-mvp-locked-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ACC claims are managed from the patient's ACC Claims page — hide the
   creation-wizard picker inside the edit popup. */
.tt-mvp-popup .tt-mvp-acc-picker { display: none; }

/* ACC claim popup: scrollable encounter checklist + panel action row */
.tt-mvp-acc-enc-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.tt-mvp-acc-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.tt-mvp-acc-panel-actions form { margin: 0; }

/* Wizard step 3: ACC claim choice list */
.tt-mvp-acc-choice {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 520px;
}
.tt-mvp-acc-choice [data-tt-acc-options] {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.tt-mvp-acc-option {
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    background: #fff;
    cursor: pointer;
}
.tt-mvp-acc-option:hover { border-color: var(--tt-accent); }

/* The step-3 "new ACC number" input lives outside .tt-mvp-field — give it
   the same look as regular form inputs. */
.tt-mvp-acc-choice [data-tt-acc-new] {
    padding: 10px 15px;
    border: 1px solid var(--tt-border);
    border-radius: 9px;
    font-size: 0.9rem;
    background: #f5f6fa;
    color: var(--tt-text);
    font-family: inherit;
    width: 100%;
}
.tt-mvp-acc-choice [data-tt-acc-new]:focus {
    outline: none;
    border-color: var(--tt-accent);
    box-shadow: 0 0 0 3px var(--tt-accent-soft);
}

/* Breadcrumb trail on nested pages */
.tt-mvp-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.tt-mvp-breadcrumb a {
    color: var(--tt-text-muted);
    text-decoration: none;
}
.tt-mvp-breadcrumb a:hover { color: var(--tt-accent); text-decoration: underline; }
.tt-mvp-breadcrumb-sep {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--tt-text-faint);
}
.tt-mvp-breadcrumb-current { color: var(--tt-text); font-weight: 600; }

/* Change Log version picker */
.tt-mvp-changelog-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.tt-mvp-changelog-picker-label { color: var(--tt-text-muted); font-size: 0.85rem; }
.tt-mvp-changelog-controls select {
    padding: 6px 10px;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: #f5f6fa;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--tt-text);
}
