/* ===================== FORMS v6.0 — Stitch Design System ===================== */
/* Inputs, Buttons, Badges, File Uploads, Toolbar */

/* ---- INPUT FIELD ---- */
.input-field {
    width: 100%;
    background: var(--surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 12px;
    outline: none;
    transition: var(--transition);
    font-family: var(--font);
}

[data-theme="light"] .input-field {
    background: var(--bg-input);
    border-color: rgba(0, 0, 0, 0.1);
}

.input-field:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.input-field::placeholder {
    color: var(--text-dim);
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .btn-secondary {
    border-color: rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

.badge-orange {
    background: rgba(249, 115, 22, 0.15);
    color: #fdba74;
}

.badge-pink {
    background: rgba(236, 72, 153, 0.15);
    color: #f9a8d4;
}

.badge-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
}

/* ---- FILE UPLOAD ---- */
.file-upload-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
}

.file-upload-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.file-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: var(--transition);
    flex-shrink: 0;
}

.file-dot.loaded {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.file-dot.error {
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.file-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---- FILE CLEAR BUTTON ---- */
.file-clear-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
    margin-left: -4px;
    flex-shrink: 0;
}

.file-clear-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

.file-clear-btn.hidden {
    display: none;
}

.file-upload-btn .file-clear-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    font-size: 11px;
    margin-left: 0;
    z-index: 2;
}

/* ---- TOOLBAR ROW ---- */
.toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- DISABLED BUTTON ---- */
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- DRAG-DROP HIGHLIGHT ---- */
.kpi-card.drag-over {
    border-color: var(--accent-blue) !important;
    background: rgba(59, 130, 246, 0.08) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ---- FORMAT TAG ---- */
.format-tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    margin-left: 4px;
}

/* ---- LIGHT THEME OVERRIDES ---- */
[data-theme="light"] .btn-secondary {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: #374151;
}

[data-theme="light"] .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

[data-theme="light"] .btn-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .badge-red {
    color: #dc2626;
}

[data-theme="light"] .badge-green {
    color: #059669;
}

[data-theme="light"] .badge-blue {
    color: #2563eb;
}

[data-theme="light"] .badge-yellow {
    color: #d97706;
}

[data-theme="light"] .badge-purple {
    color: #7c3aed;
}

[data-theme="light"] .badge-orange {
    color: #ea580c;
}

[data-theme="light"] .badge-pink {
    color: #db2777;
}