/* ═══════════════════════════════════════════════════
   KALİTE BELGE YÖNETİMİ - AdminLTE 2.4.5 Ek Stiller
   Sadece AdminLTE'nin kapsamadığı özel bileşenler
   ═══════════════════════════════════════════════════ */

/* ── Kodlama Şablonu ── */
.variable-tag {
  display: inline-block;
  background: #3c8dbc;
  color: #fff;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  margin: 3px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Courier New', monospace;
}
.variable-tag:hover {
  background: #367fa9;
}
.template-preview-box {
  background: #222d32;
  color: #fff;
  border-radius: 3px;
  padding: 15px 20px;
  margin-top: 15px;
  font-family: 'Courier New', monospace;
}
.template-preview-box .preview-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #00a65a;
  font-weight: 700;
  margin-bottom: 6px;
}
.template-preview-box .preview-pattern {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}
.template-preview-box .preview-result {
  font-size: 20px;
  font-weight: 700;
  color: #f39c12;
  letter-spacing: 1px;
}

/* ── Onay Akışı ── */
.approval-step {
  display: flex;
  align-items: flex-start;
  padding: 12px 15px;
  background: #f4f4f4;
  border-radius: 3px;
  margin-bottom: 6px;
  border-left: 4px solid #3c8dbc;
  transition: border-color 0.2s;
}
.approval-step:hover { border-left-color: #f39c12; }
.approval-step .step-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: #3c8dbc; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; margin-right: 12px; flex-shrink: 0;
}
.approval-step .step-content { flex: 1; }
.approval-step .step-content h5 { font-weight: 700; font-size: 13px; margin: 0 0 2px; }
.approval-step .step-content small { color: #999; }
.approval-step .step-actions { display: flex; gap: 3px; margin-left: 8px; }
.flow-connector {
  width: 2px; height: 16px; background: #ddd;
  margin: 0 0 0 28px;
}

/* ── Onay Timeline ── */
.approval-timeline { padding: 8px 0; }
.approval-timeline-item {
  display: flex; align-items: flex-start; padding: 10px 0;
  position: relative; margin-left: 18px;
}
.approval-timeline-item::before {
  content: ''; position: absolute; left: -12px; top: 0; bottom: 0;
  width: 2px; background: #ddd;
}
.approval-timeline-item:last-child::before { bottom: 50%; }
.approval-timeline-item .tl-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; flex-shrink: 0;
  margin-left: -30px; margin-right: 10px; z-index: 1;
}
.tl-dot-pending { background: #aaa; }
.tl-dot-approved { background: #00a65a; }
.tl-dot-rejected { background: #dd4b39; }
.tl-dot-inreview { background: #3c8dbc; }
.approval-timeline-item .tl-content { flex: 1; }
.approval-timeline-item .tl-content h5 { font-weight: 700; font-size: 13px; margin: 0 0 2px; }
.approval-timeline-item .tl-content small { color: #999; font-size: 11.5px; }
.approval-timeline-item .tl-content .tl-note {
  margin-top: 4px; font-size: 12px; background: #fcf8e3; padding: 5px 10px;
  border-radius: 3px; border-left: 3px solid #f39c12;
}

/* ── Yetki Matrisi ── */
.permission-matrix th.rotate-header {
  writing-mode: vertical-lr; text-orientation: mixed;
  transform: rotate(180deg); padding: 12px 6px;
  font-size: 11px; text-align: center; min-width: 40px;
}
.perm-check { width: 16px; height: 16px; cursor: pointer; }

/* ── Dosya Listesi ── */
.file-item {
  display: flex; align-items: center;
  padding: 8px 12px; background: #f4f4f4;
  border-radius: 3px; margin-bottom: 4px;
}
.file-item:hover { background: #ecf0f1; }
.file-item .file-icon {
  width: 32px; height: 32px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px; font-size: 14px; color: #fff; flex-shrink: 0;
}
.file-icon-pdf { background: #dd4b39; }
.file-icon-word { background: #3c8dbc; }
.file-icon-excel { background: #00a65a; }
.file-icon-other { background: #999; }
.file-item .file-info { flex: 1; }
.file-item .file-info .file-name { font-weight: 600; font-size: 13px; }
.file-item .file-info .file-meta { font-size: 11px; color: #999; }
.file-item .file-actions { display: flex; gap: 3px; }

/* ── Dağıtım Tablo ── */
.dist-table th { font-size: 11px; padding: 6px 8px; }
.dist-table td { font-size: 12px; padding: 6px 8px; }
.dist-table .form-control { font-size: 12px; padding: 4px 6px; height: 30px; }

/* ── Filtre Barı ── */
.filter-bar {
  background: #f4f4f4; border-radius: 3px;
  padding: 12px 15px; margin-bottom: 15px;
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }
.filter-bar label { font-size: 11px; margin-bottom: 3px; }

/* ── Confirm Dialog ── */
.confirm-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
.confirm-box {
  background: #fff; border-radius: 5px; padding: 30px;
  text-align: center; max-width: 360px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.2);
}
.confirm-box .fa { font-size: 44px; color: #f39c12; margin-bottom: 12px; }
.confirm-box h4 { font-weight: 700; margin-bottom: 6px; }
.confirm-box p { color: #999; font-size: 13px; margin-bottom: 18px; }
.confirm-box .btn { margin: 0 4px; min-width: 80px; }

/* ── Talep Tip Badge ── */
.req-type-badge {
  display: inline-block; padding: 3px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 700;
}
.req-type-new { background: #d9edf7; color: #31708f; }
.req-type-revision { background: #fcf8e3; color: #8a6d3b; }
.req-type-cancel { background: #f2dede; color: #a94442; }

/* ── Mono kod font ── */
.code-font { font-family: 'Courier New', monospace; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .filter-bar { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════
     KİMLİK SİSTEMİ (Navbar + Login + Kullanıcılar)
   ═══════════════════════════════════════════════════ */

/* Navbar kullanıcı menüsü */
.navbar-custom-menu .nav > li > a { padding: 15px 12px; }
.user-avatar-sm {
  display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; letter-spacing: 0.5px;
  margin-right: 6px;
}
.user-nav-label { font-size: 13px; line-height: 1.2; }
.user-nav-label small {
  display: block; font-size: 10.5px;
  color: rgba(255,255,255,0.65); font-weight: 400; letter-spacing: 0.3px;
}
.dropdown-menu.dropdown-user {
  min-width: 280px; padding: 0; border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.dropdown-user .user-header-li {
  padding: 16px 18px;
  background: linear-gradient(135deg, #3c8dbc 0%, #367fa9 100%);
  color: #fff; border-radius: 4px 4px 0 0;
}
.dropdown-user .user-name-lg { font-size: 14px; font-weight: 700; }
.dropdown-user .user-role-sm { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.dropdown-user .user-dept-sm { font-size: 11.5px; opacity: 0.75; margin-top: 4px; }
.dropdown-user .divider-sm { height: 1px; background: #eee; margin: 0; }
.dropdown-user .dropdown-header {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: #999; padding: 8px 16px 4px; font-weight: 700;
}
.dropdown-user li > a {
  padding: 8px 16px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.dropdown-user li > a:hover { background: #f4f4f4; }
.dropdown-user li > a small {
  display: block; color: #999; font-size: 11px; margin-left: auto;
}

/* Login sayfası */
.kby-login-body {
  background: linear-gradient(135deg, #1b3a5c 0%, #2c5d8a 50%, #3c8dbc 100%);
  min-height: 100vh;
}
.kby-login-box { width: 400px; margin: 7% auto; }
.login-logo { color: #fff; font-size: 32px; font-weight: 300; text-align: center; margin-bottom: 20px; }
.login-logo b { font-weight: 700; }
.kby-login-card {
  border-radius: 5px; padding: 28px 28px 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.kby-login-card .login-box-msg {
  font-size: 15px; font-weight: 600; color: #444;
  text-align: left; padding: 0 0 16px; margin: 0 0 16px;
  border-bottom: 1px solid #eee;
}
.kby-login-card .login-box-msg .fa { color: #3c8dbc; margin-right: 6px; }
.kby-login-card label { font-size: 12px; font-weight: 600; color: #555; }
.kby-login-user-info {
  background: #f4f8fb; border: 1px solid #dbe7f0; border-radius: 4px;
  padding: 12px 14px; margin-top: 12px;
}
.kby-login-user-row { display: flex; align-items: center; gap: 12px; }
.kby-login-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: #3c8dbc; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.kby-login-user-name { font-weight: 700; font-size: 14px; color: #333; }
.kby-login-user-title { font-size: 12px; color: #777; margin-top: 1px; }
.kby-login-user-meta { font-size: 11px; color: #999; margin-top: 4px; }
.kby-login-user-meta .fa { margin-right: 2px; }
.kby-login-sim-note {
  margin-top: 18px; padding: 10px 12px; background: #fcf8e3;
  border-left: 3px solid #f39c12; border-radius: 3px;
  font-size: 11.5px; color: #8a6d3b;
}
.kby-login-sim-note .fa { margin-right: 4px; }
.kby-login-footer {
  text-align: center; margin-top: 14px; color: rgba(255,255,255,0.7);
}
.kby-login-footer a { color: rgba(255,255,255,0.9); text-decoration: underline; }

/* Select2 Bootstrap 3 için login formu */
.kby-login-card .select2-container--default .select2-selection--single {
  height: 38px; border-color: #d2d6de;
}
.kby-login-card .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px; padding-left: 10px;
}
.kby-login-card .select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }

/* Kullanıcılar sekmesi — kimlik DataTable satırları */
.user-row-avatar {
  display: inline-flex; width: 30px; height: 30px; border-radius: 50%;
  background: #3c8dbc; color: #fff;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; margin-right: 8px;
}
.user-role-badge {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  background: #eef3f7; color: #3c8dbc;
  font-size: 10.5px; font-weight: 600; margin-right: 3px;
}

/* Signature preview */
.signature-preview {
  display: inline-block; max-width: 180px; max-height: 60px;
  border: 1px dashed #ccc; padding: 4px; background: #fafafa;
  border-radius: 3px;
}

/* Yetkisiz ekran için merkezi mesaj (requirePerm) */
.kby-no-perm-screen {
  max-width: 400px; margin: 60px auto; text-align: center;
  padding: 30px; background: #fff; border-radius: 5px;
}

/* ═══════════════════════════════════════════════════
     AUDIT TRAIL (İşlem Günlüğü)
   ═══════════════════════════════════════════════════ */

.audit-time { font-family: 'Courier New', monospace; font-size: 12px; color: #555; }
.audit-user b { font-size: 13px; }
.audit-user small { font-size: 10.5px; }

.audit-entity-log td { vertical-align: top; padding: 8px 10px; font-size: 12.5px; }
.audit-entity-log th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #666; }
.audit-entity-log .label { font-size: 10.5px; font-weight: 600; }

.audit-change-table { margin-top: 8px; background: #fafafa; }
.audit-change-table th { background: #f4f4f4; font-size: 11px; text-transform: uppercase; color: #666; padding: 6px 10px; }
.audit-change-table td { padding: 6px 10px; font-size: 12.5px; word-break: break-word; }
.audit-change-table td:first-child { width: 22%; }
.audit-change-table del { color: #999; text-decoration: line-through; }
.audit-change-table .text-success { color: #2d8a4e; font-weight: 600; }
