/* ==========================================================================
   AVCCMS Admin Panel
   Lightweight, professional, responsive. No external dependencies.
   ========================================================================== */

:root {
    --bc-bg:           #f4f6fb;
    --bc-surface:      #ffffff;
    --bc-surface-2:    #f8fafc;
    --bc-border:       #e4e8f0;
    --bc-border-2:     #eef1f7;
    --bc-text:         #1f2733;
    --bc-text-soft:    #5b6675;
    --bc-text-muted:   #8a94a6;
    --bc-primary:      #3056d3;
    --bc-primary-600:  #2743b0;
    --bc-primary-soft: #eef2ff;
    --bc-success:      #1f9d6b;
    --bc-success-soft: #e6f7ef;
    --bc-danger:       #d6455a;
    --bc-danger-soft:  #fcebed;
    --bc-warning:      #c8860a;
    --bc-warning-soft: #fdf3e0;
    --bc-sidebar:      #161e2e;
    --bc-sidebar-2:    #1d273b;
    --bc-sidebar-text: #aeb8cc;
    --bc-sidebar-active:#ffffff;
    --bc-radius:       10px;
    --bc-radius-sm:    7px;
    --bc-shadow:       0 1px 3px rgba(20,30,55,.06), 0 1px 2px rgba(20,30,55,.04);
    --bc-shadow-lg:    0 10px 40px rgba(20,30,55,.12);
    --bc-sidebar-w:    250px;
    --bc-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
}

body {
    font-family: var(--bc-font);
    background: var(--bc-bg);
    color: var(--bc-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--bc-primary); text-decoration: none; }
a:hover { color: var(--bc-primary-600); }

/* ---------- Layout ---------- */
.bc-app { display: flex; min-height: 100vh; }

.bc-sidebar {
    width: var(--bc-sidebar-w);
    background: var(--bc-sidebar);
    color: var(--bc-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform .25s ease;
}

.bc-brand {
    display: flex; align-items: center;
    padding: 18px 20px 14px;
    color: #fff;
    min-height: 74px;
}
.bc-brand:hover { color: #fff; }
.bc-brand .bc-logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--bc-primary), #5a78f0);
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 16px;
    box-shadow: 0 4px 14px rgba(48,86,211,.45);
}
.bc-brand-logo {
    display: block;
    width: min(178px, 100%);
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

.bc-nav {
    padding: 8px 12px; flex: 1; overflow-y: auto;
    /* Slim, dark-themed scrollbar so the default white browser bar doesn't
       show against the dark sidebar on desktop. */
    scrollbar-width: thin;
    scrollbar-color: var(--bc-sidebar-2) transparent;
}
.bc-nav::-webkit-scrollbar { width: 8px; }
.bc-nav::-webkit-scrollbar-track { background: transparent; }
.bc-nav::-webkit-scrollbar-thumb {
    background: var(--bc-sidebar-2);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.bc-nav::-webkit-scrollbar-thumb:hover { background: #2a374f; background-clip: padding-box; }
.bc-nav-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: #5d6884; padding: 16px 12px 6px; font-weight: 600;
}
.bc-nav-section {
    margin-bottom: 6px;
}
.bc-nav-primary {
    margin-bottom: 12px;
}
.bc-nav-toggle {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--bc-radius-sm);
    background: transparent;
    color: #7f8ba5;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: background .15s, color .15s;
}
.bc-nav-toggle:hover {
    background: rgba(255,255,255,.04);
    color: #d7def0;
}
.bc-nav-toggle svg {
    width: 15px;
    height: 15px;
    opacity: .75;
    transition: transform .18s ease;
}
.bc-nav-section.is-open .bc-nav-toggle svg {
    transform: rotate(180deg);
}
.bc-nav-panel {
    display: none;
    padding-top: 2px;
}
.bc-nav-section.is-open .bc-nav-panel {
    display: block;
}
.bc-nav-context {
    margin: 2px 12px 7px;
    padding: 8px 10px;
    border-radius: var(--bc-radius-sm);
    background: rgba(255,255,255,.04);
    color: #d7def0;
    font-size: 12px;
    font-weight: 600;
}
.bc-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--bc-radius-sm);
    color: var(--bc-sidebar-text); font-weight: 500;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.bc-nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.bc-nav a:hover { background: var(--bc-sidebar-2); color: #fff; }
.bc-nav a.is-active {
    background: linear-gradient(90deg, rgba(48,86,211,.25), rgba(48,86,211,.05));
    color: var(--bc-sidebar-active);
    box-shadow: inset 2px 0 0 var(--bc-primary);
}
.bc-nav a.is-active svg { opacity: 1; }

.bc-sidebar-foot {
    padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07);
    font-size: 12px; color: #5d6884;
}

/* ---------- Main ---------- */
.bc-main {
    flex: 1; margin-left: var(--bc-sidebar-w);
    display: flex; flex-direction: column; min-width: 0;
}

.bc-topbar {
    height: 62px; background: var(--bc-surface);
    border-bottom: 1px solid var(--bc-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.bc-topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.bc-topbar-left { display: flex; align-items: center; gap: 14px; }

.bc-burger {
    display: none; width: 38px; height: 38px; border-radius: 8px;
    border: 1px solid var(--bc-border); background: var(--bc-surface);
    cursor: pointer; align-items: center; justify-content: center;
}
.bc-burger svg { width: 20px; height: 20px; color: var(--bc-text); }

.bc-user-menu { position: relative; }
.bc-user-btn {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    border: 1px solid var(--bc-border); background: var(--bc-surface);
    padding: 6px 10px 6px 6px; border-radius: 40px;
}
.bc-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--bc-primary), #5a78f0);
    color: #fff; display: grid; place-items: center;
    font-weight: 600; font-size: 13px;
}
.bc-user-name { font-weight: 600; font-size: 13px; }
.bc-user-role { font-size: 11px; color: var(--bc-text-muted); }
.bc-dropdown {
    position: absolute; right: 0; top: 48px; min-width: 180px;
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius); box-shadow: var(--bc-shadow-lg);
    padding: 6px; display: none;
}
.bc-dropdown.is-open { display: block; }
.bc-dropdown a, .bc-dropdown button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border-radius: var(--bc-radius-sm);
    color: var(--bc-text); font-size: 13px; font-weight: 500;
    background: none; border: none; cursor: pointer; text-align: left;
    font-family: inherit;
}
.bc-dropdown a:hover, .bc-dropdown button:hover { background: var(--bc-surface-2); }
.bc-dropdown svg { width: 16px; height: 16px; opacity: .7; }

.bc-content { padding: 28px 32px; max-width: 1440px; width: 100%; }

/* ---------- Page header ---------- */
.bc-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.bc-page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.bc-page-head p { color: var(--bc-text-soft); margin-top: 3px; }

/* ---------- Cards ---------- */
.bc-card {
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius); box-shadow: var(--bc-shadow);
}
.bc-card-head {
    padding: 16px 20px; border-bottom: 1px solid var(--bc-border-2);
    display: flex; align-items: center; justify-content: space-between;
}
.bc-card-head h3 { font-size: 15px; font-weight: 600; }
.bc-card-body { padding: 20px; }

.bc-grid { display: grid; gap: 18px; }
.bc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.bc-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Stat cards */
.bc-stat {
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius); box-shadow: var(--bc-shadow);
    padding: 20px; display: flex; align-items: center; gap: 16px;
}
.bc-stat-icon {
    width: 48px; height: 48px; border-radius: 12px; flex: none;
    display: grid; place-items: center; color: var(--bc-primary);
    background: var(--bc-primary-soft);
}
.bc-stat-icon svg { width: 24px; height: 24px; }
.bc-stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.bc-stat-label { color: var(--bc-text-muted); font-size: 13px; }

/* ---------- Tables ---------- */
.bc-table-wrap { overflow-x: auto; }
table.bc-table { width: 100%; border-collapse: collapse; }
.bc-table th {
    text-align: left; font-size: 12px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--bc-text-muted); font-weight: 600;
    padding: 12px 16px; border-bottom: 1px solid var(--bc-border-2);
    background: var(--bc-surface-2);
}
.bc-table td { padding: 13px 16px; border-bottom: 1px solid var(--bc-border-2); vertical-align: middle; }
.bc-table tr:last-child td { border-bottom: none; }
.bc-table tr:hover td { background: var(--bc-surface-2); }

/* ---------- Badges ---------- */
.bc-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 600;
}
.bc-badge.is-success { background: var(--bc-success-soft); color: var(--bc-success); }
.bc-badge.is-danger  { background: var(--bc-danger-soft);  color: var(--bc-danger); }
.bc-badge.is-warning { background: var(--bc-warning-soft); color: var(--bc-warning); }
.bc-badge.is-info    { background: var(--bc-primary-soft); color: var(--bc-primary); }
.bc-badge.is-muted   { background: var(--bc-surface-2);    color: var(--bc-text-muted); }

/* ---------- Buttons ---------- */
.bc-btn {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    padding: 9px 16px; border-radius: var(--bc-radius-sm); font-size: 13.5px;
    font-weight: 600; cursor: pointer; border: 1px solid transparent;
    font-family: inherit; transition: background .15s, border-color .15s, transform .05s;
    white-space: nowrap;
}
.bc-btn:active { transform: translateY(1px); }
.bc-btn svg { width: 16px; height: 16px; }
.bc-btn-primary { background: var(--bc-primary); color: #fff; }
.bc-btn-primary:hover { background: var(--bc-primary-600); color: #fff; }
.bc-btn-ghost { background: var(--bc-surface); border-color: var(--bc-border); color: var(--bc-text); }
.bc-btn-ghost:hover { background: var(--bc-surface-2); }
.bc-btn-danger { background: var(--bc-danger); color: #fff; }
.bc-btn-danger:hover { background: #bd3a4d; color: #fff; }
.bc-btn-sm { padding: 6px 12px; font-size: 12.5px; }
.bc-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.bc-form-group { margin-bottom: 18px; }
.bc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bc-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--bc-text); }
.bc-hint { font-size: 12px; color: var(--bc-text-muted); margin-top: 5px; }
.bc-input, .bc-select, .bc-textarea {
    width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--bc-border); border-radius: var(--bc-radius-sm);
    background: var(--bc-surface); color: var(--bc-text); transition: border-color .15s, box-shadow .15s;
}
.bc-input:focus, .bc-select:focus, .bc-textarea:focus {
    outline: none; border-color: var(--bc-primary);
    box-shadow: 0 0 0 3px rgba(48,86,211,.12);
}
.bc-textarea { resize: vertical; min-height: 90px; }

.bc-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.bc-switch input { display: none; }
.bc-switch-track {
    width: 42px; height: 24px; border-radius: 30px; background: var(--bc-border);
    position: relative; transition: background .2s;
}
.bc-switch-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.bc-switch input:checked + .bc-switch-track { background: var(--bc-primary); }
.bc-switch input:checked + .bc-switch-track::after { transform: translateX(18px); }

/* ---------- Tabs ---------- */
.bc-tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--bc-border); margin-bottom: 22px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.bc-tabs::-webkit-scrollbar { display: none; }
.bc-tab {
    padding: 11px 16px; font-weight: 600; font-size: 13.5px; color: var(--bc-text-soft);
    cursor: pointer; border: none; background: none; font-family: inherit;
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; flex: none;
}
.bc-tab:hover { color: var(--bc-text); }
.bc-tab.is-active { color: var(--bc-primary); border-bottom-color: var(--bc-primary); }
.bc-tab-panel { display: none; }
.bc-tab-panel.is-active { display: block; }

/* ---------- Notices ---------- */
.bc-notice {
    padding: 12px 16px; border-radius: var(--bc-radius-sm); margin-bottom: 20px;
    font-weight: 500; display: flex; align-items: center; gap: 10px;
    background: var(--bc-success-soft); color: var(--bc-success);
    border: 1px solid rgba(31,157,107,.2);
}
.bc-notice.is-error {
    background: var(--bc-danger-soft); color: var(--bc-danger);
    border-color: rgba(214,69,90,.2);
}
.bc-notice.is-warning {
    background: var(--bc-warning-soft); color: var(--bc-warning);
    border-color: rgba(200,134,10,.2);
}
.bc-notice.is-info {
    background: var(--bc-primary-soft); color: var(--bc-primary);
    border-color: rgba(48,86,211,.2);
}
.bc-notice svg { width: 18px; height: 18px; flex: none; }

/* ---------- Module / Theme / Plugin cards ---------- */
.bc-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.bc-module {
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius); box-shadow: var(--bc-shadow);
    display: flex; flex-direction: column; overflow: hidden;
}
.bc-module-thumb {
    height: 120px; background: linear-gradient(135deg, #2a3550, #3a4a72);
    display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 30px; font-weight: 800;
}
.bc-module-body { padding: 16px 18px; flex: 1; }
.bc-module-body h4 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.bc-module-meta { font-size: 12px; color: var(--bc-text-muted); margin: 4px 0 10px; }
.bc-module-desc {
    color: var(--bc-text-soft);
    font-size: 13px;
    line-height: 1.55;
    /* Clamp long descriptions to 3 lines so a wordy plugin can't stretch the
       card down the page. The full text remains available via the title
       attribute (hover tooltip). */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.55em * 3);
}
.bc-module-foot {
    padding: 12px 18px; border-top: 1px solid var(--bc-border-2);
    display: flex; gap: 8px; align-items: center; justify-content: space-between;
}

.bc-empty { text-align: center; padding: 50px 20px; color: var(--bc-text-muted); }
.bc-empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 12px; }

/* ---------- Error pages ---------- */
.bc-error-body {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(48,86,211,.12), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, var(--bc-bg) 100%);
}
.bc-error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}
.bc-error-card {
    width: min(100%, 520px);
    background: var(--bc-surface);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius);
    box-shadow: var(--bc-shadow-lg);
    padding: 36px;
    text-align: center;
}
.bc-error-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: var(--bc-danger-soft);
    color: var(--bc-danger);
}
.bc-error-mark svg {
    width: 30px;
    height: 30px;
}
.bc-error-code {
    color: var(--bc-primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .14em;
    margin-bottom: 8px;
}
.bc-error-card h1 {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 10px;
}
.bc-error-card p {
    color: var(--bc-text-soft);
    font-size: 15px;
    margin: 0 auto 24px;
    max-width: 360px;
}
.bc-error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Modal ---------- */
.bc-modal-overlay {
    position: fixed; inset: 0; background: rgba(20,30,55,.5);
    display: none; align-items: flex-start; justify-content: center;
    padding: 50px 16px; z-index: 60; overflow-y: auto;
    backdrop-filter: blur(2px);
}
.bc-modal-overlay.is-open { display: flex; }
.bc-modal {
    background: var(--bc-surface); border-radius: var(--bc-radius);
    box-shadow: var(--bc-shadow-lg); width: 100%; max-width: 520px;
    animation: bc-modal-in .2s ease;
}
@keyframes bc-modal-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.bc-modal-head { padding: 18px 22px; border-bottom: 1px solid var(--bc-border-2); display: flex; align-items: center; justify-content: space-between; }
.bc-modal-head h3 { font-size: 16px; font-weight: 700; }
.bc-modal-close { background: none; border: none; cursor: pointer; color: var(--bc-text-muted); font-size: 22px; line-height: 1; }
.bc-modal-body { padding: 22px; }
.bc-modal-foot { padding: 16px 22px; border-top: 1px solid var(--bc-border-2); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Search ---------- */
.bc-toolbar { margin-bottom: 18px; }
.bc-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--bc-text); }
.bc-check input { width: 16px; height: 16px; cursor: pointer; }
.bc-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 380px; }
.bc-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--bc-text-muted); pointer-events: none; display: flex;
}
.bc-search-icon svg { width: 16px; height: 16px; }
.bc-search-input { padding-left: 36px; }

/* ---------- Pagination ---------- */
.bc-pagination {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 16px 20px; border-top: 1px solid var(--bc-border-2);
}
.bc-btn.is-disabled { opacity: .45; pointer-events: none; cursor: default; }

/* ---------- Utilities ---------- */
.bc-flex { display: flex; align-items: center; gap: 10px; }
.bc-gap { gap: 10px; }
.bc-mt { margin-top: 16px; }
.bc-text-muted { color: var(--bc-text-muted); }
.bc-overlay-backdrop { display: none; }

/* ---------- Error audit ---------- */
.ea-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.ea-stat {
    padding: 14px 16px;
    min-height: 82px;
    box-shadow: none;
}
.ea-stat .bc-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}
.ea-stat .bc-stat-icon svg {
    width: 20px;
    height: 20px;
}
.ea-stat .bc-stat-value {
    font-size: 22px;
}
.ea-filter {
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: none;
}
.ea-filter-grid {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(240px, 1.6fr) auto;
    gap: 12px;
    align-items: end;
}
.ea-filter .bc-label {
    margin-bottom: 5px;
}
.ea-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.ea-table-card {
    overflow: hidden;
}
.ea-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bc-border-2);
}
.ea-table th,
.ea-table td {
    padding: 11px 14px;
}
.ea-table td {
    vertical-align: top;
}
.ea-message-cell {
    width: 52%;
}
.ea-details summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}
.ea-details summary::-webkit-details-marker {
    display: none;
}
.ea-details summary span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}
.ea-details summary em {
    flex: none;
    font-style: normal;
    color: var(--bc-primary);
    font-weight: 700;
    font-size: 12px;
}
.ea-detail-body {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--bc-radius-sm);
    background: var(--bc-surface-2);
    color: var(--bc-text);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 1100px) {
    .ea-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ea-filter-grid { grid-template-columns: 1fr 1fr; }
    .ea-filter-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
    .ea-stats,
    .ea-filter-grid { grid-template-columns: 1fr; }
    .ea-table-head { align-items: flex-start; flex-direction: column; }
    .ea-message-cell { width: auto; }
}

/* ---------- Theme Modules ---------- */
.theme-module-list {
    display: grid;
    gap: 10px;
}
.theme-module-row {
    display: grid;
    grid-template-columns: 34px auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--bc-border-2);
    border-radius: var(--bc-radius-sm);
    background: var(--bc-surface);
}
.theme-module-row.is-dragging {
    opacity: .65;
    border-color: var(--bc-primary);
}
.theme-module-drag {
    width: 34px;
    height: 34px;
    border-radius: var(--bc-radius-sm);
    display: grid;
    place-items: center;
    color: var(--bc-text-muted);
    background: var(--bc-surface-2);
    cursor: grab;
    user-select: none;
}
.theme-module-drag:active {
    cursor: grabbing;
}
.theme-module-info {
    display: grid;
    gap: 2px;
}
.theme-module-info span {
    color: var(--bc-text-muted);
    font-size: 12px;
}
.theme-module-switch {
    margin: 0;
}
.theme-module-textarea {
    min-height: 62px;
}

/* ---------- Todo sticky notes ---------- */
.todo-page {
    display: grid;
    gap: 22px;
}

.todo-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bc-text-soft);
    font-size: 13px;
}

.todo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.todo-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #1d2d44;
    font-size: 28px;
    font-weight: 650;
    letter-spacing: 0;
}

.todo-head h2 svg {
    width: 27px;
    height: 27px;
}

.todo-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.todo-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: #111827;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
}

.todo-filter span {
    display: grid;
    place-items: center;
}

.todo-filter svg {
    width: 15px;
    height: 15px;
}

.todo-filter b {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.todo-filter.is-all {
    color: #1f2733;
}

.todo-filter.is-all b {
    background: #1f2733;
}

.todo-filter.is-open {
    color: #f59e0b;
}

.todo-filter.is-open b {
    background: #fbbf24;
    color: #111827;
}

.todo-filter.is-completed {
    color: #059669;
}

.todo-filter.is-completed b {
    background: #059669;
}

.todo-filter.is-active.is-all {
    color: #fff;
    background: #1f2733;
    border-color: #1f2733;
    box-shadow: 0 8px 18px rgba(20, 30, 55, .22);
}

.todo-filter.is-active.is-all b {
    background: #fff;
    color: #1f2733;
}

.todo-filter.is-active.is-open {
    background: #fff7d6;
}

.todo-filter.is-active.is-completed {
    background: #e8fff3;
}

.todo-compose,
.todo-note {
    position: relative;
    width: min(100%, 500px);
    border-radius: 2px;
    box-shadow: 0 8px 16px rgba(20, 30, 55, .16);
}

.todo-compose {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 10px;
}

.todo-compose.is-yellow,
.todo-note.is-yellow {
    background: #fff9bc;
}

.todo-note.is-green {
    background: #c8eac9;
}

.todo-note.is-blue {
    background: #aed6f4;
}

.todo-compose textarea {
    width: 100%;
    min-height: 94px;
    resize: vertical;
    padding: 14px;
    border: 2px dashed rgba(120, 118, 66, .28);
    border-radius: 0;
    color: #1f2733;
    background: transparent;
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    outline: 0;
}

.todo-compose textarea:focus {
    border-color: rgba(48, 86, 211, .38);
}

.todo-compose > div {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.todo-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 395px));
    gap: 36px 14px;
    align-items: start;
}

.todo-dashboard-card .bc-card-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-dashboard-card .bc-card-head a {
    font-size: 12px;
    font-weight: 600;
}

.todo-dashboard-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 18px 16px 16px;
}

.todo-dashboard-board .todo-note {
    width: 100%;
    min-height: 150px;
    box-shadow: 0 6px 12px rgba(20, 30, 55, .13);
}

.todo-dashboard-board .todo-note p {
    min-height: 72px;
    font-size: 13px;
}

.todo-note {
    display: grid;
    min-height: 160px;
    padding: 25px 16px 15px;
    overflow: visible;
}

.todo-note::after {
    content: "";
    position: absolute;
    inset: auto 10px 0 auto;
    width: 34%;
    height: 18px;
    background: rgba(0, 0, 0, .04);
}

.todo-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    z-index: 2;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #ff8a7c, #e93636 62%, #a91e1e);
    box-shadow: 0 2px 5px rgba(185, 28, 28, .45);
}

.todo-check-form {
    position: absolute;
    top: 14px;
    left: 10px;
    z-index: 2;
}

.todo-check {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(71, 85, 105, .28);
    border-radius: 4px;
    color: #059669;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
}

.todo-check svg {
    width: 13px;
    height: 13px;
}

.todo-note p {
    min-height: 78px;
    margin: 0;
    padding-left: 2px;
    color: #122033;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.todo-meta {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px dashed rgba(71, 85, 105, .16);
    color: #617086;
    font-size: 11px;
}

.todo-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.todo-meta svg {
    width: 12px;
    height: 12px;
}

.todo-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity .15s;
}

.todo-note:hover .todo-delete {
    opacity: 1;
}

.todo-delete button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    color: #b91c1c;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
}

.todo-delete svg {
    width: 14px;
    height: 14px;
}

.todo-note.is-done {
    opacity: .72;
}

.todo-note.is-done p {
    text-decoration: line-through;
}

.todo-empty {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    color: var(--bc-text-muted);
    text-align: center;
}

.todo-empty svg {
    width: 42px;
    height: 42px;
    opacity: .5;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .bc-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
    .bc-sidebar { transform: translateX(-100%); box-shadow: var(--bc-shadow-lg); max-width: 86vw; }
    .bc-sidebar.is-open { transform: translateX(0); }
    .bc-main { margin-left: 0; }
    .bc-burger { display: inline-flex; }
    .bc-overlay-backdrop {
        position: fixed; inset: 0; background: rgba(20,30,55,.4); z-index: 35;
    }
    .bc-overlay-backdrop.is-open { display: block; }
    .bc-nav-toggle,
    .bc-nav a {
        min-height: 44px;
    }
}
@media (max-width: 640px) {
    .bc-grid-3, .bc-grid-2 { grid-template-columns: 1fr; }
    .bc-form-row { grid-template-columns: 1fr; }
    .bc-content { padding: 20px 14px; }
    .bc-modules { grid-template-columns: 1fr; }
    .bc-user-name, .bc-user-role { display: none; }
    .bc-search { max-width: 100%; width: 100%; }
    .bc-card-head { flex-direction: column; align-items: stretch; }
    .theme-module-row {
        grid-template-columns: 34px auto 1fr;
    }
    .theme-module-row .bc-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
    .todo-head {
        align-items: stretch;
        flex-direction: column;
    }
    .todo-board {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .todo-note,
    .todo-compose {
        width: 100%;
    }
}
