/* ═══════════════════════════════════════════════════════════════
   ERPA Framework - Components
   Buttons, Cards, Badges, Forms, Modals, Tables, Toasts, etc.
   ═══════════════════════════════════════════════════════════════ */

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #fff;
    border: none;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-light);
}

.btn-secondary {
    background: var(--bg-tertiary);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
}
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px var(--danger-light); }

.btn-warning {
    background: var(--warning);
    color: #000;
    border: none;
}
.btn-warning:hover { background: #d97706; }

.btn-success {
    background: var(--success);
    color: #fff;
    border: none;
}
.btn-success:hover { background: #059669; }

.btn-info {
    background: var(--info);
    color: #fff;
    border: none;
}
.btn-info:hover { background: #2563eb; }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-outline:hover { background: var(--bg-tertiary); }

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    text-decoration: underline;
}

/* Button Sizes */
.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.75rem; gap: 0.25rem; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.125rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 0.25rem; }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

.card-hover { transition: transform var(--transition-base), box-shadow var(--transition-base); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Stat Card */
.stat-card { padding: 1.5rem; }
.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-card-icon.emerald { background: var(--success-light); color: var(--success); }
.stat-card-icon.blue { background: var(--info-light); color: var(--info); }
.stat-card-icon.purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.stat-card-icon.orange { background: var(--warning-light); color: #f97316; }
.stat-card-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-card-value { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.25rem; }
.stat-card-label { font-size: 0.875rem; color: var(--text-muted); }

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* Tier badges */
.badge-free { background: rgba(107,114,128,0.15); color: #9ca3af; }
.badge-starter { background: var(--info-light); color: var(--info); }
.badge-business { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-enterprise { background: var(--warning-light); color: var(--warning); }

/* Status dot */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.success, .status-dot.active { background: var(--success); }
.status-dot.warning, .status-dot.pending { background: var(--warning); }
.status-dot.danger, .status-dot.inactive { background: var(--danger); }
.status-dot.info { background: var(--info); }

/* ── FORMS ─────────────────────────────────────────────────── */
.input, .form-input, .form-select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.input:focus, .form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input::placeholder, .form-input::placeholder { color: var(--text-muted); }
.input:disabled, .form-input:disabled { opacity: 0.6; cursor: not-allowed; }

.input-sm { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }
.input-lg { padding: 0.75rem 1rem; font-size: 1rem; }

/* Form Layout */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.375rem; font-weight: 500; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.25rem; }

.form-row { display: grid; gap: 1rem; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.form-divider { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--border); }

/* Toggle */
.toggle {
    width: 44px;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-base);
    flex-shrink: 0;
}
.toggle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-base);
}
.toggle:checked { background: var(--accent); }
.toggle:checked::before { transform: translateX(20px); }

/* Checkbox, Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ── TABLES ────────────────────────────────────────────────── */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--table-hover); }
.table-actions { display: flex; gap: 0.375rem; justify-content: flex-end; }

/* ── MODALS ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    max-height: 90vh;
    overflow: hidden;
    width: 100%;
    animation: fadeIn 0.2s ease;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 1.125rem; }

.modal-body { padding: 1.5rem; overflow-y: auto; max-height: calc(90vh - 140px); }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* Modal Sizes */
.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

/* ── TOASTS ────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
}

.toast {
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    font-size: 0.875rem;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* ── DROPDOWN ──────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    z-index: 100;
    display: none;
}
.dropdown-menu.show { display: block; animation: fadeIn 0.15s ease; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover { background: var(--bg-tertiary); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* ── PAGINATION ────────────────────────────────────────────── */
.pagination { display: flex; gap: 0.25rem; justify-content: center; }
.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}
.pagination-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.pagination-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── TABS ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.tab {
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── AVATAR ────────────────────────────────────────────────── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.75rem; }

.avatar-accent { background: var(--accent-light); color: var(--accent); }
.avatar-blue { background: var(--info-light); color: var(--info); }
.avatar-purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.avatar-orange { background: var(--warning-light); color: #f97316; }

/* ── TOOLTIP ───────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.625rem;
    background: var(--text-primary);
    color: var(--text-inverse);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    margin-bottom: 6px;
    z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state-title { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.empty-state-desc { font-size: 0.875rem; max-width: 320px; margin: 0 auto; }

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent);
    transition: width 0.5s ease;
}
.progress-bar.danger { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.info { background: var(--info); }

/* ── FILTER BAR ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.filter-input { min-width: 160px; max-width: 240px; }
.filter-select { min-width: 140px; }

/* ── SECTION HEADER ────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.section-title { font-weight: 600; font-size: 1.125rem; }
.section-subtitle { color: var(--text-muted); font-size: 0.875rem; }

/* ── SETTINGS ──────────────────────────────────────────────── */
.settings-group { display: flex; flex-direction: column; gap: 0.75rem; }
.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}
.settings-option:hover { background: var(--bg-tertiary); }
.settings-option-info { flex: 1; }
.settings-option-label { font-weight: 500; margin-bottom: 0.125rem; }
.settings-option-desc { font-size: 0.8125rem; color: var(--text-muted); }

/* ── AUTH/LOADING ──────────────────────────────────────────── */
.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.auth-loading-content { text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   SELECT2 — Merkezi tema (mobil uyumlu, dark/light mode)
   Tüm ERPA servisleri (HRMS, WMS, vb.) bu stili kullanır.
   ═══════════════════════════════════════════════════════════════ */

.select2-container { width: 100% !important; box-sizing: border-box; }
.form-section .select2-container { max-width: 100% !important; }

/* Seçim kutusu */
.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 2.5rem;
    padding: 0.4rem 2.25rem 0.4rem 0.75rem;
    background-color: var(--bg-secondary, var(--surface, #1e293b));
    border: 1px solid var(--border, #334155);
    border-radius: var(--radius-md, 0.5rem);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--accent, #10b981);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
    outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary, #f1f5f9);
    line-height: 1.5;
    padding: 0;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted, #94a3b8);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%; top: 0; right: 0.5rem; width: 1.25rem;
    display: flex; align-items: center; justify-content: center;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted, #94a3b8) transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text-muted, #94a3b8);
}
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--text-muted, #94a3b8);
    font-size: 1.1rem; font-weight: 400; line-height: 1;
    margin-right: 1.5rem;
}

/* Dropdown panel */
.select2-dropdown {
    background-color: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: var(--radius-md, 0.5rem);
    box-shadow: 0 8px 32px rgba(0,0,0,0.28);
    z-index: 99999 !important;
    overflow: hidden;
    font-family: inherit;
}

/* Arama kutusu */
.select2-container--default .select2-search--dropdown {
    padding: 0.5rem 0.5rem 0.25rem;
    background: var(--bg-secondary, #1e293b);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: var(--radius-sm, 0.375rem);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.875rem;
    font-family: inherit;
    padding: 0.45rem 0.7rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--accent, #10b981);
    box-shadow: 0 0 0 2px rgba(16,185,129,0.12);
}

/* Sonuç listesi */
.select2-results__options { max-height: 260px; overflow-y: auto; }
.select2-results__option {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary, #f1f5f9);
    cursor: pointer;
    transition: background 0.1s;
    line-height: 1.4;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--accent, #10b981);
    color: #fff;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(16,185,129,0.15);
    color: var(--accent, #10b981);
}
.select2-container--default .select2-results__option--disabled {
    color: var(--text-muted, #94a3b8);
    opacity: 0.55;
}
.select2-results__message {
    color: var(--text-muted, #94a3b8);
    font-size: 0.8125rem;
    padding: 0.6rem 0.75rem;
    font-style: italic;
}

/* Mobil uyumluluk */
@media (max-width: 640px) {
    .select2-container--default .select2-selection--single { min-height: 2.75rem; }
    .select2-dropdown { max-width: calc(100vw - 1rem); }
    .select2-results__option { padding: 0.65rem 0.75rem; font-size: 0.9375rem; }
    .select2-container--default .select2-search--dropdown .select2-search__field {
        font-size: 1rem; padding: 0.55rem 0.7rem;
    }
}

/* ── THEME SWITCHER ─────────────────────────────────────────── */
#theme-switcher-header {
    position: relative;
    display: flex;
    align-items: center;
}

.erpa-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-md, 6px);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}
.erpa-theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.erpa-theme-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 9999;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 10px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    padding: 0.5rem;
    flex-direction: column;
}
.erpa-theme-dropdown.show {
    display: flex;
}

.erpa-theme-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem 0.15rem;
}

.erpa-theme-option {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    text-align: left;
}
.erpa-theme-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.erpa-theme-option.active {
    background: var(--accent-light, rgba(16,185,129,0.12));
    color: var(--accent);
    font-weight: 500;
}

.erpa-theme-preview {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   ERPA.GridBuilder — Merkezi Grid Düzenleyici Stilleri
   Tüm ERPA servisleri bu stili kullanır (TMS, WMS, HRMS, vb.)
   ═══════════════════════════════════════════════════════════════ */

/* Panel Wrapper */
.gb-panel {
    margin-bottom: .875rem;
    border: 1px solid var(--accent, #6366f1);
    border-radius: var(--radius-lg, 12px);
    background: var(--bg-card, #1e1e2e);
    overflow: hidden;
}
.gb-panel-inner { display: flex; flex-direction: column; }
.gb-section {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.gb-section:last-child { border-bottom: none; }
.gb-section-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: .5rem;
}
.gb-hint {
    font-size: .72rem;
    color: var(--text-secondary, #94a3b8);
    font-style: italic;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Preset Butonları */
.gb-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.gb-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .4rem .5rem;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    background: var(--bg-secondary, #2a2a3e);
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: all .15s;
    min-width: 68px;
    font-family: inherit;
}
.gb-preset-btn:hover {
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
    background: color-mix(in srgb, var(--accent, #6366f1) 8%, var(--bg-secondary, #2a2a3e));
}
.gb-preset-btn.active {
    border-color: var(--accent, #6366f1);
    background: color-mix(in srgb, var(--accent, #6366f1) 15%, var(--bg-secondary, #2a2a3e));
    color: var(--accent, #6366f1);
}
.gb-preset-icon { display: block; color: currentColor; line-height: 0; }
.gb-preset-icon svg { display: block; }
.gb-preset-label { font-size: .65rem; font-weight: 600; white-space: nowrap; text-align: center; }

/* Span Butonları */
.gb-spans { display: flex; align-items: center; flex-wrap: wrap; gap: .375rem; }
.gb-span-btn {
    padding: .25rem .65rem;
    border-radius: 6px;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    background: var(--bg-secondary, #2a2a3e);
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    transition: all .15s;
    font-family: inherit;
}
.gb-span-btn:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.gb-span-btn.active { background: var(--accent, #6366f1); border-color: var(--accent, #6366f1); color: #fff; }

/* Kart Yönetim Butonları */
.gb-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.gb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .85rem;
    border-radius: 7px;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    background: var(--bg-secondary, #2a2a3e);
    color: var(--text-primary, #f1f5f9);
    cursor: pointer;
    font-size: .78rem;
    font-family: inherit;
    transition: all .15s;
}
.gb-action-btn:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.gb-action-btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.gb-action-btn.gb-action-danger:hover { border-color: #ef4444; color: #ef4444; }

/* Alt Satır */
.gb-section-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gb-tip { font-size: .72rem; color: var(--text-secondary, #94a3b8); }

/* Field Taşıma Durumu */
.gb-field-status {
    font-size: .78rem;
    color: var(--text-secondary, #94a3b8);
    padding: .35rem .5rem;
    background: var(--bg-secondary, #2a2a3e);
    border-radius: 6px;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    min-height: 32px;
    display: flex;
    align-items: center;
}

/* Kart Drag Handle (üst tutturma çubuğu) */
.gb-drag-handle {
    display: none;
    align-items: center;
    justify-content: center;
    width: calc(100% + 3rem);
    margin: -.75rem -1.5rem .75rem;
    height: 24px;
    cursor: grab;
    color: var(--text-secondary, #94a3b8);
    font-size: .85rem;
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
    background: var(--bg-secondary, #2a2a3e);
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
    transition: background .15s, color .15s;
    user-select: none;
}
.gb-drag-handle:hover {
    background: color-mix(in srgb, var(--accent, #6366f1) 12%, var(--bg-secondary, #2a2a3e));
    color: var(--accent, #6366f1);
}
.gb-drag-handle:active { cursor: grabbing; }
.grid-edit-mode [data-card] .gb-drag-handle { display: flex; }

/* Field Handle (sol kenar tutturma) */
.gb-field-handle {
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    color: var(--text-secondary, #94a3b8);
    opacity: 0;
    font-size: .85rem;
    line-height: 1;
    padding: .1rem;
    transition: opacity .15s;
    pointer-events: none;
}
.grid-edit-mode .form-group:hover .gb-field-handle { opacity: .6; pointer-events: auto; }

/* Field Seçim / Hover */
.grid-edit-mode .form-group {
    position: relative;
    border-radius: 6px;
    cursor: pointer;
    transition: background .12s, outline .12s;
}
.grid-edit-mode .form-group:hover {
    background: color-mix(in srgb, var(--accent, #6366f1) 5%, transparent);
    outline: 1px dashed var(--border, rgba(255,255,255,.12));
}
.form-group.gb-field-selected {
    outline: 2px solid var(--accent, #6366f1) !important;
    outline-offset: 2px;
    background: color-mix(in srgb, var(--accent, #6366f1) 8%, transparent) !important;
    border-radius: 6px;
}

/* Drag-Drop Etkileşim */
.gb-drop-target {
    outline: 2px solid var(--accent, #6366f1) !important;
    outline-offset: 3px;
    background: color-mix(in srgb, var(--accent, #6366f1) 8%, var(--bg-card, #1e1e2e)) !important;
}
.gb-selected {
    outline: 2px solid var(--accent, #6366f1) !important;
    outline-offset: 3px;
}
.sortable-drag { opacity: .35 !important; }

/* Düzenleme Modu — Kart Vurgusu */
.grid-edit-mode [data-card] {
    outline: 1px dashed color-mix(in srgb, var(--accent, #6366f1) 35%, transparent);
    outline-offset: 2px;
    transition: outline-color .15s;
}
.grid-edit-mode [data-card]:hover {
    outline-color: var(--accent, #6366f1);
    outline-style: solid;
}

/* Boş Kart Zone */
.gb-field-zone { min-height: 40px; }
.gb-empty-zone {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border, rgba(255,255,255,.1));
    border-radius: 8px;
    margin-top: .5rem;
}
.gb-empty-hint { font-size: .78rem; color: var(--text-secondary, #94a3b8); }
.grid-edit-mode .gb-empty-zone {
    border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, var(--border, rgba(255,255,255,.1)));
}

/* Card Title Inline Edit */
.gb-editable-title { cursor: default; }
.gb-title-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent, #6366f1);
    color: inherit;
    font: inherit;
    outline: none;
    width: calc(100% - 2rem);
    padding: 0 .25rem;
}

/* Toggle Buton Aktif Hali (servis-agnostik) */
#grid-edit-toggle.active {
    background: color-mix(in srgb, var(--accent, #6366f1) 15%, transparent);
    color: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
}
