/* ═══════════════════════════════════════
   CONTENT LIBRARY — 3-Panel Layout
   Books (20%) → Units (25%) → Lesson Workspace (55%)
   ═══════════════════════════════════════ */

/* ─── Content Library Shell ─────────── */
.cl-shell {
    display: flex;
    gap: 0;
    min-height: calc(100vh - var(--topbar-h) - 140px);
    border: 1px solid var(--line);
    border-radius: clamp(12px, 2vw, 20px);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}

/* ─── Panel Common ──────────────────── */
.cl-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cl-panel-left {
    width: 20%;
    flex: 0 0 20%;
    border-right: 1px solid var(--line);
    background: #F9FAFB;
}

.cl-panel-middle {
    width: 25%;
    flex: 0 0 25%;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.cl-panel-main {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

/* ─── Panel Header ──────────────────── */
.cl-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    gap: 12px;
}

.cl-panel-header h3 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.cl-panel-header .cl-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    background: var(--bg-alt);
    padding: 3px 10px;
    border-radius: 999px;
}

/* ─── Panel Scroll ──────────────────── */
.cl-panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 12px 10px;
}

.cl-panel-scroll::-webkit-scrollbar {
    width: 5px;
}

.cl-panel-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cl-panel-scroll::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 999px;
}

/* ═══════════════════════════════════════
   BOOK CARDS
   ═══════════════════════════════════════ */
.cl-book-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1.5px solid transparent;
    margin-bottom: 4px;
    position: relative;
}

.cl-book-item:hover {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}

.cl-book-item.is-active {
    background: #EEF2FF;
    border-color: #C7D5F8;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}

/* Book Cover Image */
.cl-book-cover {
    width: 48px;
    height: 60px;
    flex: 0 0 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-alt);
    border: 1px solid var(--line);
}

.cl-book-cover-fallback {
    width: 48px;
    height: 60px;
    flex: 0 0 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: linear-gradient(135deg, #EEF2FF, #DBE4FF);
    border: 1.5px solid #C7D5F8;
}

.cl-book-item.is-active .cl-book-cover-fallback {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    border-color: #2563EB;
    color: #fff;
}

.cl-book-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cl-book-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.cl-book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
}

.cl-book-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.cl-book-meta .cl-meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #C7D5F8;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   UNIT CARDS
   ═══════════════════════════════════════ */
.cl-unit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1.5px solid transparent;
    margin-bottom: 4px;
    position: relative;
}

.cl-unit-item:hover {
    background: #F9FAFB;
    border-color: var(--line);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}

.cl-unit-item.is-active {
    background: #EEF2FF;
    border-color: #C7D5F8;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}

.cl-unit-number {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    background: #F3F4F6;
    color: #6B7280;
}

.cl-unit-item.is-active .cl-unit-number {
    background: #2563EB;
    color: #fff;
}

.cl-unit-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cl-unit-info strong {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.cl-unit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
}

.cl-unit-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.cl-unit-status {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.cl-unit-status.status-ready {
    background: #ECFDF5;
    color: #059669;
}

.cl-unit-status.status-draft {
    background: #FEF3C7;
    color: #D97706;
}

.cl-unit-status.status-empty {
    background: #F3F4F6;
    color: #9CA3AF;
}

/* Level group divider */
.cl-level-divider {
    padding: 10px 18px 6px;
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════
   LESSON WORKSPACE TOOLBAR
   ═══════════════════════════════════════ */
.cl-workspace-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    flex-wrap: wrap;
    background: #FAFBFC;
}

.cl-workspace-toolbar .cl-tb-search {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.cl-workspace-toolbar .cl-tb-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9CA3AF;
    pointer-events: none;
}

.cl-workspace-toolbar .cl-tb-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 12.5px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    transition: all 0.18s ease;
    outline: none;
}

.cl-workspace-toolbar .cl-tb-search input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cl-workspace-toolbar .cl-tb-search input::placeholder {
    color: #B0BCCC;
}

.cl-tb-select {
    padding: 8px 32px 8px 12px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 12.5px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
    min-width: 110px;
}

.cl-tb-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cl-tb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}

.cl-tb-btn-primary:hover {
    background: #1D4ED8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}

.cl-tb-btn-primary svg {
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════════════
   LESSON WORKSPACE CONTENT
   ═══════════════════════════════════════ */
.cl-workspace-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px 32px 28px;
    display: flex;
    flex-direction: column;
}

.cl-workspace-body::-webkit-scrollbar {
    width: 6px;
}

.cl-workspace-body::-webkit-scrollbar-track {
    background: transparent;
}

.cl-workspace-body::-webkit-scrollbar-thumb {
    background: #E5E7EB;
    border-radius: 999px;
}

/* Breadcrumb Inside Workspace */
.cl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.cl-breadcrumb span {
    color: #9CA3AF;
}

.cl-breadcrumb .cl-bc-current {
    color: var(--brand);
    font-weight: 700;
}

.cl-breadcrumb .cl-bc-sep {
    color: #D1D5DB;
    font-size: 14px;
}

/* Unit Header */
.cl-unit-header {
    margin-bottom: 28px;
}

.cl-unit-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 6px;
}

.cl-unit-header p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

/* ═══════════════════════════════════════
   NAVIGATION CARDS GRID
   ═══════════════════════════════════════ */
.cl-nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.cl-nav-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 20px;
    border-radius: 14px;
    border: 1.5px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.22s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.cl-nav-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(37,99,235,0.02));
    opacity: 0;
    transition: opacity 0.22s ease;
}

.cl-nav-card:hover {
    border-color: #C7D5F8;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-3px);
}

.cl-nav-card:hover::before {
    opacity: 1;
}

.cl-nav-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Card color variants */
.cl-nav-card-icon.card-overview { background: #EEF2FF; color: #2563EB; }
.cl-nav-card-icon.card-activities { background: #ECFDF5; color: #059669; }
.cl-nav-card-icon.card-wordlist { background: #FFF7ED; color: #EA580C; }
.cl-nav-card-icon.card-flashcards { background: #F5F3FF; color: #7C3AED; }
.cl-nav-card-icon.card-listenrepeat { background: #FDF2F8; color: #DB2777; }
.cl-nav-card-icon.card-practice { background: #ECFEFF; color: #0891B2; }
.cl-nav-card-icon.card-games { background: #FFFBE6; color: #D97706; }
.cl-nav-card-icon.card-quiz { background: #F1F5F9; color: #475569; }
.cl-nav-card-icon.card-worksheet { background: #F0FDF4; color: #16A34A; }

.cl-nav-card-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.cl-nav-card-desc {
    font-size: 11px;
    color: var(--muted);
    position: relative;
    z-index: 1;
    line-height: 1.4;
    margin-top: -8px;
}

.cl-nav-card-arrow {
    margin-top: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #F3F4F6;
    color: #9CA3AF;
    transition: all 0.22s ease;
    position: relative;
    z-index: 1;
    align-self: flex-end;
}

.cl-nav-card:hover .cl-nav-card-arrow {
    background: var(--brand);
    color: #fff;
}

/* ═══════════════════════════════════════
   EMPTY STATE (Inside Workspace)
   ═══════════════════════════════════════ */
.cl-empty-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 32px;
    flex: 1;
}

.cl-empty-workspace-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #EEF2FF, #DBE4FF);
    color: #2563EB;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
}

.cl-empty-workspace-icon svg {
    width: 36px;
    height: 36px;
}

.cl-empty-workspace h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

.cl-empty-workspace p {
    font-size: 13px;
    color: var(--muted);
    max-width: 320px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════
   LEGACY EMPTY STATES (sidebar panels)
   ═══════════════════════════════════════ */
.cl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    height: 100%;
    min-height: 200px;
}

.cl-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #F3F4F6;
    color: #9CA3AF;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}

.cl-empty-icon svg {
    width: 26px;
    height: 26px;
}

.cl-empty strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.cl-empty p {
    font-size: 11px;
    color: var(--muted);
    max-width: 220px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════ */
.cl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.cl-page-header .section-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    display: block;
    margin-bottom: 4px;
}

.cl-page-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.cl-page-header .cl-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════
   UNIT PANEL TOOLBAR
   ═══════════════════════════════════════ */
.cl-unit-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    flex-wrap: wrap;
    background: #FAFBFC;
}

.cl-unit-toolbar .cl-tb-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: auto;
    white-space: nowrap;
}

.cl-unit-toolbar .cl-tb-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}

.cl-unit-toolbar .cl-tb-btn-add:hover {
    background: #1D4ED8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}

.cl-unit-toolbar .cl-tb-btn-add svg {
    width: 14px;
    height: 14px;
}

.cl-unit-toolbar .cl-tb-btn-add:disabled,
.cl-unit-toolbar.is-disabled .cl-tb-btn-add {
    background: #E5E7EB;
    color: #9CA3AF;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

.cl-unit-toolbar .cl-tb-search {
    position: relative;
    flex: 1;
    min-width: 100px;
    max-width: 160px;
}

.cl-unit-toolbar .cl-tb-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #9CA3AF;
    pointer-events: none;
}

.cl-unit-toolbar .cl-tb-search input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 11.5px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    transition: all 0.18s ease;
    outline: none;
}

.cl-unit-toolbar .cl-tb-search input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cl-unit-toolbar .cl-tb-search input::placeholder {
    color: #B0BCCC;
}

.cl-unit-toolbar.is-disabled .cl-tb-search input {
    background: #F3F4F6;
    cursor: not-allowed;
    color: #9CA3AF;
}

.cl-unit-toolbar .cl-tb-sort {
    padding: 6px 28px 6px 10px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 11.5px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
    min-width: 80px;
}

.cl-unit-toolbar .cl-tb-sort:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cl-unit-toolbar.is-disabled .cl-tb-sort {
    background: #F3F4F6;
    cursor: not-allowed;
    color: #9CA3AF;
    pointer-events: none;
}

.cl-unit-toolbar-hint {
    padding: 10px 16px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid var(--line);
    background: #FFFBEB;
    color: #92400E;
    flex-shrink: 0;
}

.cl-unit-toolbar-hint svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
}

/* ═══════════════════════════════════════
   UNIT CARD ACTIONS (Move & Context Menu)
   ═══════════════════════════════════════ */
.cl-unit-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.cl-unit-item:hover .cl-unit-actions {
    opacity: 1;
}

.cl-unit-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.cl-unit-action:hover {
    background: #F3F4F6;
    color: var(--ink);
}

.cl-unit-action svg {
    width: 14px;
    height: 14px;
}

.cl-unit-action-menu {
    position: relative;
}

.cl-unit-action-menu-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.cl-unit-action-menu-btn:hover {
    background: #F3F4F6;
    color: var(--ink);
}

.cl-unit-action-menu-btn svg {
    width: 15px;
    height: 15px;
}

.cl-unit-action-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 150px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.04);
    z-index: 50;
    padding: 6px;
    animation: clFadeIn 0.15s ease;
}

@keyframes clFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.cl-unit-action-dropdown.is-open {
    display: block;
}

.cl-unit-action-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
}

.cl-unit-action-dropdown button:hover {
    background: #F3F4F6;
}

.cl-unit-action-dropdown button svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--muted);
}

.cl-unit-action-dropdown button.text-danger {
    color: var(--danger);
}

.cl-unit-action-dropdown button.text-danger svg {
    color: var(--danger);
}

.cl-unit-action-dropdown .cl-dropdown-divider {
    height: 1px;
    background: var(--line-light);
    margin: 4px 0;
}

/* ═══════════════════════════════════════
   UNIT CARD ENHANCED
   ═══════════════════════════════════════ */
.cl-unit-item {
    padding: 12px 12px 12px 16px;
    gap: 10px;
}

.cl-unit-item .cl-unit-desc {
    display: block;
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 1px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-unit-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Button to create unit in empty state */
.cl-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}

.cl-btn-create:hover {
    background: #1D4ED8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}

.cl-btn-create:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

.cl-btn-create svg {
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1400px) {
    .cl-panel-left {
        width: 20%;
        flex-basis: 20%;
    }

    .cl-panel-middle {
        width: 25%;
        flex-basis: 25%;
    }
}

@media (max-width: 1100px) {
    .cl-panel-left {
        width: 220px;
        flex: 0 0 220px;
    }

    .cl-panel-middle {
        width: 240px;
        flex: 0 0 240px;
    }

    .cl-nav-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .cl-nav-card {
        padding: 20px 16px;
    }

    .cl-workspace-body {
        padding: 20px 20px 24px 20px;
    }
}

@media (max-width: 900px) {
    .cl-shell {
        flex-direction: column;
        border: none;
        border-radius: 0;
        background: transparent;
        gap: 16px;
        box-shadow: none;
    }

    .cl-panel-left,
    .cl-panel-middle,
    .cl-panel-main {
        width: 100%;
        flex-basis: auto;
        border: 1px solid var(--line);
        border-radius: 16px;
        max-height: none;
    }

    .cl-panel-scroll {
        max-height: 280px;
    }

    .cl-panel-main .cl-panel-scroll {
        max-height: none;
    }

    .cl-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cl-nav-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .cl-workspace-toolbar {
        padding: 12px 16px;
        gap: 8px;
    }

    .cl-workspace-body {
        padding: 16px 16px 20px 16px;
    }
}

@media (max-width: 480px) {
    .cl-panel-scroll {
        max-height: 200px;
    }

    .cl-nav-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cl-nav-card {
        padding: 16px 14px;
        gap: 10px;
    }

    .cl-nav-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 20px;
    }

    .cl-nav-card-label {
        font-size: 12px;
    }

    .cl-unit-header h2 {
        font-size: 19px;
    }

    .cl-empty-workspace {
        padding: 40px 20px;
    }

    .cl-book-cover,
    .cl-book-cover-fallback {
        width: 40px;
        height: 50px;
        flex: 0 0 40px;
    }
}