/* ====================================================================
   BRAND KITS PAGE
   ==================================================================== */

/* --- Page Header --- */
.bk-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl) 0 var(--space-lg);
}
.bk-page-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}
.bk-page-icon {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-black-card);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}
.bk-page-icon-ring {
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--radius-lg) + 4px);
    border: 1.5px solid var(--color-gold-faint);
    animation: bk-ring-pulse 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes bk-ring-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.04); }
}
.bk-page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 2px;
    letter-spacing: -0.02em;
}
.bk-page-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.5;
}
.bk-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* --- Card Grid --- */
.bk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* --- Card --- */
.bk-card {
    background: var(--color-black-card);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    position: relative;
    cursor: pointer;
}
.bk-card:hover {
    border-color: var(--color-gold-dim);
    box-shadow: 0 8px 32px rgba(184, 151, 46, 0.08);
    transform: translateY(-2px);
}

/* Entrance animation */
.bk-card-entrance {
    opacity: 0;
    transform: translateY(16px);
    animation: bk-card-in 0.4s ease forwards;
}
@keyframes bk-card-in {
    to { opacity: 1; transform: translateY(0); }
}

/* Card content */
.bk-card-content {
    padding: var(--space-lg);
}
.bk-card-logo-area {
    height: 40px;
    display: flex;
    align-items: center;
}
.bk-card-logo {
    max-height: 40px;
    max-width: 120px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.bk-card-no-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-black-hover);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-black-border);
}
.bk-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}
.bk-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.bk-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-sm);
    line-height: 1.4;
}
.bk-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-sm);
}
.bk-card-tag {
    display: inline-block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    background: var(--color-black-hover);
    border: 1px solid var(--color-black-border);
    border-radius: 20px;
    padding: 2px 10px;
    letter-spacing: 0.01em;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bk-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Card actions */
.bk-card-actions {
    display: flex;
    gap: var(--space-sm);
    padding: 0 var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--color-black-border);
    padding-top: var(--space-md);
    margin: 0 var(--space-lg);
    margin-bottom: var(--space-lg);
    padding-left: 0;
    padding-right: 0;
}
.bk-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-black-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.bk-action-edit:hover {
    border-color: var(--color-gold-dim);
    color: var(--color-gold);
    background: rgba(184, 151, 46, 0.06);
}
.bk-action-delete:hover {
    border-color: rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.06);
}

/* --- Empty State --- */
.bk-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    min-height: 400px;
}
.bk-empty-visual {
    position: relative;
    margin-bottom: var(--space-xl);
}
.bk-empty-orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(184,151,46,0.12) 0%, transparent 70%);
    border: 1px solid var(--color-gold-faint);
    animation: bk-orb-float 4s ease-in-out infinite;
}
@keyframes bk-orb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.bk-empty-swatches {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: var(--space-md);
}
.bk-empty-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--color-black-border);
    animation: bk-swatch-pop 0.4s ease backwards;
}
.bk-empty-swatch:nth-child(1) { animation-delay: 0.5s; }
.bk-empty-swatch:nth-child(2) { animation-delay: 0.65s; }
.bk-empty-swatch:nth-child(3) { animation-delay: 0.8s; }
@keyframes bk-swatch-pop {
    from { opacity: 0; transform: scale(0.3); }
    to { opacity: 1; transform: scale(1); }
}
.bk-empty-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
}
.bk-empty-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 var(--space-xl);
    line-height: 1.6;
    max-width: 400px;
}


/* --- Form Overlay (centered modal) --- */
.bk-form-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.25s, backdrop-filter 0.25s;
}
.bk-form-overlay.open {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

/* Form Panel */
.bk-form-panel {
    background: var(--color-black-card);
    border: 1px solid var(--color-black-border);
    border-radius: 16px;
    width: min(620px, 95vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(12px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
}
.bk-form-overlay.open .bk-form-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.bk-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--color-black-border);
    flex-shrink: 0;
}
.bk-form-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}
.bk-form-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 4px 0 0;
}
.bk-form-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-black-hover);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.bk-form-close:hover {
    color: var(--text-primary);
    border-color: var(--color-gold-dim);
}

.bk-form-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.bk-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--color-black-border);
    flex-shrink: 0;
    background: var(--color-black-card);
}
.bk-form-footer button:focus-visible,
.lib-mgmt-footer button:focus-visible,
.lib-create-footer button:focus-visible { outline: 1px solid var(--color-gold); outline-offset: 2px; }
.bk-form-footer button:focus:not(:focus-visible),
.lib-mgmt-footer button:focus:not(:focus-visible),
.lib-create-footer button:focus:not(:focus-visible) { outline: none; }

/* --- Section Dividers --- */
.bk-form-divider {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-sm) 0;
    padding-top: var(--space-sm);
}
.bk-form-divider span:first-child {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-gold);
}
.bk-form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-black-border);
}
.bk-form-divider-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* --- Form Fields --- */
.bk-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bk-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.bk-field-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-black-hover);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    outline: none;
}
.bk-field-input:focus {
    border-color: var(--color-gold-dim);
}
.bk-field-input::placeholder {
    color: var(--text-muted);
}
select.bk-field-input {
    cursor: pointer;
    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='%236e6964' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* --- Logo Upload --- */
.bk-logo-drop {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--color-black-hover);
    border: 2px dashed var(--color-black-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color 0.2s, background 0.2s;
}
.bk-logo-drop:hover {
    border-color: var(--color-gold-dim);
    background: rgba(184, 151, 46, 0.03);
}
.bk-logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.88rem;
}
.bk-logo-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}
.bk-logo-uploading {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-gold);
    font-size: 0.88rem;
}
.bk-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-sm);
}
.bk-logo-preview img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.bk-logo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e1e1e;
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 50%;
    color: #e74c3c;
    cursor: pointer;
    transition: all 0.2s;
}
.bk-logo-remove:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
}

/* --- Position Grid --- */
.bk-position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.bk-pos-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: var(--color-black-hover);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}
.bk-pos-btn:hover {
    border-color: var(--color-gold-dim);
    color: var(--text-secondary);
}
.bk-pos-btn.active {
    border-color: var(--color-gold);
    background: rgba(184, 151, 46, 0.08);
    color: var(--color-gold);
}
.bk-pos-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.2s;
}
.bk-pos-btn.active .bk-pos-dot {
    background: var(--color-gold);
}

/* --- Colors --- */
.bk-colors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}
.bk-color-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bk-color-picker-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-black-hover);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    transition: border-color 0.2s;
}
.bk-color-picker-wrap:hover {
    border-color: var(--color-gold-dim);
}
.bk-color-native {
    width: 0;
    height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    position: absolute;
}
.bk-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--color-black-border);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.bk-color-preview:hover {
    transform: scale(1.1);
}
.bk-color-hex-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.04em;
    width: 68px;
    padding: 0;
    cursor: text;
    text-transform: uppercase;
}
.bk-color-hex-input:focus {
    color: var(--text-primary);
}

/* Color Demo Bar */
.bk-color-demo {
    margin-top: var(--space-xs);
}
.bk-color-demo-bar {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--color-black-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
}
.bk-demo-text {
    transition: color 0.2s;
}
.bk-demo-highlight {
    font-weight: 700;
    transition: color 0.2s;
}

/* --- Voice Preferences --- */
.bk-voice-row {
    display: flex;
    gap: var(--space-md);
}
.bk-voice-row .bk-field { flex: 1; }
@media (max-width: 520px) {
    .bk-voice-row {
        flex-direction: column;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .bk-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    .bk-form-panel {
        width: 98vw;
        max-height: 94vh;
        border-radius: 12px;
    }
    .bk-colors-row {
        grid-template-columns: 1fr;
    }
    .bk-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard brand kits card */
.dc-brandkits-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    opacity: 0.7;
}
.dcard-brandkits:hover .dc-brandkits-icon { opacity: 1; }
