/**
 * panel-layout.css
 * BY4 panel ana iskeleti – Personel, Kişiler vb. için ortak layout.
 * Kaynak: personel/2_personel_list.php içindeki by4-* tanımları.
 */

/* ─── by4 Personel Tasarım ─── */
.by4-personel-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Main Card ── */
.by4-main-card {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Tabs (BY4 global: yatay padding kart ile aynı) ── */
.by4-tabs-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    padding: 0 var(--by4-card-padding-x, 24px);
    flex-shrink: 0;
}

.by4-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.by4-tab:hover { color: #6b7280; text-decoration: none; }

.by4-tab.active {
    color: #6366F1;
    border-bottom-color: #6366F1;
}

.by4-tab .by4-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
}

.by4-badge.green { background: #d1fae5; color: #047857; }
.by4-badge.red   { background: #fee2e2; color: #dc2626; }
.by4-badge.gray  { background: #f3f4f6; color: #6b7280; }

/* Sekmeler sağ taraf meta alanı (Toplam X kayıt · Sayfa Y/Z) */
.by4-tabs-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.by4-tabs-meta-count {
    white-space: nowrap;
}

.by4-tabs-meta-page {
    white-space: nowrap;
}

/* ── Search Row (BY4 global yatay padding) ── */
.by4-search-row {
    padding: 10px var(--by4-card-padding-x, 24px);
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.by4-search-wrap {
    position: relative;
    width: 256px;
}

.by4-search-wrap .fa-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 11px;
    pointer-events: none;
}

.by4-search-input {
    width: 100%;
    height: 38px;
    padding-left: 28px;
    padding-right: 10px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    outline: none;
    transition: all 0.18s ease;
    font-family: inherit;
}

.by4-search-input:focus {
    border-color: #3B7FB9;
    box-shadow: 0 0 0 3px rgba(59,127,185,0.12);
}

/* ── Toolbar ── */
.by4-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(249,250,251,0.6);
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.by4-toolbar-meta {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
}

.by4-toolbar-meta .by4-selected-count {
    margin-left: 8px;
    color: #3B7FB9;
    font-weight: 600;
}

.by4-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #d1d5db;
    cursor: not-allowed;
    transition: all 0.18s ease;
    font-family: inherit;
}

.by4-delete-btn.has-selection {
    border-color: #fecaca;
    background: #fef2f2;
    color: #ef4444;
    cursor: pointer;
}

.by4-delete-btn.has-selection:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* Avatar */
.by4-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.by4-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.by4-av-1 { background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); }
.by4-av-2 { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.by4-av-3 { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }
.by4-av-4 { background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%); }
.by4-av-5 { background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%); }
.by4-av-6 { background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%); }

.by4-name {
    font-weight: 600;
    color: #111827;
    font-size: 11px;
    white-space: nowrap;
}

/* Görev badge */
.by4-gorev-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #3B7FB9;
    background: rgba(59,127,185,0.1);
    border: 1px solid rgba(59,127,185,0.2);
    white-space: nowrap;
}

/* Bakiye */
.by4-bakiye-pozitif { color: #10b981; font-weight: 700; font-size: 11px; white-space: nowrap; }
.by4-bakiye-negatif { color: #ef4444; font-weight: 700; font-size: 11px; white-space: nowrap; }
.by4-bakiye-sifir   { color: #d1d5db; font-weight: 700; font-size: 11px; }

/* Durum badge */
.by4-durum-aktif {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: 600;
    background: #ecfdf5;
    color: #059669;
}

.by4-durum-pasif {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: 600;
    background: #fffbeb;
    color: #d97706;
}

.by4-durum-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.by4-durum-aktif .by4-durum-dot { background: #10b981; }
.by4-durum-pasif .by4-durum-dot { background: #f59e0b; }

/* ─── Sayfa Başlığı (Kişiler, Personel vb.) ─── */
.by-page-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.by-page-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.by-page-search {
    max-width: 420px;
}

.by-page-search .form-control {
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.by-page-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* İşlemler */
.by4-islem-btn {
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.by4-islem-btn:hover {
    color: #3B7FB9;
    border-color: rgba(59,127,185,0.3);
    background: rgba(59,127,185,0.06);
}

/* İşlemler Dropdown */
.by4-islem-dropdown {
    position: relative;
    display: inline-block;
}

.by4-islem-menu {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    min-width: 176px;
    padding: 6px 0;
    z-index: 9999;
}

.by4-islem-menu.show { display: block; }

.by4-islem-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.by4-islem-menu-item:hover { background: #f9fafb; }
.by4-islem-menu-item.blue:hover  { background: #eff6ff; }
.by4-islem-menu-item.amber:hover { background: #fffbeb; }
.by4-islem-menu-item.red:hover   { background: #fef2f2; }

.by4-islem-menu-item i {
    width: 14px;
    text-align: center;
    font-size: 11px;
}

.by4-islem-menu-item.blue  i { color: #3b82f6; }
.by4-islem-menu-item.amber i { color: #f59e0b; }
.by4-islem-menu-item.red   i { color: #ef4444; }

/* Empty state */
.by4-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    color: #d1d5db;
}

.by4-empty-icon {
    width: 56px;
    height: 56px;
    background: #f9fafb;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
}

.by4-empty-title {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.by4-empty-sub {
    font-size: 11px;
    color: #9ca3af;
}

/* ── Pagination ── */
.by4-pagination-row {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid #f3f4f6;
    background: transparent;
    flex-wrap: wrap;
    gap: 8px;
}

.by4-pagination-nav {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.by4-page-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
}

.by4-page-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
}

.by4-page-btn:not(:disabled) { color: #3B7FB9; }
.by4-page-btn:not(:disabled):hover { background: rgba(59,127,185,0.06); }

.by4-page-btn.prev-btn { border-right: 1px solid #e5e7eb; }
.by4-page-btn.next-btn { border-left: 1px solid #e5e7eb; }

.by4-pagination-row,
.by4-page-info,
.by4-total-info,
.by4-pagination-row label,
.by4-pagination-row select {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.by4-page-info {
    padding: 0 10px;
}

.by4-page-info,
.by4-total-info {
    white-space: nowrap;
    line-height: 1;
}

.by4-pagination-row select {
    height: 32px;
    padding: 0 8px;
}

/* ── Tablo iskeleti (by4-table) ── */
.by4-table-area {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.by4-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--by-list-font-size) !important;
}

.by4-table thead tr {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* Global tablo header – Personel, Kişiler, Firmalar, Bağımsız, Kasalar */
.by4-table thead th {
    background: #f8fafc;
    font-size: var(--by-list-font-size-head) !important;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 14px;
    white-space: nowrap;
}

/* Bootstrap .table header'ını ezmek için daha spesifik selector */
.table.by4-table > thead > tr > th {
    background: #f8fafc !important;
    font-size: var(--by-list-font-size-head) !important;
    font-weight: 600 !important;
    color: #64748b !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 12px 14px !important;
    white-space: nowrap !important;
}

.by4-table thead th.th-check {
    width: 36px;
    text-align: center;
}

.by4-table tbody tr {
    border-bottom: 1px solid #f9fafb;
    transition: background 0.12s ease;
}

.by4-table tbody tr:last-child {
    border-bottom: none;
}

.by4-table tbody tr:hover {
    background: rgba(249, 250, 251, 0.5);
}

.by4-table tbody tr.by4-row-checked {
    background: rgba(59, 127, 185, 0.04);
}

.by4-table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    color: #374151;
    white-space: nowrap;
}

.by4-table tbody td.ziraat-col-aciklama {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: min(42vw, 28rem);
}

.by4-table.ziraat-banka-hareket tbody td.ziraat-col-aciklama {
    max-width: min(32vw, 22rem) !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.35;
    vertical-align: top;
}

.by4-table.ziraat-banka-hareket tbody td:nth-child(4) {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.by4-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #3B7FB9;
    border-radius: 3px;
    cursor: pointer;
}

/* ─── Arka plan ve Layout: Tüm yonetim-ui sayfaları için ─── */
body.yonetim-ui .app-content {
    background-color: #f8fafc !important;
}

body.yonetim-ui main.content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

body.yonetim-ui .by4-personel-wrap {
    background: transparent !important;
    background-image: none !important;
}
