/* ===== CSS dùng chung cho ứng dụng (bổ sung cho Bootstrap 5) ===== */

html, body {
    font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
    background-color: #f6f7f9;
}

a, .btn-link {
    color: #0d6efd;
}

/* ---- Bố cục sidebar trái + nội dung ---- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #1f2937;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar .nav-link {
    color: #cbd5e1;
    padding: .6rem 1.25rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar .nav-link.active {
    background: #0d6efd;
    color: #fff;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.app-content {
    padding: 1.25rem;
    flex: 1;
}

/* ---- Responsive: dưới breakpoint md (768px) của Bootstrap ----
   Sidebar chuyển thành thanh trên cùng; menu thu gọn bằng Bootstrap collapse
   (#sidebarNav .collapse, mở bằng nút hamburger trong .brand). */
@media (max-width: 767.98px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .app-content { padding: 1rem; }
    .app-topbar { padding: 0 .75rem; }
}

/* ---- Badge trạng thái ---- */
.badge-draft { background: #6c757d; }
.badge-approved { background: #198754; }
.badge-pending { background: #fd7e14; }
.badge-rejected { background: #dc3545; }
.badge-locked { background: #343a40; }

/* ---- Cảnh báo thiếu consent ---- */
.consent-warning { color: #dc3545; font-weight: 600; }

/* ---- Trang Cặp câu: thẻ duyệt trên mobile ---- */
.sp-card { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,.04); }

.sp-line {
    display: flex;
    gap: .5rem;
    align-items: baseline;
    margin-bottom: .25rem;
}

/* Nhãn ngôn ngữ VI / ÊĐ đứng đầu mỗi câu */
.sp-lang {
    flex-shrink: 0;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.4;
    padding: .05rem .4rem;
    border-radius: .35rem;
    color: #fff;
}
.sp-lang-vi { background: #0d6efd; }      /* tiếng Việt */
.sp-lang-ede { background: #198754; }     /* tiếng Ê Đê */

.sp-text { word-break: break-word; }
/* Câu tiếng Việt (dòng đầu) đậm hơn cho dễ đọc */
.sp-line:first-of-type .sp-text { font-weight: 600; }

/* Thanh lọc dính trên cùng khi cuộn (mobile) để luôn thao tác được */
@media (max-width: 767.98px) {
    .sp-filterbar {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #f6f7f9;
        padding-top: .5rem;
        padding-bottom: .5rem;
    }
}

/* ===== Blazor error UI ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===== Reconnect modal ===== */
.components-reconnect-hide { display: none; }

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.reconnect-box {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: .5rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

#components-reconnect-modal .reload-link { display: none; }
#components-reconnect-modal.components-reconnect-failed .reload-link,
#components-reconnect-modal.components-reconnect-rejected .reload-link { display: inline-block; }
