/* Shared command controls: staff and portal keep their own routes and permissions. */
.csys-command-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #dce5f0;
    border-radius: 9px;
    background: #fff;
    color: #36516f;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
}
.csys-command-trigger:hover { background: #f3f7fc; border-color: #b8cbe3; color: #203d61; }
.csys-command-trigger svg { width: 18px; height: 18px; flex: 0 0 18px; }
.csys-command-trigger-search { width: auto; border-color: #c6d7ed; background: #eaf1fc; color: #294f7c; box-shadow: 0 1px 2px #23487614; white-space: nowrap; }
.csys-command-trigger-search:hover { border-color: #99b6da; background: #dfeafb; color: #1e426e; box-shadow: 0 2px 4px #2348761a; }
.csys-command-trigger-search[aria-expanded="true"] { border-color: #799cc9; background: #dfeafb; }
.csys-command-trigger-action { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 2px; color: #6183ae; }
.csys-command-trigger-action svg { width: 14px; height: 14px; flex-basis: 14px; }
.csys-command-trigger:focus-visible,
.csys-command-create-menu :is(a, button):focus-visible,
.csys-command-close:focus-visible { outline: 2px solid #557fb9; outline-offset: 3px; }
.csys-command-trigger-create { background: #234876; border-color: #234876; color: #fff; }
.csys-command-trigger-create:hover { background: #1a395f; border-color: #1a395f; color: #fff; }
.csys-command-shortcut { padding: 3px 5px; border: 1px solid #e0e7f0; border-radius: 4px; color: #73849c; background: #f6f8fc; font-size: 10px; font-weight: 500; line-height: 1; }
.csys-command-desktop-actions, .csys-command-toolbar--desktop { display: flex; align-items: center; gap: 8px; }
.csys-command-mobile, .csys-command-toolbar--mobile { display: none; }
.csys-command-topbar { grid-template-columns: minmax(0, 1fr) auto auto; }
.csys-command-topbar .csys-portal-actions { display: none !important; }

.csys-command-dialog {
    --csys-command-dialog-top: min(10vh, 80px);
    box-sizing: border-box;
    width: min(680px, calc(100vw - 32px));
    max-width: none;
    max-height: min(680px, calc(100vh - var(--csys-command-dialog-top) - 24px));
    max-height: min(680px, calc(100dvh - var(--csys-command-dialog-top) - 24px));
    margin: var(--csys-command-dialog-top) auto auto;
    padding: 0;
    border: 1px solid #dce5f0;
    border-radius: 16px;
    background: #fff;
    color: #203650;
    box-shadow: 0 24px 75px #08182e38;
    overflow: hidden;
    font-family: inherit;
}
.csys-command-dialog:not([open]):not(.csys-command-fallback-open) { display: none; }
.csys-command-dialog[open], .csys-command-dialog.csys-command-fallback-open { display: flex; flex-direction: column; }
.csys-command-dialog::backdrop { background: #0b192b80; }
.csys-command-dialog > :not(.csys-command-results) { flex-shrink: 0; }
.csys-command-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px 0; }
.csys-command-title { margin: 0; color: #1d3657; font-size: 16px; font-weight: 650; letter-spacing: -.02em; line-height: 1.35; }
.csys-command-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid #e5ebf3; border-radius: 8px; background: #fff; color: #6c7e96; cursor: pointer; }
.csys-command-close:hover { background: #f4f7fb; color: #243f62; }
.csys-command-close svg { width: 18px; height: 18px; }
.csys-command-form { position: relative; margin: 0; padding: 15px 22px 17px; border-bottom: 1px solid #e8edf4; }
.csys-command-form > svg { position: absolute; pointer-events: none; left: 35px; top: 28px; width: 20px; height: 20px; color: #627e9f; }
.csys-command-input { box-sizing: border-box; display: block; width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #d8e2ee; border-radius: 10px; background: #f8fafd; color: #243e60; font: inherit; font-size: 16px; line-height: 1.4; appearance: none; }
.csys-command-form-with-icon .csys-command-input { padding-left: 42px; }
.csys-command-input::placeholder { color: #7b8ca3; opacity: 1; }
.csys-command-input:focus { border-color: #769bd0; outline: 3px solid #356fba17; outline-offset: 0; background: #fff; }
.csys-command-results { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 6px 10px; scrollbar-width: thin; scrollbar-color: #c2cedc transparent; }
.csys-command-results:empty { padding: 0; }
.csys-command-group { margin: 0; padding: 3px 0 8px; }
.csys-command-group-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 12px 7px; color: #6b7f9b; font-size: 10px; font-weight: 650; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
.csys-command-group-count { color: #7b8ca3; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.csys-command-result { display: flex; align-items: center; gap: 12px; margin: 2px 0; padding: 11px 12px; border: 1px solid transparent; border-radius: 9px; color: #274566; text-decoration: none; cursor: pointer; }
.csys-command-result:hover, .csys-command-result.csys-command-result-active { border-color: #dbe7f7; background: #eff5fd; color: #183b67; text-decoration: none; }
.csys-command-result-copy { flex: 1 1 auto; min-width: 0; }
.csys-command-result-title { display: block; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; line-height: 1.35; }
.csys-command-result-meta { display: block; margin-top: 4px; color: #697e99; font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.csys-command-result-action { flex: 0 0 auto; padding: 4px 6px; border: 1px solid #dce6f3; border-radius: 5px; color: #6d87a8; background: #ffffffb3; font-size: 12px; line-height: 1; opacity: 0; }
.csys-command-result-active .csys-command-result-action { opacity: 1; }
.csys-command-status { margin: 0; padding: 15px 22px 17px; border-top: 1px solid #edf1f6; color: #657b96; font-size: 12px; line-height: 1.5; }
.csys-command-status:empty { display: none; }
.csys-command-help { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 10px 22px; border-top: 1px solid #edf1f6; color: #7a8ba2; font-size: 10px; }
.csys-command-help kbd { margin-right: 3px; padding: 2px 4px; border: 1px solid #e1e8f1; border-radius: 4px; background: #f7f9fc; color: #627b9b; font: inherit; }
.csys-command-backdrop { position: fixed; inset: 0; z-index: 1200; background: #0b192b80; }
.csys-command-dialog.csys-command-fallback-open { position: fixed; z-index: 1201; inset: 0; }

.csys-command-create-menu { box-sizing: border-box; position: fixed; z-index: 1200; width: min(292px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 7px; border: 1px solid #dce5f0; border-radius: 12px; background: #fff; color: #243e60; box-shadow: 0 14px 45px #0b203b24; overscroll-behavior: contain; }
.csys-command-create-menu :is(a, button) { display: flex; align-items: center; gap: 10px; min-height: 42px; margin: 2px 0; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #314f73; font: inherit; font-size: 13px; line-height: 1.35; text-align: left; text-decoration: none; }
.csys-command-create-menu :is(a, button):hover { background: #eff5fd; color: #1e456f; text-decoration: none; }
.csys-command-create-menu svg { width: 18px; height: 18px; flex: 0 0 18px; color: #6e88a8; }
.csys-command-create-menu-label { margin: 0; padding: 8px 10px; color: #7b8da5; font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.csys-command-create-label { display: block; color: inherit; font-size: 13px; font-weight: 600; }
.csys-command-create-description { display: block; margin-top: 3px; color: #7085a0; font-size: 11px; font-weight: 400; line-height: 1.4; }
.csys-command-dialog[hidden], .csys-command-create-menu[hidden], .csys-command-backdrop[hidden], .csys-command-trigger[hidden] { display: none !important; }

@media (min-width: 992px) and (max-width: 1199.98px) {
    .csys-command-toolbar--desktop .csys-command-trigger-label { display: none; }
    .csys-command-toolbar--desktop .csys-command-trigger-action { display: none; }
    .csys-command-toolbar--desktop .csys-command-trigger:not(.csys-command-trigger-create) { width: 38px; min-width: 38px; padding-inline: 8px; }
    .csys-command-toolbar--desktop .csys-command-trigger-create { width: auto; }
    .csys-command-toolbar--desktop .csys-command-shortcut { display: none; }
}
@media (max-width: 991.98px) {
    .csys-command-topbar { grid-template-columns: minmax(0, 1fr) auto; }
    body:not(.csys-portal) .csys-command-topbar { grid-template-columns: minmax(0, 1fr); }
    .csys-command-desktop-actions, .csys-command-toolbar--desktop { display: none; }
    .csys-command-mobile, .csys-command-toolbar--mobile { display: flex; gap: 8px; margin: 10px 18px 0; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-trigger { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 8px; border-color: #ffffff1c; background: #ffffff06; color: #dce7f6; font-size: 12px; box-shadow: none; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-trigger:hover { background: #ffffff10; color: #fff; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-trigger-search { gap: 6px; border-color: #accbf93d; background: #d8e7ff12; color: #eaf3ff; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-trigger-search:hover { border-color: #accbf966; background: #d8e7ff20; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-trigger-action { color: #a6c3e9; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-trigger-create { border-color: #7fa9e048; background: #8eb7ef14; color: #eff5ff; }
    :is(.csys-command-mobile, .csys-command-toolbar--mobile) .csys-command-shortcut { display: none; }
}
@media (max-width: 575px) {
    .csys-command-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin-top: 16px; border-radius: 13px; }
    .csys-command-header { padding: 13px 15px 0; }
    .csys-command-title { font-size: 15px; }
    .csys-command-close { width: 40px; height: 40px; }
    .csys-command-form { padding: 12px 15px 14px; }
    .csys-command-form > svg { left: 28px; top: 25px; }
    .csys-command-results { padding-inline: 6px; }
    .csys-command-result { min-height: 48px; padding: 10px; }
    .csys-command-result-title { font-size: 14px; }
    .csys-command-result-meta { font-size: 12px; }
    .csys-command-status { padding: 13px 15px; }
    .csys-command-help { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .csys-command-dialog, .csys-command-create-menu, .csys-command-result { scroll-behavior: auto; }
}
