/* 7CO WORK – uygulama stilleri */
:root {
  --sidebar-w: 236px;
  --topbar-h: 56px;
  --sidebar-bg: #1f2937;
  --sidebar-hover: #2b3648;
  --sidebar-active: #0d6efd;
  --body-bg: #f1f3f7;
  --card-border: #e5e8ef;
}
html, body { height: 100%; }
body { background: var(--body-bg); font-size: 14px; color: var(--bs-body-color, #1f2937); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn, .nav-link, .dropdown-item, .page-link, .badge { text-decoration: none !important; }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }
.app-sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: #cbd5e1; position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; display: flex; flex-direction: column; overflow-y: auto; transition: transform .2s; }
.app-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.app-content { padding: 18px 22px; flex: 1; }
.app-footer { padding: 8px 22px; border-top: 1px solid var(--card-border); }
.app-topbar { height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--card-border); display: flex; align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 1020; }
.sidebar-brand { display: flex; align-items: center; padding: 12px 16px; height: var(--topbar-h); border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand a { color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #0d6efd; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.brand-logo { max-height: 30px; max-width: 120px; }
.brand-text { font-size: 15px; letter-spacing: .3px; }
.sidebar-nav { padding: 8px; display: flex; flex-direction: column; gap: 1px; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-nav .nav-link { color: #cbd5e1; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 6px; font-size: 13.5px; }
.sidebar-nav .nav-link i { font-size: 16px; width: 18px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .app-main { margin-left: 0; }
  .app-content { padding: 12px; }
}

/* Topbar */
.topbar-search { position: relative; flex: 1; max-width: 520px; }
.topbar-search > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8a94a6; }
.topbar-search input { padding-left: 32px; background: #f4f6fa; border-color: transparent; }
.topbar-search input:focus { background: #fff; }
.search-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--card-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 70vh; overflow-y: auto; z-index: 1050; margin-top: 4px; }
.search-dropdown.show { display: block; }
.search-dropdown .sd-group { padding: 6px 12px 2px; font-size: 11px; text-transform: uppercase; color: #8a94a6; font-weight: 600; letter-spacing: .5px; }
.search-dropdown a { display: block; padding: 6px 12px; color: inherit; }
.search-dropdown a:hover { background: #f4f6fa; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-icon { position: relative; color: #4b5563; display: inline-flex; padding: 4px; }
.notif-count { position: absolute; top: -2px; right: -4px; background: #dc3545; color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.notif-menu { width: 360px; max-width: 92vw; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f0f2f5; color: inherit; }
.notif-item:hover { background: #f8f9fb; text-decoration: none; }
.notif-item.unread { background: #eef4ff; }
.notif-item .t { font-weight: 600; font-size: 13px; }
.notif-item .m { font-size: 12px; color: #6b7280; }

/* Kartlar ve tablolar */
.card { border: 1px solid var(--card-border); border-radius: 8px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--card-border); padding: 10px 14px; font-weight: 600; }
.card-body { padding: 14px; }
.table { font-size: 13.5px; }
.table > :not(caption) > * > * { padding: .45rem .6rem; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: #6b7280; font-weight: 600; background: #f8f9fb; }
.table-hover tbody tr:hover { background: #f8f9fb; }
.page-title { font-weight: 700; }

/* İstatistik kartları */
.stat-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 12px; color: #6b7280; }
.stat-card a { color: inherit; }
.bg-soft-primary { background: #e7f0ff; color: #0d6efd; }
.bg-soft-success { background: #e3f6ec; color: #198754; }
.bg-soft-danger { background: #fde8e8; color: #dc3545; }
.bg-soft-warning { background: #fff4de; color: #d97706; }
.bg-soft-info { background: #e0f4f8; color: #0891b2; }
.bg-soft-secondary { background: #eef0f3; color: #6b7280; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.user-link { color: inherit; font-weight: 500; }

/* Yorumlar / aktivite */
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.comment:last-child { border-bottom: 0; }
.comment .comment-body { flex: 1; min-width: 0; }
.comment .comment-meta { font-size: 12px; color: #6b7280; }
.comment .comment-text { white-space: pre-wrap; word-wrap: break-word; }
.comment-reply { margin-left: 42px; }
.mention { color: #0d6efd; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: #e5e8ef; }
.timeline li { position: relative; padding-left: 26px; padding-bottom: 12px; }
.timeline li::before { content: ''; position: absolute; left: 2px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #0d6efd; }
.timeline .tl-time { font-size: 12px; color: #6b7280; }
.activity-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; }
.activity-row .time { color: #6b7280; min-width: 42px; font-variant-numeric: tabular-nums; }

/* Görev listesi */
.task-row.overdue .task-due { color: #dc3545; font-weight: 600; }
.task-title { font-weight: 500; color: inherit; }
.priority-critical { border-left: 3px solid #dc3545; }
.priority-high { border-left: 3px solid #fd7e14; }
.checklist-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; }
.checklist-item.done label { text-decoration: line-through; color: #9ca3af; }
.checklist-item .meta { font-size: 11px; color: #9ca3af; }
.progress { height: 8px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 260px; flex: 1; background: #eceff4; border-radius: 8px; padding: 8px; }
.kanban-col h6 { font-size: 12px; text-transform: uppercase; color: #6b7280; padding: 4px 6px; }
.kanban-card { background: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--card-border); font-size: 13px; }

/* Feed */
.feed-post { margin-bottom: 12px; }
.feed-post .post-content { white-space: pre-wrap; word-wrap: break-word; }
.feed-images img { max-height: 220px; border-radius: 6px; object-fit: cover; }

/* Ürün */
.product-thumb { object-fit: cover; border-radius: 6px; background: #f1f3f7; border: 1px solid var(--card-border); }
.product-image-lg { max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--card-border); background: #fff; }
.info-card { border-left: 4px solid #cbd5e1; }
.info-card.approved { border-left-color: #198754; }
.info-card.pending { border-left-color: #ffc107; }
.info-card.rejected { border-left-color: #dc3545; }
.info-content { white-space: pre-wrap; word-wrap: break-word; }
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; margin: 0; }
dl.kv dt { color: #6b7280; font-weight: 500; font-size: 13px; }
dl.kv dd { margin: 0; }
@media (max-width: 575.98px) { dl.kv { grid-template-columns: 1fr; } dl.kv dt { margin-top: 6px; } }

/* Takvim */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--card-border); border: 1px solid var(--card-border); }
.cal-cell { background: #fff; min-height: 96px; padding: 4px; font-size: 12px; }
.cal-cell.other { background: #f8f9fb; color: #9ca3af; }
.cal-cell.today .d { background: #0d6efd; color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal-cell .d { font-weight: 600; }
.cal-ev { display: block; padding: 1px 5px; border-radius: 4px; margin-top: 2px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.cal-ev:hover { text-decoration: none; opacity: .85; color: #fff; }
.cal-head { background: #f8f9fb; text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 6px 0; color: #6b7280; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1f2937, #0d3b8a); }
.login-box { background: #fff; padding: 36px; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,.25); margin: 16px; }

/* Genel */
.text-xs { font-size: 11px; }
.small-label { font-size: 11px; text-transform: uppercase; color: #6b7280; letter-spacing: .4px; font-weight: 600; }
.attention-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f2f5; }
.attention-item:last-child { border-bottom: 0; }
.attention-item .num { font-size: 20px; font-weight: 700; min-width: 34px; text-align: center; }
.empty-state { text-align: center; color: #9ca3af; padding: 26px 10px; }
.empty-state i { font-size: 32px; display: block; margin-bottom: 6px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 140px; }
.cursor-pointer { cursor: pointer; }
.pre-wrap { white-space: pre-wrap; word-wrap: break-word; }
.article-content { line-height: 1.65; }
.article-content img { max-width: 100%; }
.version-diff del { background: #fde8e8; text-decoration: line-through; }
.version-diff ins { background: #e3f6ec; text-decoration: none; }
.toast-container { z-index: 2000; }
.modal-body .form-label { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.sortable-ghost { opacity: .4; }
.nav-tabs .nav-link { font-size: 13.5px; padding: 8px 12px; }
.read-list .badge { min-width: 60px; }
@media print { .app-sidebar, .app-topbar, .page-actions, .app-footer { display: none !important; } .app-main { margin: 0; } }

/* ---------- Dosya galerisi / sürükle-bırak yükleme ---------- */
.file-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.file-thumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--card-border); background: #f1f3f7; }
.file-thumb > a { display: block; width: 100%; height: 100%; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb:hover img { opacity: .85; }
.file-thumb .file-thumb-cat { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; line-height: 1.5; padding: 0 4px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-thumb .file-thumb-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.file-thumb .file-thumb-del:hover { background: #dc3545; }
.file-gallery-sm .file-thumb { width: 72px; height: 72px; }
.upload-drop { border: 2px dashed var(--card-border); border-radius: 8px; padding: 12px; text-align: center; color: #6b7280; cursor: pointer; transition: background .15s, border-color .15s; }
.upload-drop.dragover { border-color: #0d6efd; background: #eef4ff; color: #0d6efd; }
.upload-drop .upload-files { font-size: 12px; word-break: break-all; }
.lightbox-img { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; }

/* ---------- Günlük gün şeridi ---------- */
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day-strip .day-item { flex: 0 0 auto; min-width: 54px; text-align: center; padding: 4px 6px 5px; border-radius: 8px; border: 1px solid var(--card-border); background: #fff; color: inherit; font-size: 13px; font-weight: 600; }
.day-strip .day-item:hover { background: #f4f6fa; text-decoration: none; }
.day-strip .day-item.is-today { border-color: #0d6efd; }
.day-strip .day-item.active { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.day-strip .day-item .dw { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .3px; font-weight: 600; color: #6b7280; }
.day-strip .day-item.active .dw { color: #dbe7ff; }
.day-strip .day-item .dot { display: block; width: 6px; height: 6px; border-radius: 50%; margin: 3px auto 0; background: #dfe3ea; }
.day-strip .day-item .dot.has { background: #198754; }
.day-strip .day-item.active .dot { background: rgba(255,255,255,.35); }
.day-strip .day-item.active .dot.has { background: #fff; }


/* ---------- Koyu tema ---------- */
[data-bs-theme="dark"] {
  --body-bg: #0f141b;
  --card-border: #2a3341;
  --sidebar-bg: #111820;
  --sidebar-hover: #1c2632;
  --bs-body-bg: #0f141b;
  --bs-body-color: #d5dbe3;
  --bs-secondary-color: #97a1ad;
}
[data-bs-theme="dark"] .app-topbar, [data-bs-theme="dark"] .card, [data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .kanban-card, [data-bs-theme="dark"] .cal-cell, [data-bs-theme="dark"] .search-dropdown,
[data-bs-theme="dark"] .login-box, [data-bs-theme="dark"] .product-image-lg { background: #171e27; }
[data-bs-theme="dark"] .app-topbar { border-color: var(--card-border); }
[data-bs-theme="dark"] .topbar-search input { background: #0f141b; color: #d5dbe3; }
[data-bs-theme="dark"] .topbar-search input:focus { background: #0f141b; }
[data-bs-theme="dark"] .topbar-icon, [data-bs-theme="dark"] .topbar-right a.text-dark, [data-bs-theme="dark"] #sidebarToggle { color: #d5dbe3 !important; }
[data-bs-theme="dark"] .table thead th, [data-bs-theme="dark"] .cal-head, [data-bs-theme="dark"] .cal-cell.other { background: #111820; color: #97a1ad; }
[data-bs-theme="dark"] .table-hover tbody tr:hover, [data-bs-theme="dark"] .search-dropdown a:hover, [data-bs-theme="dark"] .notif-item:hover { background: #1c2632; }
[data-bs-theme="dark"] .notif-item.unread { background: #182338; }
[data-bs-theme="dark"] .comment, [data-bs-theme="dark"] .activity-row, [data-bs-theme="dark"] .attention-item, [data-bs-theme="dark"] .notif-item { border-color: #232c38; }
[data-bs-theme="dark"] .timeline::before { background: #2a3341; }
[data-bs-theme="dark"] .timeline li::before { background: #171e27; }
[data-bs-theme="dark"] .kanban-col { background: #111820; }
[data-bs-theme="dark"] .cal-grid { background: var(--card-border); border-color: var(--card-border); }
[data-bs-theme="dark"] .product-thumb { background: #111820; border-color: var(--card-border); }
[data-bs-theme="dark"] .bg-soft-primary { background: #1a2a4a; } [data-bs-theme="dark"] .bg-soft-success { background: #143323; }
[data-bs-theme="dark"] .bg-soft-danger { background: #3d1d1d; } [data-bs-theme="dark"] .bg-soft-warning { background: #3d2e10; }
[data-bs-theme="dark"] .bg-soft-info { background: #11333b; } [data-bs-theme="dark"] .bg-soft-secondary { background: #232c38; }
[data-bs-theme="dark"] .badge.text-bg-light { background: #232c38 !important; color: #d5dbe3 !important; border-color: #2a3341 !important; }
[data-bs-theme="dark"] .text-dark { color: #d5dbe3 !important; }
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-light { background: #171e27 !important; }
[data-bs-theme="dark"] .version-diff del { background: #4a1f1f; } [data-bs-theme="dark"] .version-diff ins { background: #1d3d2a; }
[data-bs-theme="dark"] .login-page { background: linear-gradient(135deg, #0b1016, #12284f); }
[data-bs-theme="dark"] .app-footer { border-color: var(--card-border); }
[data-bs-theme="dark"] .file-thumb { background: #111820; }
[data-bs-theme="dark"] .upload-drop.dragover { background: #182338; }
[data-bs-theme="dark"] .day-strip .day-item { background: #171e27; }
[data-bs-theme="dark"] .day-strip .day-item:hover { background: #1c2632; }
[data-bs-theme="dark"] .day-strip .day-item .dot { background: #2a3341; }

/* ---------- Excel/CSV tablo önizleme (knowledge) ---------- */
.sheet-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--card-border); border-radius: 8px; }
.sheet-wrap-sm { max-height: 420px; }
.sheet-table { font-size: .82rem; white-space: nowrap; margin: 0; }
.sheet-table thead th { position: sticky; top: 0; z-index: 3; background: #f4f6fa; cursor: pointer; user-select: none; white-space: nowrap; }
.sheet-table thead th.sheet-rownum { z-index: 4; left: 0; cursor: default; }
.sheet-table td, .sheet-table th { padding: 4px 8px; vertical-align: top; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.sheet-table td.sheet-rownum, .sheet-table th.sheet-rownum { position: sticky; left: 0; background: #f4f6fa; color: #8a93a0; text-align: right; width: 48px; min-width: 48px; font-size: .75rem; }
.sheet-sort-ico { opacity: .25; font-size: .7rem; }
.sheet-table thead th.sorted-asc .sheet-sort-ico, .sheet-table thead th.sorted-desc .sheet-sort-ico { opacity: 1; color: var(--bs-primary); }
.sheet-table thead th.sorted-asc .sheet-sort-ico::before { content: "\f148"; }
.sheet-table thead th.sorted-desc .sheet-sort-ico::before { content: "\f128"; }

/* ---------- Dosya küçük görselleri + lightbox ---------- */
.k-thumb { width: 104px; text-align: center; }
.k-thumb img, .att-thumb img { width: 104px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--card-border); background: #f1f3f7; }
.att-thumb { width: 104px; text-align: center; }
.att-thumb img { cursor: zoom-in; }
.att-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 24px; }
.att-lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 6px; }
.att-lightbox .lb-bar { color: #fff; display: flex; align-items: center; gap: 14px; font-size: .85rem; }
.att-lightbox .lb-bar a { color: #9fd0ff; }

[data-bs-theme="dark"] .sheet-table thead th, [data-bs-theme="dark"] .sheet-table td.sheet-rownum, [data-bs-theme="dark"] .sheet-table th.sheet-rownum { background: #111820; color: #97a1ad; }
[data-bs-theme="dark"] .sheet-wrap { border-color: var(--card-border); }
[data-bs-theme="dark"] .k-thumb img, [data-bs-theme="dark"] .att-thumb img { background: #111820; border-color: var(--card-border); }


/* Ürün görseli hover önizleme */
#hoverPreview { position: fixed; z-index: 3000; pointer-events: none; display: none; background: #fff; border: 1px solid var(--card-border); border-radius: 10px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
#hoverPreview img { display: block; width: 300px; max-width: 40vw; aspect-ratio: 9 / 16; object-fit: contain; border-radius: 6px; background: #f1f3f7; }
[data-bs-theme="dark"] #hoverPreview { background: #171e27; }
[data-bs-theme="dark"] #hoverPreview img { background: #111820; }
