/**
 * Kurumsal şube yönetimi listesi — fh-themes.css token’ları.
 */

.fh-branches-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
}

.fh-branches-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.fh-branches-header-text {
    min-width: 0;
    flex: 1 1 240px;
}

.fh-branches-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 800;
    color: var(--fh-heading);
    letter-spacing: -0.02em;
}

.fh-branches-flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    border: 1px solid transparent;
}

.fh-branches-flash[hidden] {
    display: none !important;
}

.fh-branches-flash__icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.fh-branches-flash__list {
    margin: 0;
    padding-left: 1.1rem;
}

.fh-branches-flash--success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.28);
}

.fh-branches-flash--success .fh-branches-flash__icon {
    color: #4ade80;
}

.fh-branches-flash--error {
    color: #fecaca;
    background: rgba(127, 42, 42, 0.22);
    border-color: rgba(248, 113, 113, 0.32);
}

.fh-branches-flash--error .fh-branches-flash__icon {
    color: #f87171;
}

html.fh-theme-light .fh-branches-flash--success {
    color: #166534;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.22);
}

html.fh-theme-light .fh-branches-flash--success .fh-branches-flash__icon {
    color: #15803d;
}

html.fh-theme-light .fh-branches-flash--error {
    color: #7f2a2a;
    background: #f8ecec;
    border-color: rgba(127, 42, 42, 0.2);
}

html.fh-theme-light .fh-branches-flash--error .fh-branches-flash__icon {
    color: #b91c1c;
}

.fh-branches-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 53, 0.45);
    background: linear-gradient(135deg, rgba(212, 175, 53, 0.22), rgba(212, 175, 53, 0.08));
    color: var(--fh-heading);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    flex-shrink: 0;
}

.fh-branches-add-btn .material-symbols-outlined {
    font-size: 20px;
    color: var(--fh-gold);
}

.fh-branches-add-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 53, 0.65);
    box-shadow: 0 6px 18px rgba(212, 175, 53, 0.12);
}

.fh-branches-add-btn:active {
    transform: translateY(0);
}

.fh-branches-add-btn:focus-visible {
    outline: 2px solid rgba(212, 175, 53, 0.55);
    outline-offset: 2px;
}

.fh-branches-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.fh-branches-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--fh-account-stat-border, var(--fh-border-soft));
    background: var(--fh-account-stat-bg, var(--fh-offer-card-bg));
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.fh-branches-stat-card:hover {
    border-color: rgba(212, 175, 53, 0.35);
    transform: translateY(-1px);
}

.fh-branches-stat-icon {
    font-size: 22px;
    color: var(--fh-gold);
    flex-shrink: 0;
}

.fh-branches-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fh-account-label, var(--fh-text-soft));
    margin-bottom: 4px;
}

.fh-branches-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--fh-heading);
    line-height: 1.1;
}

.fh-branches-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(120px, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--fh-border-soft);
    background: var(--fh-offer-card-bg);
}

.fh-branches-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.fh-branches-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fh-text-soft);
}

.fh-branches-input {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--fh-border-soft);
    background: var(--fh-offer-input-bg);
    color: var(--fh-heading);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.16s ease;
}

.fh-branches-select-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.fh-branches-select {
    width: 100%;
    margin: 0;
    padding: 9px 34px 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--fh-border-soft);
    background-color: var(--fh-offer-input-bg);
    background-image: none;
    color: var(--fh-heading);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.fh-branches-select::-ms-expand {
    display: none;
}

.fh-branches-select-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 20px;
    color: var(--fh-gold);
    opacity: 0.85;
}

.fh-branches-input:focus,
.fh-branches-select:focus {
    outline: none;
    border-color: rgba(212, 175, 53, 0.55);
    box-shadow: 0 0 0 2px rgba(212, 175, 53, 0.12);
}

.fh-branches-list-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fh-branches-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--fh-text-soft);
}

.fh-branches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 960px) {
    .fh-branches-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.fh-branch-item {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--fh-border-soft);
    background: var(--fh-offer-card-bg);
    transition: border-color 0.16s ease, opacity 0.16s ease;
}

.fh-branch-item.is-passive {
    opacity: 0.82;
    background: linear-gradient(180deg, var(--fh-offer-card-bg), rgba(120, 120, 120, 0.04));
}

.fh-branch-item.is-passive .fh-branch-item-title {
    color: var(--fh-text-soft);
}

.fh-branch-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.fh-branch-item-title-wrap {
    min-width: 0;
    flex: 1;
}

.fh-branch-item-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--fh-heading);
    line-height: 1.3;
}

.fh-branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.fh-branch-badge.is-active {
    color: #15803d;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.fh-branch-badge.is-passive {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.12);
    border: 1px solid rgba(156, 163, 175, 0.28);
}

html.fh-theme-dark .fh-branch-badge.is-active {
    color: #86efac;
}

html.fh-theme-dark .fh-branch-badge.is-passive {
    color: #d1d5db;
}

.fh-branch-item-location-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 53, 0.1);
    border: 1px solid rgba(212, 175, 53, 0.25);
    color: var(--fh-gold);
}

.fh-branch-item-location-icon .material-symbols-outlined {
    font-size: 18px;
}

.fh-branch-item-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.fh-branch-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--fh-text-soft);
    min-width: 0;
}

.fh-branch-detail-row .material-symbols-outlined {
    font-size: 17px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--fh-gold);
    opacity: 0.85;
}

.fh-branch-detail-row.is-muted {
    font-style: italic;
    opacity: 0.85;
}

.fh-branch-detail-text {
    min-width: 0;
    word-break: break-word;
}

.fh-branch-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--fh-border-soft);
}

.fh-branch-updated {
    font-size: 11px;
    color: var(--fh-text-soft);
}

.fh-branch-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
}

.fh-branch-actions .fh-corp-action-btn {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.fh-branch-actions .fh-corp-action-btn:focus-visible {
    outline: 2px solid rgba(212, 175, 53, 0.55);
    outline-offset: 2px;
}

.fh-branch-actions .fh-corp-action-btn--preview {
    color: var(--fh-corp-btn-preview-text, #a8c4e8);
    background: var(--fh-corp-btn-preview-bg, rgba(72, 108, 152, 0.24));
    border-color: var(--fh-corp-btn-preview-border, rgba(120, 158, 200, 0.45));
}

.fh-branch-actions .fh-corp-action-btn--edit {
    color: var(--fh-corp-btn-edit-text, #f4e8d4);
    background: var(--fh-corp-btn-edit-bg, rgba(212, 175, 53, 0.22));
    border-color: var(--fh-corp-btn-edit-border, rgba(212, 175, 53, 0.5));
}

.fh-branch-actions .fh-corp-action-btn--toggle {
    color: #e5e7eb;
    background: rgba(100, 116, 139, 0.22);
    border-color: rgba(148, 163, 184, 0.4);
}

.fh-branch-actions .fh-corp-action-btn--toggle.is-active-target {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.fh-branch-actions .fh-corp-action-btn--danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.fh-branch-actions .fh-corp-action-btn:hover:not(:disabled):not(.is-disabled) {
    transform: translateY(-1px);
}

.fh-branch-actions .fh-corp-action-btn--danger:hover:not(:disabled):not(.is-disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.fh-branch-actions .fh-corp-action-btn.is-loading,
.fh-branch-actions .fh-corp-action-btn:disabled {
    opacity: 0.55;
    cursor: wait;
    pointer-events: none;
}

.fh-branches-empty {
    text-align: center;
    padding: 48px 24px;
    border-radius: 18px;
    border: 1px dashed var(--fh-border-soft);
    background: linear-gradient(180deg, var(--fh-offer-card-bg), rgba(212, 175, 53, 0.03));
}

.fh-branches-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 53, 0.12);
    border: 1px solid rgba(212, 175, 53, 0.28);
    color: var(--fh-gold);
}

.fh-branches-empty-icon .material-symbols-outlined {
    font-size: 28px;
}

.fh-branches-empty-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--fh-heading);
}

.fh-branches-empty-text {
    margin: 0 auto 20px;
    max-width: 42ch;
    font-size: 14px;
    line-height: 1.55;
    color: var(--fh-text-soft);
}

.fh-branches-filter-empty {
    padding: 28px 20px;
    text-align: center;
    border-radius: 14px;
    border: 1px solid var(--fh-border-soft);
    background: var(--fh-offer-card-bg);
    color: var(--fh-text-soft);
    font-size: 14px;
}

.fh-branches-pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.fh-branches-pagination-total {
    font-size: 13px;
    color: var(--fh-text-soft);
}

/* Harita modal */
.fh-branch-map-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fh-branch-map-modal[hidden] {
    display: none !important;
}

.fh-branch-map-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 6, 0.62);
    backdrop-filter: blur(3px);
}

.fh-branch-map-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    padding: 20px;
    border-radius: 18px;
    background: var(--fh-offer-card-bg);
    border: 1px solid var(--fh-border-soft);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.fh-branch-map-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.fh-branch-map-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--fh-heading);
}

.fh-branch-map-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--fh-border-soft);
    background: var(--fh-offer-input-bg);
    color: var(--fh-heading);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.fh-branch-map-modal__close:hover {
    border-color: rgba(212, 175, 53, 0.45);
    color: var(--fh-gold);
}

.fh-branch-map-modal__map {
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--fh-border-soft);
    background: rgba(0, 0, 0, 0.2);
}

.fh-branch-map-modal__map .leaflet-container {
    font: inherit;
    height: 100%;
    width: 100%;
}

.fh-branch-map-modal__map .leaflet-div-icon {
    background: transparent;
    border: none;
}

.fh-branch-map-pin {
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--fh-gold, #d4af35);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

@media (max-width: 860px) {
    .fh-branches-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .fh-branches-toolbar .fh-branches-field:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .fh-branches-header {
        flex-direction: column;
        align-items: stretch;
    }

    .fh-branches-add-btn {
        width: 100%;
        justify-content: center;
    }

    .fh-branches-toolbar {
        grid-template-columns: 1fr;
    }

    .fh-branch-item-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .fh-branch-actions {
        justify-content: stretch;
    }

    .fh-branch-actions .fh-corp-action-btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        min-height: 40px;
    }
}
