/*
 * Admin panel overrides. Loaded AFTER style.bundle.css (admin app + auth layouts).
 * Keep this file small: one rule per real need, with the reason. Plan: .claude/tasks/plans/2026-11-26-admin-ui-rollout.md
 */

/* The theme declares the fallback as the quoted string "sans-serif" (a font NAME, not the generic family),
   so a missing Inter fell through to the browser default serif. Use the real generic family. */
:root,
[data-bs-theme] {
    --bs-font-sans-serif: Inter, Helvetica, Arial, sans-serif;
}

/* Equal-width digits so counts, times and money line up down a column. */
table {
    font-variant-numeric: tabular-nums;
}

/* ---- moved from views/admins/layouts/partials/sidebar.blade.php ---- */
    #sb_rail { display: none; }
    /* Follows the theme: white in light mode, the dark surface in dark mode. */
    :root { --sb-aside-bg: #ffffff; --sb-aside-border: var(--bs-gray-200); --sb-icon: var(--bs-gray-600); --sb-icon-hover-bg: var(--bs-gray-100); }
    [data-bs-theme="dark"] { --sb-aside-bg: #0D0E12; --sb-aside-border: #1b1c22; --sb-icon: rgba(255, 255, 255, .75); --sb-icon-hover-bg: rgba(255, 255, 255, .08); }
    @media (min-width: 992px) {
        body#kt_app_body.sb-rail-on { --bs-app-sidebar-width: 100px; }
        body.sb-rail-on #kt_app_sidebar { width: 100px; background-color: var(--sb-aside-bg) !important; border: 0 !important; border-right: 1px solid var(--sb-aside-border) !important; box-shadow: none !important; }
        body.sb-rail-on #kt_app_sidebar_logo { justify-content: center; padding: 1.75rem 0 1rem !important; height: auto; border: 0 !important; }
        body.sb-rail-on .app-sidebar-logo-default { display: none !important; }
        body.sb-rail-on .app-sidebar-logo-minimize { display: inline-block !important; height: 38px; }
        body.sb-rail-on #kt_app_sidebar_toggle { display: none !important; }

        body.sb-rail-on #sb_rail { display: flex; flex-direction: column; align-items: center; gap: .5rem; flex: 1 1 auto; overflow-y: auto; padding: .75rem 0; scrollbar-width: none; }
        #sb_rail::-webkit-scrollbar { display: none; }
        .sb-rail-btn { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; padding: 0; border: 0; border-radius: .475rem; background: transparent; cursor: pointer; flex-shrink: 0; }
        .sb-rail-btn i { color: var(--sb-icon); font-size: 1.85rem; }
        .sb-rail-btn:hover, .sb-rail-btn.active { background: var(--sb-icon-hover-bg); }
        .sb-rail-btn:hover i, .sb-rail-btn.active i { color: var(--bs-primary); }
        .sb-rail-btn.current { background: rgba(var(--bs-primary-rgb), .12); }
        .sb-rail-btn.current i { color: var(--bs-primary); }

        /* The original menu becomes the dropdown beside the hovered tile. */
        body.sb-rail-on .app-sidebar-menu { flex: 0 0 0 !important; min-height: 0; }
        body.sb-rail-on #kt_app_sidebar_menu_wrapper { display: none; position: fixed; left: 100px; top: 8px; width: 260px; z-index: 106; background: var(--bs-body-bg); border-radius: .75rem; box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .15); }
        body.sb-rail-on.sb-open #kt_app_sidebar_menu_wrapper { display: block; }
        body.sb-rail-on #kt_app_sidebar_menu_scroll { height: auto !important; max-height: calc(100vh - 16px) !important; overflow-y: auto !important; margin: 0 !important; padding: .5rem .75rem 1rem; }
        body.sb-rail-on .sb-hide { display: none !important; }
        body.sb-rail-on #kt_app_sidebar_menu_scroll .menu-content { padding-top: .75rem !important; padding-bottom: .5rem !important; }
        body.sb-rail-on #kt_app_sidebar_menu_scroll .menu-section { font-size: 1.15rem !important; font-weight: 700 !important; color: var(--bs-gray-900) !important; text-transform: none !important; }

        /* A section whose only item is an accordion (Dashboard): drop the accordion row, list its pages directly. */
        body.sb-rail-on .menu-item.sb-flat > .menu-link { display: none !important; }
        body.sb-rail-on .menu-item.sb-flat > .menu-sub { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; }
    }

/* ---- moved from views/admins/sms-inbox/index.blade.php ---- */
        .sms-split { display: flex; gap: 1.25rem; height: calc(100vh - 235px); min-height: 520px; }
        .sms-list { flex: 0 0 390px; width: 390px; display: flex; flex-direction: column; min-height: 0; }
        .sms-list-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
        .sms-pane { flex: 1 1 auto; min-width: 0; overflow-y: auto; }
        .sms-item { display: block; padding: .85rem 1rem; border-bottom: 1px dashed var(--bs-gray-300); border-left: 3px solid transparent; color: inherit; }
        .sms-item:hover { background: var(--bs-gray-100); }
        .sms-item.active { background: var(--bs-gray-100); border-left-color: var(--bs-primary); }
        .sms-item.sms-urgent { border-left-color: var(--bs-danger); }
        .sms-item.sms-high { border-left-color: var(--bs-warning); }
        .sms-item .sms-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        @media (max-width: 991.98px) {
            .sms-split { display: block; height: auto; }
            .sms-list { width: 100%; flex: none; }
            .sms-list-scroll { overflow: visible; }
            .sms-pane { display: none; }
        }
    

/* ---- moved from views/admins/sms-inbox/show.blade.php ---- */
        .sms-bubble { background: var(--bs-gray-100); border-radius: .75rem; padding: 1.1rem 1.35rem; color: var(--bs-gray-900); font-size: 1.15rem; white-space: pre-wrap; }
        .sms-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--bs-gray-300); }
        .sms-kv:last-child { border-bottom: 0; }
        .sms-kv > span:first-child { color: var(--bs-gray-600); flex: 0 0 38%; }
        .sms-kv > span:last-child { text-align: end; color: var(--bs-gray-800); min-width: 0; overflow-wrap: anywhere; }
    

/* ---- moved from views/admins/roles/edit.blade.php ---- */
#hotel_owner_wrap, #inherits_wrap, #geo_wrap, #overtime_wrap {
            display: none;
        }

/* ---- moved from views/admins/roles/create.blade.php ---- */
#hotel_owner_wrap, #inherits_wrap, #geo_wrap, #overtime_wrap { display: none; }

/* ---- moved from views/admins/layouts/partials/header.blade.php ---- */
                            #kt_act_as_select + .select2-container .select2-selection--single {
                                height: 35px !important;
                                display: flex;
                                align-items: center;
                            }
                            #kt_act_as_select + .select2-container .select2-selection__rendered {
                                line-height: normal !important;
                            }
                            #kt_act_as_select + .select2-container .select2-selection__arrow {
                                height: 35px !important;
                            }
                        

/* ---- moved from views/admins/layouts/partials/ai-chat-drawer-2.blade.php ---- */
    /* Markdown in assistant replies (renderMarkdown) — compact for the 350–525px drawer. */
    .ai-chat2-md p { margin: 0 0 .5rem; }
    .ai-chat2-md p:last-child { margin-bottom: 0; }
    .ai-chat2-md .ai-chat2-h { font-weight: 700; margin-top: .25rem; }
    .ai-chat2-md ul, .ai-chat2-md ol { margin: 0 0 .5rem; padding-left: 1.25rem; }
    .ai-chat2-md li { margin-bottom: .15rem; }
    .ai-chat2-md code { background: var(--bs-gray-100, #f5f5f5); padding: 0 .25rem; border-radius: 3px; font-size: .95em; }
    .ai-chat2-md hr { margin: .5rem 0; }
    .ai-chat2-md .ai-chat2-table { overflow-x: auto; margin: 0 0 .5rem; }
    .ai-chat2-md table { border-collapse: collapse; width: 100%; font-size: .95em; }
    .ai-chat2-md th, .ai-chat2-md td { border: 1px solid var(--bs-gray-300, #ddd); padding: .25rem .5rem; text-align: left; vertical-align: top; }
    .ai-chat2-md th { background: var(--bs-gray-100, #f5f5f5); font-weight: 600; }

/* ---- moved from views/admins/translations/translate.blade.php ---- */
        .fixed-col {
            background-color: var(--bs-body-bg) !important;
        }
    

/* ---- utility classes that replaced repeated inline style="" attributes in the admin views ---- */
.pre-wrap { white-space: pre-wrap; }
.mw-70vw { max-width: 70vw !important; }
.break-all { word-break: break-all; }
.min-width-0 { min-width: 0; }
.fs-9px { font-size: 9px; }
.fs-10px { font-size: 10px; }
.h-vh-220-scroll { height: calc(100vh - 220px); overflow-y: auto; }

/* ---- filters card (layouts/components/filters-card): chevron of a collapsible card ---- */
.filters-chevron { transition: transform .2s ease; }
[aria-expanded="false"] > .card-toolbar .filters-chevron { transform: rotate(-90deg); }

/* ---- sidebar rail dropdown (UI-36): accordions are always open; their title is a plain group heading ----
   (the single-accordion Dashboard section is flattened separately by .sb-flat) */
@media (min-width: 992px) {
    body.sb-rail-on .menu-item.menu-accordion:not(.sb-flat) > .menu-sub { display: block !important; height: auto !important; overflow: visible !important; }
    body.sb-rail-on .menu-item.menu-accordion:not(.sb-flat) > .menu-link { pointer-events: none; cursor: default; }
    body.sb-rail-on .menu-item.menu-accordion:not(.sb-flat) > .menu-link .menu-arrow { display: none; }
    body.sb-rail-on .menu-item.menu-accordion:not(.sb-flat) > .menu-link .menu-title { font-weight: 700; color: var(--bs-gray-800); }
}

/* ---- detail pages: content column + action rail (UI-31) ---- */
.action-rail { position: sticky; top: 90px; }
.action-rail .card-body > .btn,
.action-rail .card-body > form,
.action-rail .card-body > form > .btn { width: 100%; }
@media (max-width: 1199.98px) { .action-rail { position: static; } }
