/* Shared utility classes used by front and admin pages */
.u-inline { display: inline; }
.u-inline-block { display: inline-block; }
.u-block { display: block; }
.u-flex { display: flex; }
.u-flex-wrap { display: flex; flex-wrap: wrap; }
.u-flex-between { display: flex; justify-content: space-between; align-items: center; }
.u-flex-between-wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.u-items-center { align-items: center; }
.u-gap-8 { gap: 8px; }
.u-gap-10 { gap: 10px; }
.u-gap-12 { gap: 12px; }

.u-mt-0 { margin-top: 0 !important; }
.u-mt-4 { margin-top: 4px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-10 { margin-top: 10px; }
.u-mt-12 { margin-top: 12px; }
.u-mt-14 { margin-top: 14px; }
.u-mt-20 { margin-top: 20px; }
.u-mt-30 { margin-top: 30px; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-10 { margin-bottom: 10px; }
.u-mb-12 { margin-bottom: 12px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mb-15 { margin-bottom: 15px; }
.u-mb-16 { margin-bottom: 16px; }
.u-mb-20 { margin-bottom: 20px; }
.u-mb-30 { margin-bottom: 30px; }
.u-ml-5 { margin-left: 5px; }
.u-ml-10 { margin-left: 10px; }
.u-ml-12 { margin-left: 12px; }
.u-mr-6 { margin-right: 6px; }
.u-mx-6 { margin-left: 6px; margin-right: 6px; }
.u-mx-auto { margin-left: auto; margin-right: auto; }
.u-my-15 { margin-top: 15px; margin-bottom: 15px; }

.u-p-15 { padding: 15px; }
.u-p-20 { padding: 20px; }
.u-p-40 { padding: 40px; }
.u-px-20 { padding-left: 20px; padding-right: 20px; }
.u-py-50 { padding-top: 50px; padding-bottom: 50px; }

.u-w-100 { width: 100px; }
.u-w-220 { width: 220px; }
.u-w-300 { width: 300px; }
.u-w-auto { width: auto; }
.u-minw-160 { min-width: 160px; }
.u-maxw-300 { max-width: 300px; }
.u-maxw-400 { max-width: 400px; }
.u-maxw-600 { max-width: 600px; }
.u-img-responsive { width: 100%; height: auto; }

.u-text-center { text-align: center; }
.u-text-left { text-align: left; }
.u-text-muted { color: #999; }
.u-text-muted-2 { color: #888; }
.u-text-muted-3 { color: #ccc; }
.u-text-soft { color: #a6a6a6; }
.u-text-soft-2 { color: #777; }
.u-text-white { color: #fff; }
.u-text-dark { color: #333; }
.u-text-gray { color: #666; }
.u-text-danger { color: #dc3545 !important; }
.u-text-success { color: #0a0; }
.u-text-warning { color: #a80; }

.u-fs-08 { font-size: 0.8rem; }
.u-fs-16 { font-size: 16px; }
.u-fs-20 { font-size: 20px; }
.u-fs-24 { font-size: 24px; }
.u-lh-16 { line-height: 1.6; }
.u-lh-18 { line-height: 1.8; }
.u-fw-600 { font-weight: 600; }
.u-fw-700 { font-weight: 700; }

.u-panel-border {
    border: 1px solid #666;
    border-radius: 8px;
    padding: 12px;
}

.u-stat-card {
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    padding: 10px;
    min-width: 180px;
    background: #1d1d1d;
}

.u-note-panel {
    background-color: #2a2a2a;
    border-radius: 5px;
    border: 1px solid #444;
}

.u-info-callout {
    background-color: #1a3a5c;
    border-radius: 5px;
    border: 1px solid #2a5a8c;
}

.u-qr-panel {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.u-alert-inline-success {
    color: #0a0;
    border: 1px solid #0a0;
    padding: 8px;
    margin-bottom: 10px;
}

.u-danger-bg {
    background: #9b2c2c !important;
    border-color: #b14343 !important;
    color: #fff !important;
}

.u-accent-bg {
    background: #805ad5 !important;
    border-color: #9b79e8 !important;
    color: #fff !important;
}

.service-button-muted {
    background-color: #444;
    border-color: #666;
}

.service-button-accent {
    background-color: #5c3e8d;
    border-color: #7d57b8;
}

.bbs-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 8px;
    border: 1px solid #3c4654;
    border-radius: 6px;
    background: #171b22;
}

.bbs-editor-label {
    color: #aeb8c6;
    font-size: 0.84rem;
    line-height: 1;
    margin-right: 2px;
}

.bbs-editor-button,
.bbs-editor-select {
    height: 32px;
    border: 1px solid #4d5b6d;
    border-radius: 5px;
    background: #222936;
    color: #eef4ff;
    font-size: 0.88rem;
}

.bbs-editor-button {
    min-width: 34px;
    padding: 0 9px;
    cursor: pointer;
}

.bbs-editor-button:hover,
.bbs-editor-select:hover {
    border-color: #6aa0d8;
    background: #2b3545;
}

.bbs-editor-button:focus,
.bbs-editor-select:focus {
    outline: none;
    border-color: #79b7f0;
    box-shadow: 0 0 0 3px rgba(121, 183, 240, 0.18);
}

.bbs-editor-select {
    min-width: 104px;
    padding: 0 8px;
}

.bbs-editor-hint {
    color: #8190a4;
    font-size: 0.8rem;
}

.bbs-emote {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: -5px;
    object-fit: contain;
}

.bbs-emote-picker {
    position: fixed;
    z-index: 1000;
    display: none;
    width: min(306px, calc(100vw - 24px));
    max-height: min(360px, calc(100vh - 24px));
    box-sizing: border-box;
    overflow: hidden;
    padding: 10px;
    border: 1px solid #4d5b6d;
    border-radius: 8px;
    background: #121820;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.bbs-emote-picker.is-open {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbs-emote-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 28px;
}

.bbs-emote-picker-title {
    color: #d7ecff;
    font-size: 0.84rem;
    font-weight: 600;
}

.bbs-emote-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #3c4654;
    border-radius: 6px;
    background: #202734;
    color: #d7ecff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.bbs-emote-close:hover,
.bbs-emote-close:focus {
    outline: none;
    border-color: #79b7f0;
    background: #2b3545;
}

.bbs-emote-pack-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #2b3545;
}

.bbs-emote-pack-tab {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #3c4654;
    border-radius: 6px;
    background: #1c2430;
    color: #b9c7d8;
    cursor: pointer;
}

.bbs-emote-pack-tab:hover,
.bbs-emote-pack-tab:focus,
.bbs-emote-pack-tab.active {
    outline: none;
    border-color: #79b7f0;
    background: #2b3545;
    color: #eef4ff;
}

.bbs-emote-grid {
    display: grid;
    grid-template-columns: repeat(4, 60px);
    gap: 8px;
    align-content: start;
    justify-content: start;
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-right: 2px;
}

.bbs-emote-choice {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #3c4654;
    border-radius: 6px;
    background: #202734;
    cursor: pointer;
}

.bbs-emote-choice:hover,
.bbs-emote-choice:focus {
    outline: none;
    border-color: #79b7f0;
    background: #2b3545;
}

.bbs-emote-choice img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.bbs-emote-admin-preview {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.bbs-emote-command-preview {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #111827;
    color: #d7ecff;
    white-space: nowrap;
}

.bbs-emote-enabled-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bbs-emote-sort-input {
    max-width: 96px;
}
