/* ═══════════════════════════════════════════════
   İş Takip Sistemi — Public & Admin CSS
   ═══════════════════════════════════════════════ */
:root {
  --ist-primary:  #2271b1;
  --ist-success:  #059669;
  --ist-danger:   #dc2626;
  --ist-warning:  #d97706;
  --ist-border:   #dcdcde;
  --ist-bg:       #f6f7f7;
  --ist-white:    #fff;
  --ist-radius:   8px;
  --ist-shadow:   0 2px 10px rgba(0,0,0,.1);
  --ist-trans:    .18s ease;
}

/* ── Reset ────────────────────────────────────── */
.ist-frontend *, .ist-kanban-wrap *, .ist-stats-wrap * {
  box-sizing: border-box;
}

/* ── Toolbar ──────────────────────────────────── */
.ist-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}
.ist-search-input, .ist-select, .ist-input, .ist-textarea {
  padding: 8px 12px;
  border: 1px solid var(--ist-border);
  border-radius: var(--ist-radius);
  font-size: .9rem;
  transition: border-color var(--ist-trans), box-shadow var(--ist-trans);
  width: 100%;
}
.ist-search-input:focus, .ist-select:focus, .ist-input:focus, .ist-textarea:focus {
  border-color: var(--ist-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}
.ist-search-input { flex: 1; min-width: 200px; }
.ist-textarea { resize: vertical; min-height: 80px; }

/* ── Frontend Table ───────────────────────────── */
.ist-frontend-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.ist-frontend-table th {
  background: var(--ist-bg); padding: 10px 12px;
  text-align: left; border-bottom: 2px solid var(--ist-border); font-weight: 600;
}
.ist-frontend-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--ist-border);
}
.ist-fe-row:hover td { background: #f0f4ff; }

/* ── Badges ───────────────────────────────────── */
.ist-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.ist-badge--purple   { background: #ede9fe; color: #5b21b6; }
.ist-badge--blue     { background: #dbeafe; color: #1e40af; }
.ist-badge--orange   { background: #fef3c7; color: #92400e; }
.ist-badge--red      { background: #fee2e2; color: #991b1b; }
.ist-badge--green    { background: #d1fae5; color: #065f46; }

/* ── Kanban ───────────────────────────────────── */
.ist-kanban-wrap { overflow-x: auto; padding-bottom: 16px; }
.ist-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 16px; min-width: 900px;
}
.ist-kanban__col {
  background: var(--ist-bg); border-radius: var(--ist-radius);
  padding: 12px; min-height: 300px;
}
.ist-kanban__col-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px 12px; margin-bottom: 8px;
}
.ist-kanban__col-title { font-weight: 700; font-size: .875rem; }
.ist-kanban__col-count {
  background: #fff; border-radius: 12px; padding: 2px 8px;
  font-size: .75rem; font-weight: 700; color: #555;
}
.ist-kanban__cards { display: flex; flex-direction: column; gap: 8px; min-height: 50px; }
.ist-kanban__card {
  background: #fff; border-radius: var(--ist-radius); padding: 12px;
  box-shadow: var(--ist-shadow); cursor: grab; position: relative;
  transition: box-shadow var(--ist-trans), transform var(--ist-trans);
}
.ist-kanban__card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.15); transform: translateY(-1px); }
.ist-kanban__card.ist-dragging { opacity: .5; cursor: grabbing; }
.ist-kanban__card.ist-drag-over { border: 2px dashed var(--ist-primary); }
.ist-kanban__card--overdue { border-left: 3px solid var(--ist-danger); }
.ist-kanban__card-title { font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
.ist-kanban__card-meta { font-size: .75rem; color: #666; margin-top: 4px; }
.ist-kanban__detail-btn {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: none; cursor: pointer;
  color: #999; font-size: 1rem; padding: 0;
  opacity: 0; transition: opacity var(--ist-trans);
}
.ist-kanban__card:hover .ist-kanban__detail-btn { opacity: 1; }

/* ── Modal ────────────────────────────────────── */
.ist-modal { display: none; position: fixed; inset: 0; z-index: 100000; }
.ist-modal.ist-modal--open { display: flex; align-items: center; justify-content: center; }
.ist-modal__overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.ist-modal__box {
  position: relative; z-index: 1;
  background: #fff; border-radius: 12px;
  width: 92%; max-width: 760px; max-height: 90vh; overflow-y: auto;
  padding: 28px; box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.ist-modal__box--wide { max-width: 900px; }
.ist-modal__close-btn {
  position: absolute; top: 14px; right: 16px;
  background: #f3f4f6; border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background var(--ist-trans);
}
.ist-modal__close-btn:hover { background: #e5e7eb; }

/* ── İş Detay ─────────────────────────────────── */
.ist-detail__header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 16px;
}
.ist-detail__title { margin: 0 0 6px; font-size: 1.3rem; }
.ist-detail__meta  {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: .85rem; color: #555; margin-bottom: 16px;
}
.ist-detail__meta span::before { margin-right: 4px; }
.ist-detail__desc { line-height: 1.7; color: #333; margin-bottom: 20px; }
.ist-detail__section { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.ist-detail__section h4 { margin: 0 0 12px; font-size: .95rem; }

/* ── Alt Görevler ─────────────────────────────── */
.ist-subtasks { list-style: none; margin: 0 0 12px; padding: 0; }
.ist-subtask {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; border-radius: 4px;
}
.ist-subtask:hover { background: var(--ist-bg); }
.ist-subtask input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.ist-subtask__title { flex: 1; font-size: .9rem; }
.ist-subtask__title.done { text-decoration: line-through; color: #999; }
.ist-subtask__del { background: none; border: none; cursor: pointer; color: #ccc; font-size: 1rem; }
.ist-subtask__del:hover { color: var(--ist-danger); }
.ist-subtask-add { display: flex; gap: 8px; }
.ist-subtask-add .ist-input { flex: 1; }

/* ── Dosyalar ─────────────────────────────────── */
.ist-files { list-style: none; margin: 0 0 12px; padding: 0; }
.ist-file {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 1px solid var(--ist-border);
  border-radius: var(--ist-radius); margin-bottom: 6px; background: var(--ist-bg);
}
.ist-file__icon { font-size: 1.3rem; }
.ist-file__name { flex: 1; font-size: .875rem; }
.ist-file__name a { color: var(--ist-primary); text-decoration: none; }
.ist-file__size { font-size: .75rem; color: #888; }
.ist-file__del  { background: none; border: none; cursor: pointer; color: #ccc; }
.ist-file__del:hover { color: var(--ist-danger); }
.ist-file-upload-btn {
  display: inline-block; padding: 8px 16px;
  border: 2px dashed var(--ist-border); border-radius: var(--ist-radius);
  cursor: pointer; font-size: .875rem; color: #555;
  transition: border-color var(--ist-trans);
}
.ist-file-upload-btn:hover { border-color: var(--ist-primary); color: var(--ist-primary); }
.ist-progress-bar { background: #e5e7eb; border-radius: 4px; height: 6px; margin-top: 8px; }
.ist-progress-fill { background: var(--ist-primary); height: 100%; border-radius: 4px; width: 0; transition: width .3s; }

/* ── Notlar ───────────────────────────────────── */
.ist-notes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ist-note {
  background: #fffbeb; border-left: 3px solid #fbbf24;
  border-radius: 0 var(--ist-radius) var(--ist-radius) 0;
  padding: 10px 14px;
}
.ist-note__meta { font-size: .75rem; color: #888; margin-bottom: 4px; }
.ist-note__body { font-size: .9rem; line-height: 1.6; }
.ist-note-add { display: flex; flex-direction: column; gap: 8px; }

/* ── Form ─────────────────────────────────────── */
.ist-form-wrap { max-width: 700px; }
.ist-form__group { margin-bottom: 16px; }
.ist-form__group label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 5px; }
.ist-form__row { display: flex; gap: 16px; }
.ist-form__row .ist-form__group { flex: 1; }
.ist-form__actions { display: flex; gap: 10px; margin-top: 20px; }
.ist-fieldset { border: 1px solid var(--ist-border); border-radius: var(--ist-radius); margin-bottom: 16px; }
.ist-fieldset summary { padding: 10px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.ist-fieldset summary::-webkit-details-marker { display: none; }
.ist-fieldset summary::before { content: '▶ '; font-size: .7em; }
.ist-fieldset[open] summary::before { content: '▼ '; }
.ist-fieldset__body { padding: 12px 14px; }

/* ── İstatistik ───────────────────────────────── */
.ist-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.ist-stats-card {
  background: #fff; border: 1px solid var(--ist-border);
  border-radius: var(--ist-radius); padding: 16px;
  text-align: center; box-shadow: var(--ist-shadow);
}
.ist-stats-card__num { font-size: 2rem; font-weight: 800; line-height: 1; }
.ist-stats-card__lbl { font-size: .8rem; color: #666; margin-top: 4px; }
.ist-charts-row { display: flex; gap: 20px; flex-wrap: wrap; }
.ist-chart-box { flex: 1; min-width: 240px; background: #fff; border-radius: var(--ist-radius); padding: 16px; box-shadow: var(--ist-shadow); }
.ist-chart-box--wide { flex: 2; }
.ist-chart-box h4 { margin: 0 0 12px; font-size: .9rem; }

/* ── Misc ─────────────────────────────────────── */
.ist-notice, .ist-empty { text-align: center; padding: 32px; color: #666; }
.ist-overdue { color: var(--ist-danger); font-weight: 600; }
.ist-overdue-dot { margin-left: 4px; }
.ist-overdue-badge { color: var(--ist-danger); font-weight: 700; font-size: .85rem; margin-left: 8px; }
.ist-msg {
  padding: 10px 14px; border-radius: var(--ist-radius); margin-bottom: 12px; font-size: .9rem;
}
.ist-msg--success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.ist-msg--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

@media (max-width: 640px) {
  .ist-kanban { grid-template-columns: repeat(2, minmax(200px,1fr)); }
  .ist-form__row { flex-direction: column; gap: 0; }
  .ist-modal__box { padding: 18px; }
  .ist-charts-row { flex-direction: column; }
}
