/* firma-duzenle.css – Firma Düzenle Sayfası */
:root {
    --kb-primary: #16a085;
    --kb-muted: #4b5563;
    --kb-radius: 16px;
    --tabbar-h: 92px;
    --kb-soft-bg: #f3f4f6;
}

body {
    background: #f6f7f9;
}

.kb-firm-edit-main {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding-top: .5rem;
    padding-bottom: 1.25rem;
}

.kb-firm-edit-header {
    border-radius: var(--kb-radius);
    border: 1px solid #e5e7eb;
    background:
        radial-gradient(circle at top left, rgba(22, 160, 133, .08), transparent 55%),
        #ffffff;
}

.kb-firm-edit-header .badge-role {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.kb-firm-edit-summary-card {
    border-radius: var(--kb-radius);
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 40%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.kb-firm-edit-summary-card .card-body {
    padding: 1.1rem 1.25rem 1.3rem;
}

.kb-firm-summary-header {
    align-items: center;
}

/* Firma küçük resmi backend'de 16:9 (720x405) tutulduğu için
   burada da kare yerine 16:9 oranlı küçük bir kapak alanı kullanıyoruz. */
.kb-firm-edit-summary-logo {
    width: 112px;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    background: linear-gradient(135deg, #16a085, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ecfdf5;
    font-weight: 700;
    font-size: 1.1rem;
    overflow: hidden;
}

.kb-firm-edit-summary-logo.kb-firm-logo-clickable {
    cursor: zoom-in;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .25);
    transition: transform .12s ease, box-shadow .12s ease;
}

.kb-firm-edit-summary-logo.kb-firm-logo-clickable:hover {
    transform: translateY(-1px) scale(1.01);
}

.kb-firm-edit-summary-logo img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}

.kb-firm-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
}

.kb-logo-upload-status {
    font-size: .8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.kb-firm-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}

.kb-firm-summary-actions .btn {
    border-radius: 999px;
    padding-inline: 1.25rem;
    font-weight: 500;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .98), #f9fafb);
    border-color: #d1d5db;
    color: #374151;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
    transition: background-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.kb-firm-summary-actions .btn:hover {
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
    transform: translateY(-1px);
}

.kb-firm-summary-actions .btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
}

.kb-firm-summary-actions .btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 .15rem rgba(22, 160, 133, .45),
        0 8px 18px rgba(15, 118, 110, .35);
}

.kb-firm-select-wrapper {
    background: linear-gradient(135deg, rgba(22, 160, 133, .06), rgba(14, 165, 233, .04));
    border-radius: 999px;
    padding: .35rem .85rem;
    border: 1px solid rgba(22, 160, 133, .25);
    box-shadow: 0 6px 14px rgba(15, 118, 110, .12);
}

/* Sektör seçimleri için arama yapılabilen basit açılır menü */
.kb-kategori-search {
    position: relative;
    margin-top: .35rem;
}

.kb-kategori-search-control {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    padding: .4rem .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .9rem;
    color: #374151;
}

.kb-kategori-search-control .kb-kategori-search-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-kategori-search-dropdown {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 4px);
    z-index: 1050;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    padding: .35rem .35rem .4rem;
    display: none;
}

.kb-kategori-search.is-open .kb-kategori-search-dropdown {
    display: block;
}

.kb-kategori-search-input-wrap {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .35rem .4rem;
    border-bottom: 1px solid #e5e7eb;
}

.kb-kategori-search-input-wrap i {
    color: #9ca3af;
}

.kb-kategori-search-input {
    border: 0;
    outline: none;
    width: 100%;
    font-size: .85rem;
}

.kb-kategori-search-list {
    max-height: 260px;
    overflow-y: auto;
    padding: .25rem;
}

.kb-kategori-search-group {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #111827;
    padding: .25rem .45rem .15rem;
    margin-top: .2rem;
}

.kb-kategori-search-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: .25rem .4rem;
    font-size: .86rem;
    border-radius: 6px;
    color: #374151;
}

.kb-kategori-search-item.is-active,
.kb-kategori-search-item:hover {
    background: #ecfdf5;
    color: #047857;
}

/* Sektör seçimi için küçük bilgi kutusu */
.kb-kategori-hint {
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background-color: #eff6ff;
    color: #1e3a8a;
    padding: 8px 10px;
    font-size: .82rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-top: .5rem;
}

.kb-kategori-hint .kb-kategori-hint-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dbeafe;
    color: #1d4ed8;
}

.kb-kategori-search-empty {
    font-size: .8rem;
    color: #6b7280;
    padding: .35rem .4rem;
}

#kbFirmLogoModalImage {
    max-height: 80vh;
    object-fit: contain;
}

.kb-firm-select-label {
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #065f46;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.kb-firm-select-label .bi {
    font-size: .9rem;
}

.kb-firm-select {
    border-radius: 999px;
    border-color: transparent;
    box-shadow: none;
    font-weight: 500;
    padding-inline: 1rem 2.2rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-firm-select:focus {
    border-color: rgba(22, 160, 133, .8);
    box-shadow: 0 0 0 .15rem rgba(22, 160, 133, .2);
}

.kb-firm-edit-form-card {
    border-radius: var(--kb-radius);
    border: 1px solid #e5e7eb;
}

.kb-firm-edit-form-card .card-body {
    padding: 1.5rem 1.5rem 1.75rem;
}

.kb-firm-edit-tabs-wrapper {
    padding-bottom: .25rem;
}

.kb-firm-edit-tabs {
    border-bottom: 0;
    background: #f9fafb;
    border-radius: 999px;
    padding: .25rem .4rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: nowrap;
    justify-content: space-between;
    min-height: 0;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(148, 163, 184, .2);
}

.kb-firm-edit-tabs .nav-item {
    flex: 1 1 0;
    display: flex;
    justify-content: center;
}

.kb-firm-edit-tabs .nav-link {
    border-radius: 999px;
    padding: .3rem .6rem;
    font-size: .8rem;
    color: #374151;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    white-space: normal;
    text-align: center;
}

.kb-firm-edit-tabs .nav-link .kb-tab-icon {
    font-size: .9rem;
}

.kb-firm-edit-tabs .nav-link.active {
    background: #ecfdf5;
    color: var(--kb-primary);
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(16, 185, 129, .25);
}

.kb-firm-edit-tabs .nav-link:not(.active):hover {
    background: #e5e7eb;
}

.kb-field-hint {
    font-size: .78rem;
    color: #6b7280;
    margin-top: .2rem;
    line-height: 1.5;
}

.kb-chip-counter {
    font-size: .78rem;
    color: #6b7280;
    text-align: right;
}

.kb-section-heading {
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .35rem;
}

.kb-section-heading::before {
    content: "";
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--kb-primary), #0ea5e9);
}

.kb-required-badge {
    background: rgba(248, 113, 113, .08);
    color: #b91c1c;
    border-radius: 999px;
    font-size: .65rem;
    padding: .1rem .45rem;
    border: 1px solid rgba(248, 113, 113, .6);
    vertical-align: middle;
}

.kb-firm-edit-form-card label.form-label {
    font-size: .9rem;
    font-weight: 500;
    color: #374151;
    letter-spacing: 0;
    text-transform: none;
}

.kb-firm-edit-form-card .form-control,
.kb-firm-edit-form-card .form-select {
    border-radius: 10px;
    border-color: #d1d5db;
    background-color: #f9fafb;
    font-size: .95rem;
    padding: .55rem .75rem;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.kb-firm-edit-form-card .form-control:focus,
.kb-firm-edit-form-card .form-select:focus {
    background-color: #ffffff;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 1px rgba(22, 160, 133, .25), 0 8px 18px rgba(15, 118, 110, .16);
}

/* Saat seçicilerde Bootstrap'in kırmızı hata ikonunu gizle */
.kb-firm-edit-form-card .form-control.is-invalid[type="time"] {
    background-image: none;
}

.kb-input-group .input-group-text {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
    border-right: 0;
    background: #f9fafb;
    color: #6b7280;
}

.kb-input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.kb-longtext {
    min-height: 190px;
    resize: vertical;
    font-size: .95rem;
    line-height: 1.6;
}

.kb-longtext-sm {
    min-height: 120px;
    resize: vertical;
}

.kb-form-footer {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 var(--kb-radius) var(--kb-radius);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: .85rem;
}

.kb-form-footer .kb-field-hint {
    margin-top: .1rem;
}

.kb-firm-edit-form-card .btn-success {
    border-radius: 999px;
    padding-inline: 1.5rem;
    box-shadow: 0 10px 18px rgba(5, 150, 105, .25);
}

.kb-firm-edit-form-card .btn-success:focus-visible {
    box-shadow: 0 0 0 .16rem rgba(22, 160, 133, .4);
}

.kb-working-hours-modes {
    row-gap: .5rem;
    column-gap: 1rem;
}

.kb-working-hours-modes>[class*="col-"] {
    display: flex;
}

.kb-working-hours-mode {
    width: 100%;
    padding: .45rem .75rem;
    border-radius: 999px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.kb-working-hours-mode .form-check-input {
    margin-top: 0;
}

.kb-working-hours-mode .form-check-label {
    font-size: .82rem;
    color: #374151;
}

.kb-working-hours-mode:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.kb-working-hours-panel {
    border-radius: 12px;
    border: 1px dashed #e5e7eb;
    padding: .6rem .75rem;
    background-color: #f9fafb;
}

/* Firma durum etiketi */
#kbFirmStatusBadge {
    border-radius: 999px;
    padding: .32rem .9rem;
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .02em;
    text-transform: none;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border-width: 1px;
    border-style: solid;
}

#kbFirmStatusBadge::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .6);
}

/* Duruma göre özel renk stilleri */
.kb-status-draft {
    background: #eef2ff;
    color: #312e81;
    border-color: #c7d2fe;
}

.kb-status-active {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.kb-status-stopped {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.kb-status-expired {
    background: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}

.kb-status-future {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.kb-working-hours-days {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.kb-working-hours-day {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.kb-working-hours-day-label {
    min-width: 92px;
    font-size: .86rem;
    font-weight: 500;
    color: #374151;
}

.kb-working-hours-day-controls {
    flex: 1 1 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
}

/* Firma-yonetim / firma-ekle sayfalarındaki iconlu bilgi mesajı stili */
.kb-firm-alert {
    border-radius: 12px;
    border-width: 1px;
    font-size: .85rem;
    padding: .55rem .75rem;
}

.kb-firm-alert.alert-success {
    background-color: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.kb-firm-alert.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.kb-firm-alert.alert-warning {
    background-color: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.kb-firm-alert-content {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.kb-firm-alert-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

.kb-firm-alert.alert-success .kb-firm-alert-icon {
    background: #22c55e;
    color: #ecfdf5;
    box-shadow: 0 4px 10px rgba(22, 163, 74, .35);
}

.kb-firm-alert.alert-danger .kb-firm-alert-icon {
    background: #ef4444;
    color: #fef2f2;
    box-shadow: 0 4px 10px rgba(220, 38, 38, .35);
}

.kb-firm-alert.alert-warning .kb-firm-alert-icon {
    background: #f59e0b;
    color: #fffbeb;
    box-shadow: 0 4px 10px rgba(217, 119, 6, .35);
}

.kb-firm-alert-text {
    flex: 1 1 auto;
}

/* Foto galeri küçük kartları */
.kb-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    padding: 2px;
    overflow: hidden;
}

.kb-gallery-thumb {
    width: 100%;
    padding-top: 66%;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
}

.kb-gallery-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kb-gallery-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: .7rem;
    background: rgba(15, 23, 42, .85);
    color: #f9fafb;
}

.kb-gallery-item-removed {
    opacity: .6;
    border-color: #fecaca;
    background-color: #fef2f2;
}

.kb-gallery-actions {
    margin-top: .15rem;
}

.kb-working-hours-range {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.kb-working-hours-range .form-control {
    width: 110px;
}

@media (min-width: 768px) {
    .kb-working-hours-modes {
        flex-wrap: nowrap;
    }

    .kb-working-hours-modes>[class*="col-"] {
        flex: 1 1 0;
        width: auto;
    }
}

@media (max-width: 575.98px) {
    .kb-firm-header-controls {
        width: 100%;
        justify-content: center;
    }

    .kb-firm-select-wrapper {
        width: 100%;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .kb-firm-edit-summary-logo {
        width: 96px;
        aspect-ratio: 16 / 9;
        font-size: 1rem;
    }

    .kb-firm-edit-form-card .card-body {
        padding: 1.25rem 1rem 1.5rem;
    }

    .kb-form-footer {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .kb-firm-edit-tabs {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: .25rem;
    }

    .kb-firm-edit-tabs .nav-item {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    .kb-firm-edit-tabs .nav-link {
        width: 100%;
        padding: .35rem .4rem;
        font-size: .78rem;
    }

    .kb-working-hours-day-label {
        min-width: 80px;
    }

    .kb-working-hours-range .form-control {
        width: 100px;
    }
}

@media (max-width: 575.98px) {
    .kb-firm-header-controls {
        width: 100%;
        justify-content: center;
    }
}

/* Mobilde alt menü barı altında kalmaması için ekstra alt boşluk */
@media (max-width: 767.98px) {
    main {
        padding-bottom: var(--tabbar-h);
    }

    .kb-firm-edit-bottom-spacer {
        height: 72px;
    }
}

/* Tablet görünümünde de alt kaydırma alanı */
@media (min-width: 768px) and (max-width: 991.98px) {
    .kb-firm-edit-bottom-spacer {
        height: 72px;
    }
}

/* Masaüstü görünümünde formun altındaki kayıt butonunu karta ortala */
@media (min-width: 992px) {
    .kb-form-footer>.d-flex {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .kb-form-footer .text-md-end {
        text-align: center !important;
        width: 100%;
    }

    .kb-firm-summary-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .kb-firm-edit-summary-logo {
        width: 200px;
    }

    .kb-firm-summary-header .flex-grow-1 {
        width: 100%;
        text-align: center;
    }

    .kb-firm-summary-header .d-flex.flex-wrap {
        justify-content: center;
    }

    .kb-firm-summary-meta {
        justify-content: center;
        text-align: center;
    }

    /* Özet kartı sol sütunda dikey olarak yaklaşık ortaya sabitle. */
    .kb-firm-edit-summary-card {
        position: sticky;
        top: calc(50vh - 260px);
    }
}