/**
 * SBN Chord Diagrams Admin Styles
 */

/* =========================================================================
   GENERAL
   ========================================================================= */

.sbn-chord-diagrams-admin h1 {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.sbn-chord-diagrams-admin .sbn-empty-state {
    text-align: center;
    padding: 80px 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 20px;
}

.sbn-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.sbn-chord-diagrams-admin .sbn-empty-state h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.sbn-chord-diagrams-admin .sbn-empty-state p {
    color: #646970;
    margin-bottom: 24px;
}

/* =========================================================================
   FILTERS
   ========================================================================= */

.sbn-filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.sbn-filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sbn-filters label span {
    font-weight: 500;
    color: #50575e;
}

.sbn-filters select {
    padding: 6px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

/* =========================================================================
   CATEGORY HEADERS
   ========================================================================= */

.sbn-category-header {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #50575e;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2271b1;
}

.sbn-category-header:first-of-type {
    margin-top: 20px;
}

.sbn-category-header.hidden {
    display: none;
}

/* =========================================================================
   DIAGRAMS GRID
   ========================================================================= */

.sbn-diagrams-category {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.sbn-diagrams-category.hidden {
    display: none;
}

/* =========================================================================
   DIAGRAM CARD
   ========================================================================= */

.sbn-diagram-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.sbn-diagram-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sbn-diagram-card.hidden {
    display: none;
}

.sbn-diagram-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.sbn-diagram-header h4 {
    margin: 0;
    font-size: 15px;
    color: #1d2327;
    line-height: 1.3;
}

.sbn-diagram-slug {
    font-size: 10px;
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    color: #646970;
    flex-shrink: 0;
}

.sbn-diagram-preview {
    background: #fafafa;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.sbn-diagram-info {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sbn-diagram-root,
.sbn-diagram-quality,
.sbn-diagram-ext {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.sbn-diagram-root {
    font-weight: 600;
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.sbn-diagram-quality {
    background: #f0f6fc;
    border-color: #c5d9ed;
    color: #2271b1;
}

.sbn-diagram-ext {
    background: #fcf0f1;
    border-color: #facfd2;
    color: #d63638;
}

.sbn-diagram-notes {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    font-family: 'SF Mono', Monaco, monospace;
}

.sbn-diagram-desc {
    font-size: 13px;
    color: #646970;
    margin: 0 0 12px;
    line-height: 1.4;
}

.sbn-diagram-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sbn-diagram-shortcode {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e1e1e;
    padding: 8px 12px;
    border-radius: 4px;
}

.sbn-diagram-shortcode code {
    flex: 1;
    font-size: 11px;
    color: #9cdcfe;
    background: none;
    padding: 0;
}

.sbn-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sbn-copy-btn:hover {
    opacity: 1;
}

/* =========================================================================
   CHORD FRETBOARD PREVIEW (Mini)
   ========================================================================= */

.sbn-chord-fretboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
}

.sbn-fretboard-mini {
    position: relative;
    width: 100%;
    max-width: 110px;
    margin: 0 auto;
}

.sbn-fretboard-mini .sbn-fret-number {
    position: absolute;
    left: -18px;
    top: 14px;
    font-size: 10px;
    color: #666;
    font-weight: 400;
}

.sbn-fretboard-mini .sbn-nut {
    height: 3px;
    background: #333;
    margin-bottom: 0;
}

.sbn-fretboard-mini .sbn-frets {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sbn-fretboard-mini .sbn-fret-row {
    display: flex;
    height: 22px;
    border-bottom: 1px solid #999;
    position: relative;
}

.sbn-fretboard-mini .sbn-fret-row:last-child {
    border-bottom: 1px solid #999;
}

.sbn-fretboard-mini .sbn-string-space {
    flex: 1;
    position: relative;
}

.sbn-fretboard-mini .sbn-string-space:last-child {
    border-right: none;
}

.sbn-fretboard-mini .sbn-string-space::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #666;
    transform: translateX(-50%);
}

.sbn-fretboard-mini .sbn-string-space:first-child::before {
    width: 1px;
    background: #666;
}

/* String indicators (muted/open) */
.sbn-string-indicators {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2px;
    height: 14px;
}

.sbn-string-indicator {
    width: 16px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: normal;
    color: #999;
}

.sbn-string-indicator.muted {
    color: #999;
}

.sbn-string-indicator.open {
    color: #333;
}

/* Finger dots - light red to match frontend */
.sbn-finger-position {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e85d3b;
    opacity: 0.85;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Barre - light red to match */
.sbn-barre {
    position: absolute;
    height: 10px;
    background: #e85d3b;
    opacity: 0.85;
    border-radius: 5px;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
}

/* Interval labels */
.sbn-interval-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 6px;
}

.sbn-interval-label {
    font-size: 9px;
    color: #666;
    font-weight: 500;
    width: 20px;
    text-align: center;
}

/* =========================================================================
   EDITOR LAYOUT
   ========================================================================= */

.sbn-diagram-editor {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .sbn-diagram-editor {
        grid-template-columns: 1fr;
    }
}

.sbn-editor-main,
.sbn-editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =========================================================================
   PANEL
   ========================================================================= */

.sbn-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.sbn-panel-header {
    padding: 12px 16px;
    background: #f6f7f7;
    border-bottom: 1px solid #ddd;
}

.sbn-panel-header h2,
.sbn-panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #50575e;
}

.sbn-panel-body {
    padding: 20px;
}

/* =========================================================================
   FORM STYLES
   ========================================================================= */

.sbn-form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.sbn-form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.sbn-form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.sbn-form-row-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

@media (max-width: 782px) {
    .sbn-form-row-2,
    .sbn-form-row-3,
    .sbn-form-row-4 {
        grid-template-columns: 1fr;
    }
}

.sbn-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sbn-form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.sbn-form-field input,
.sbn-form-field select,
.sbn-form-field textarea {
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
}

.sbn-form-field input:focus,
.sbn-form-field select:focus,
.sbn-form-field textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.sbn-form-field .description {
    font-size: 12px;
    color: #646970;
    margin: 0;
}

.sbn-quick-actions {
    display: flex;
    gap: 8px;
}

/* =========================================================================
   FRETBOARD EDITOR (Full)
   ========================================================================= */

.sbn-fretboard-editor {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.sbn-fretboard-full {
    position: relative;
    min-width: 320px;
    margin: 0 auto;
    max-width: 400px;
}

/* String labels (top) */
.sbn-editor-string-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 8px;
}

.sbn-string-label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.sbn-string-label.normal {
    background: #fff;
    border: 2px solid #ccc;
    color: #666;
}

.sbn-string-label.muted {
    background: #f5f5f5;
    border: 2px solid #999;
    color: #999;
}

.sbn-string-label.muted::after {
    content: '×';
    font-size: 20px;
}

.sbn-string-label.open {
    background: #fff;
    border: 2px solid #2271b1;
    color: #2271b1;
}

.sbn-string-label.open::after {
    content: '○';
    font-size: 16px;
}

.sbn-string-label:hover {
    border-color: #2271b1;
}

/* Nut */
.sbn-editor-nut {
    height: 8px;
    background: linear-gradient(to bottom, #444, #222);
    border-radius: 3px;
    margin: 0 20px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sbn-editor-nut.hidden-nut {
    background: transparent;
    box-shadow: none;
    border-bottom: 2px dashed #ccc;
}

/* Fret number label */
.sbn-fret-label {
    position: absolute;
    left: 0;
    width: 16px;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-align: right;
}

/* Fretboard grid */
.sbn-editor-frets {
    display: flex;
    flex-direction: column;
    border: 1px solid #bbb;
    border-top: none;
    margin: 0 20px;
    background: linear-gradient(to right, 
        #f5e6d3 0%, 
        #e8d5c4 20%, 
        #dcc8b5 50%, 
        #e8d5c4 80%, 
        #f5e6d3 100%
    );
    position: relative;
}

.sbn-editor-fret-row {
    display: flex;
    height: 48px;
    border-bottom: 3px solid #8b7355;
    position: relative;
}

.sbn-editor-fret-row:last-child {
    border-bottom: 1px solid #bbb;
}

.sbn-editor-fret-row.has-marker::before {
    content: '●';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 10px;
    z-index: 1;
}

.sbn-editor-fret-row.has-double-marker::before {
    content: '● ●';
    letter-spacing: 8px;
}

.sbn-editor-string-cell {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sbn-editor-string-cell::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 2;
}

/* String thickness varies */
.sbn-editor-string-cell[data-string="6"]::before { width: 4px; background: linear-gradient(to right, #888, #666, #888); }
.sbn-editor-string-cell[data-string="5"]::before { width: 3px; background: linear-gradient(to right, #999, #777, #999); }
.sbn-editor-string-cell[data-string="4"]::before { width: 3px; background: linear-gradient(to right, #aaa, #888, #aaa); }
.sbn-editor-string-cell[data-string="3"]::before { width: 2px; background: linear-gradient(to right, #bbb, #999, #bbb); }
.sbn-editor-string-cell[data-string="2"]::before { width: 1px; background: #aaa; }
.sbn-editor-string-cell[data-string="1"]::before { width: 1px; background: #bbb; }

.sbn-editor-string-cell:hover {
    background: rgba(34, 113, 177, 0.1);
}

.sbn-editor-string-cell.has-position {
    z-index: 10;
}

/* Editor finger dots */
.sbn-editor-finger-dot {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

.sbn-editor-finger-dot:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.sbn-editor-finger-dot.finger-1 { background: #2271b1; }
.sbn-editor-finger-dot.finger-2 { background: #00a32a; }
.sbn-editor-finger-dot.finger-3 { background: #dba617; }
.sbn-editor-finger-dot.finger-4 { background: #d63638; }
.sbn-editor-finger-dot.finger-t { background: #8c5f9b; }

/* Editor barre */
.sbn-editor-barre {
    position: absolute;
    height: 28px;
    background: #333;
    border-radius: 14px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sbn-editor-barre.finger-1 { background: #2271b1; }
.sbn-editor-barre.finger-2 { background: #00a32a; }
.sbn-editor-barre.finger-3 { background: #dba617; }
.sbn-editor-barre.finger-4 { background: #d63638; }

/* Interval labels row (editor) */
.sbn-editor-intervals {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-top: 12px;
}

.sbn-interval-input {
    width: 40px !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    text-align: center;
}

/* =========================================================================
   LIVE PREVIEW
   ========================================================================= */

.sbn-live-preview {
    text-align: center;
}

.sbn-preview-chord-name {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
}

.sbn-preview-voicing {
    font-size: 12px;
    color: #646970;
    margin-bottom: 16px;
}

.sbn-preview-fretboard {
    display: inline-block;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
}

/* =========================================================================
   FINGER LEGEND
   ========================================================================= */

.sbn-finger-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sbn-finger-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #50575e;
}

.sbn-finger-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.sbn-finger-dot.finger-1 { background: #2271b1; }
.sbn-finger-dot.finger-2 { background: #00a32a; }
.sbn-finger-dot.finger-3 { background: #dba617; }
.sbn-finger-dot.finger-4 { background: #d63638; }
.sbn-finger-dot.finger-t { background: #8c5f9b; }

/* =========================================================================
   USAGE PANEL
   ========================================================================= */

.sbn-panel-body code {
    display: block;
    background: #1e1e1e;
    color: #9cdcfe;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}

/* =========================================================================
   ALIASES
   ========================================================================= */

.sbn-aliases-section {
    margin-top: 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sbn-aliases-section h3 {
    margin: 0 0 12px;
    font-size: 14px;
}

.sbn-aliases-list {
    margin-bottom: 12px;
}

.sbn-aliases-list table {
    font-size: 13px;
}

.sbn-alias-form .sbn-form-row-4 {
    display: flex;
    flex-wrap: wrap;
}

.sbn-alias-form .sbn-form-field {
    margin-bottom: 0;
}

.sbn-alias-form label {
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}

/* =========================================================================
   EDITOR ACTIONS
   ========================================================================= */

.sbn-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sbn-editor-actions .button-hero {
    padding: 12px 24px;
    height: auto;
    font-size: 14px;
    text-align: center;
}

/* =========================================================================
   CONTEXT MENU (Finger Selection)
   ========================================================================= */

.sbn-context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px;
    z-index: 100000;
    display: none;
}

.sbn-context-menu.visible {
    display: block;
}

.sbn-context-menu-title {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.sbn-context-menu-fingers {
    display: flex;
    gap: 4px;
}

.sbn-context-menu-finger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease;
    border: none;
}

.sbn-context-menu-finger:hover {
    transform: scale(1.15);
}

.sbn-context-menu-finger[data-finger="1"] { background: #2271b1; }
.sbn-context-menu-finger[data-finger="2"] { background: #00a32a; }
.sbn-context-menu-finger[data-finger="3"] { background: #dba617; }
.sbn-context-menu-finger[data-finger="4"] { background: #d63638; }
.sbn-context-menu-finger[data-finger="t"] { background: #8c5f9b; }

.sbn-context-menu-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.sbn-context-menu-action {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
}

.sbn-context-menu-action:hover {
    background: #eee;
}

.sbn-context-menu-action.delete {
    color: #d63638;
    border-color: #facfd2;
}

/* =========================================================================
   BARRE MODAL
   ========================================================================= */

.sbn-barre-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}

.sbn-barre-modal.visible {
    display: flex;
}

.sbn-barre-modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 320px;
    max-width: 90%;
}

.sbn-barre-modal h3 {
    margin: 0 0 16px;
    font-size: 16px;
}

.sbn-barre-modal-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.sbn-barre-modal-field {
    flex: 1;
}

.sbn-barre-modal-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.sbn-barre-modal-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.sbn-barre-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.sbn-barre-modal-actions button {
    flex: 1;
}

/* =========================================================================
   TOAST
   ========================================================================= */

.sbn-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: #1d2327;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 100000;
    animation: sbn-toast-in 0.3s ease;
}

.sbn-toast.success {
    background: #00a32a;
}

.sbn-toast.error {
    background: #d63638;
}

@keyframes sbn-toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   TABS
   ========================================================================= */

.sbn-admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
}

.sbn-tab {
    padding: 12px 24px;
    background: #f0f0f1;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.sbn-tab:hover {
    background: #fff;
}

.sbn-tab.active {
    background: #fff;
    border-bottom-color: #fff;
}

.sbn-tab-content {
    display: none;
}

.sbn-tab-content.active {
    display: block;
}

/* =========================================================================
   VOICING SECTIONS (New Layout)
   ========================================================================= */

.sbn-voicing-section {
    margin-bottom: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.sbn-voicing-header {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
    font-size: 20px;
}

.sbn-root-string-section {
    margin-bottom: 24px;
}

.sbn-root-string-header {
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: #f0f0f1;
    border-radius: 4px;
    font-size: 14px;
    color: #50575e;
    font-weight: 600;
}

.sbn-voicing-section.hidden,
.sbn-root-string-section.hidden {
    display: none;
}

.sbn-shapes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* =========================================================================
   DIAGRAM CARD (Updated to match frontend style)
   ========================================================================= */

.sbn-diagram-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 12px 8px;
    width: 130px;
    text-align: center;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.sbn-diagram-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #ccc;
}

.sbn-diagram-header {
    margin-bottom: 6px;
}

.sbn-shape-quality {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.sbn-shape-ext {
    color: #2271b1;
    font-size: 11px;
    margin-left: 1px;
}

.sbn-shape-inversion {
    display: block;
    font-size: 10px;
    color: #666;
    font-weight: normal;
    margin-top: 2px;
}

.sbn-diagram-preview {
    margin: 8px 0;
    padding: 4px;
}

.sbn-diagram-slug {
    margin: 8px 0;
}

.sbn-diagram-slug code {
    font-size: 10px;
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sbn-diagram-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.sbn-diagram-actions .button {
    font-size: 11px;
    padding: 2px 8px;
    min-height: 24px;
}

/* =========================================================================
   SETTINGS TAB
   ========================================================================= */

.sbn-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1200px) {
    .sbn-settings-grid {
        grid-template-columns: 1fr;
    }
}

.sbn-settings-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.sbn-settings-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.sbn-settings-section > .description {
    margin-bottom: 16px;
    color: #646970;
}

.sbn-settings-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.sbn-settings-table th,
.sbn-settings-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.sbn-settings-table th {
    background: #f9f9f9;
    font-weight: 600;
    font-size: 13px;
}

.sbn-settings-table code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.sbn-default-badge {
    display: inline-block;
    background: #f0f0f1;
    color: #646970;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
}

.sbn-add-form {
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.sbn-add-form h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
}

.sbn-form-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sbn-form-inline input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
}

/* =========================================================================
   FRONTEND LIBRARY LAYOUT (SCOPED)
   These styles only apply when inside the .sbn-chord-library wrapper.
   This guarantees they will NOT affect your Admin Dashboard.
   ========================================================================= */

/* The Main Grid */
.sbn-chord-library .sbn-diagrams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 20px;
    margin-bottom: 50px;
}

/* Section Headers */
.sbn-chord-library .sbn-category-header {
    width: 100%;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.sbn-chord-library .sbn-root-string-header {
    grid-column: 1 / -1;
    font-size: 13px;
    text-transform: uppercase;
    color: #888;
    margin-top: 10px;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: 1px solid #f9f9f9;
}

/* The Chord Card */
.sbn-chord-library .sbn-diagram-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto; /* Reset any fixed height from admin */
    width: auto;  /* Reset any fixed width from admin */
}

.sbn-chord-library .sbn-diagram-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #ccc;
}

/* Text Styles */
.sbn-chord-library .sbn-diagram-header h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.sbn-chord-library .sbn-diagram-footer {
    margin-top: auto;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}

.sbn-chord-library .sbn-diagram-quality {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    display: block; /* Ensure it sits on its own line */
}

.sbn-chord-library .sbn-diagram-preview {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
}

/* =========================================================================
   SBN EXTENSIONS: VISUAL POLISH & FRONTEND LIBRARY
   (Appended to preserve original Admin layout)
   ========================================================================= */

/* --- 1. VISUAL POLISH (Matches Course Player Look) --- */

:root {
    --sbn-primary: #e85d3b;        /* SoulBossaNova Red */
    --sbn-primary-dark: #d04a2a;
    --sbn-radius: 12px;
    --sbn-shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --sbn-shadow-hover: 0 12px 24px rgba(0,0,0,0.12);
}

/* Make Cards White & Rounded (Overrides Admin defaults) */
.sbn-diagram-card {
    background: #fff !important;
    border: 1px solid #e5e5e5;
    border-radius: var(--sbn-radius);
    padding: 20px 15px;
    box-shadow: var(--sbn-shadow-sm);
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease;
}

/* The "Enlarge" Hover Effect */
.sbn-diagram-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--sbn-shadow-hover);
    border-color: #d0d0d0;
    z-index: 10;
}

/* Typography Overrides */
.sbn-diagram-header h4 {
    font-size: 17px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 8px;
}

/* Footer Cleanup */
.sbn-diagram-footer {
    border-top: 1px solid #f7f7f7;
    margin-top: 10px;
    padding-top: 10px;
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- 2. FRETBOARD ENGINE REFINEMENTS --- */

/* Remove grey background from admin preview */
.sbn-diagram-preview {
    background: transparent !important;
    padding: 5px 0;
}

/* Ensure table resets (Crucial for frontend themes) */
.sbn-chord-fretboard table,
.sbn-chord-fretboard td {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

/* Finger Dots - Enforce Theme Red */
.sbn-finger-dot {
    background-color: var(--sbn-primary) !important;
    box-shadow: 0 2px 5px rgba(232, 93, 59, 0.4);
}
.sbn-barre {
    background-color: var(--sbn-primary) !important;
}

/* String Thicknesses (Visual Polish) */
.sbn-string-line[data-string="6"] { height: 2px !important; background: #999 !important; }
.sbn-string-line[data-string="5"] { height: 2px !important; background: #999 !important; }

/* --- 3. FRONTEND LIBRARY LAYOUT (Scoped) --- */

/* Only applies to the public page, not admin */
.sbn-chord-library .sbn-diagrams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.sbn-chord-library .sbn-category-header {
    border-bottom: 2px solid #f0f0f0;
    color: #2d2d2d;
    font-size: 26px;
    margin-top: 50px;
    padding-bottom: 12px;
    text-transform: none;
    letter-spacing: normal;
}

.sbn-chord-library .sbn-root-string-header {
    grid-column: 1 / -1;
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin-top: 10px;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1.2px;
    border-bottom: 1px solid #fafafa;
}

/* Hide Admin Actions on Frontend */
.sbn-chord-library .sbn-diagram-actions,
.sbn-chord-library .sbn-diagram-slug {
    display: none !important;
}

/* =========================================================================
   7. LIBRARY FILTER CONTROLS (Search Bar)
   ========================================================================= */

.sbn-library-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px auto 10px;
    max-width: 800px;
    flex-wrap: wrap;
}

/* Search Input */
#sbn-chord-search {
    flex: 2;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 50px; /* Pill shape */
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

#sbn-chord-search:focus {
    border-color: var(--sbn-primary);
    box-shadow: 0 4px 12px rgba(232, 93, 59, 0.15);
}

/* Dropdowns */
.sbn-select-wrapper {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.sbn-select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    appearance: none; /* Remove default arrow */
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23999%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
}

.sbn-select-wrapper select:focus {
    border-color: var(--sbn-primary);
    outline: none;
}

/* Mobile Tweak */
@media (max-width: 600px) {
    .sbn-library-controls {
        flex-direction: column;
        gap: 10px;
    }
    #sbn-chord-search, .sbn-select-wrapper {
        width: 100%;
        flex: none;
    }
}

/* =========================================================================
   8. FLAT GRID & BADGES (New Structure)
   ========================================================================= */

/* Ensure the grid takes full width and fills nicely */
.sbn-chord-library .sbn-diagrams-grid {
    display: grid;
    /* Responsive columns: fit as many 160px cards as possible */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 60px;
}

/* Adjust Card padding for the new layout */
.sbn-chord-library .sbn-diagram-card {
    padding: 15px 10px 12px;
    justify-content: space-between;
    height: 100%; /* Make them equal height in row */
}

/* Big Quality Title */
.sbn-chord-library .sbn-diagram-header h4 {
    font-size: 22px; /* Larger font for the chord symbol */
    font-weight: 800;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1;
}

/* Badge Container */
.sbn-diagram-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto; /* Pushes to bottom */
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}

/* The Badges (Pills) */
.sbn-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Specific Badge Colors */
.sbn-badge-cat {
    background-color: #f0f6fc;
    color: #0969da;
    border: 1px solid rgba(9, 105, 218, 0.1);
}

.sbn-badge-root {
    background-color: #f6f8fa;
    color: #57606a;
    border: 1px solid rgba(27, 31, 36, 0.15);
}