/* ================================================================
   Slide-out menu drawer + menu_v2 navigation
   Shared between: appointments-view.css, booking-wizard.css
   Hosts views/common/menu_v2.php inside an off-canvas drawer for any
   page that hides the default CI3 sidebar (fullscreen mode).
   ================================================================ */

.menu-drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .35);
    backdrop-filter: blur(2px);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.menu-drawer-overlay.show { opacity: 1; visibility: visible; }

.menu-drawer {
    position: fixed;
    top: 0; left: 0;
    width: 300px;
    height: 100vh;
    max-width: 92vw;
    background: #fff;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .12);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    visibility: hidden;
}
.menu-drawer.show {
    transform: translateX(0);
    visibility: visible;
}
.menu-drawer-head {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: linear-gradient(135deg, rgba(37, 99, 235, .04), rgba(13, 148, 136, .04));
}
.menu-drawer-title {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700;
    color: var(--text, #1f2937);
    letter-spacing: .02em;
}
.menu-drawer-title .material-icons { font-size: 18px; color: var(--brand, #2563eb); }
.menu-drawer-close {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: 0;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.menu-drawer-close:hover {
    background: var(--bg-soft, #f1f5f9);
    color: var(--text, #1f2937);
}
.menu-drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ─── menu_v2 — flat, modern, search-able navigation ─── */
.m2-shell {
    padding: 12px 12px 16px;
    font-size: 13px;
}
.m2-search-wrap {
    position: relative;
    margin-bottom: 14px;
}
.m2-search-ico {
    position: absolute;
    left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-soft, #94a3b8);
    pointer-events: none;
}
.m2-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text, #1f2937);
    background: var(--bg-soft, #f8fafc);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.m2-search:focus {
    outline: none;
    border-color: var(--brand, #2563eb);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.m2-section { margin-bottom: 12px; }
.m2-section.m2-hidden { display: none; }
.m2-section-label {
    font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-soft, #94a3b8);
    padding: 6px 10px 4px;
}
.m2-list {
    list-style: none;
    padding: 0; margin: 0;
}
.m2-item {
    margin: 1px 0;
}
.m2-item.m2-hidden { display: none; }
.m2-item > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text, #1f2937);
    text-decoration: none;
    font-weight: 500;
    transition: background .12s, color .12s;
    position: relative;
}
.m2-item > a:hover {
    background: var(--bg-soft, #f8fafc);
    color: var(--brand, #2563eb);
}
.m2-item.active > a {
    background: rgba(37, 99, 235, .08);
    color: var(--brand, #2563eb);
    font-weight: 600;
}
.m2-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--bg-soft, #f1f5f9);
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
    transition: background .12s, color .12s;
}
.m2-ico .material-icons { font-size: 16px; }
.m2-item > a:hover .m2-ico {
    background: rgba(37, 99, 235, .10);
    color: var(--brand, #2563eb);
}
.m2-item.active .m2-ico {
    background: var(--brand, #2563eb);
    color: #fff;
}
.m2-title { flex: 1; line-height: 1.25; }
.m2-active-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand, #2563eb);
    flex-shrink: 0;
}

.m2-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.m2-foot-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background .12s, color .12s;
}
.m2-foot-link:hover {
    background: var(--bg-soft, #f8fafc);
    color: var(--text, #1f2937);
}
.m2-foot-link .material-icons { font-size: 16px; color: var(--text-soft, #94a3b8); }
.m2-foot-danger:hover {
    background: rgba(220, 38, 38, .05);
    color: var(--danger, #dc2626);
}
.m2-foot-danger:hover .material-icons { color: var(--danger, #dc2626); }

/* Empty-state when search produces no matches */
.m2-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--text-soft, #94a3b8);
    font-size: 12px;
    display: none;
}
.m2-empty.show { display: block; }

/* ─── Sub-menu (m2-has-children → m2-sublist) ─── */
.m2-item.m2-has-children > a {
    position: relative;
    padding-right: 36px;
}
.m2-item.m2-has-children > a > .m2-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: var(--text-soft, #94a3b8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    transition: transform .2s ease, color .12s, background .12s;
}
.m2-item.m2-has-children > a > .m2-toggle .material-icons {
    font-size: 18px;
    line-height: 1;
}
.m2-item.m2-has-children > a > .m2-toggle:hover {
    background: rgba(15, 23, 42, .06);
    color: var(--text, #1f2937);
}
.m2-item.m2-has-children.open > a > .m2-toggle {
    transform: translateY(-50%) rotate(180deg);
    color: var(--brand, #2563eb);
}

.m2-sublist {
    list-style: none;
    padding: 2px 0 4px 32px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    position: relative;
}
.m2-item.open > .m2-sublist {
    max-height: 600px;
}
.m2-sublist::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--border, #e5e7eb);
}
.m2-subitem {
    margin: 1px 0;
}
.m2-subitem.m2-hidden { display: none; }
.m2-subitem > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: 6px;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-weight: 500;
    font-size: 12.5px;
    transition: background .12s, color .12s;
}
.m2-subitem > a:hover {
    background: var(--bg-soft, #f8fafc);
    color: var(--brand, #2563eb);
}
.m2-subitem.active > a {
    background: rgba(37, 99, 235, .08);
    color: var(--brand, #2563eb);
    font-weight: 600;
}
.m2-subdot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-soft, #cbd5e1);
    flex-shrink: 0;
    margin-left: 4px;
}
.m2-subitem.active .m2-subdot { background: var(--brand, #2563eb); }
.m2-subitem > a .m2-active-dot { margin-left: auto; }
