/* =============================================
   PUMA Mikrokredi - Ana CSS
   ============================================= */

:root {
  --primary:        #2563EB;
  --primary-light:  #EFF6FF;
  --primary-dark:   #1D4ED8;
  --secondary:      #64748B;
  --success:        #059669;
  --success-light:  #ECFDF5;
  --warning:        #D97706;
  --warning-light:  #FFFBEB;
  --danger:         #DC2626;
  --danger-light:   #FEF2F2;
  --info:           #0891B2;
  --info-light:     #ECFEFF;
  --teal:           #0D9488;
  --teal-light:     #F0FDFA;
  --orange:         #EA580C;
  --orange-light:   #FFF7ED;

  --bg:             #F8FAFC;
  --bg-card:        #FFFFFF;
  --border:         #E2E8F0;
  --border-light:   #F1F5F9;
  --text:           #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-sm:      6px;
  --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --transition:     0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p  { color: var(--text-secondary); }
a  { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
small { font-size: 0.8rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline  { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #047857; color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-full     { width: 100%; justify-content: center; }
.btn-lg       { padding: 12px 24px; font-size: 1rem; }
.btn-sm       { padding: 6px 14px; font-size: 0.8rem; }
.btn-xs       { padding: 4px 10px; font-size: 0.75rem; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-success   { background: var(--success-light); color: var(--success); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-danger    { background: var(--danger-light); color: var(--danger); }
.badge-info      { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--border-light); color: var(--secondary); }
.badge-dark      { background: #1E293B; color: #fff; }

/* ---- Alerts ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-light); color: #991B1B; border-color: #FECACA; }
.alert-success { background: var(--success-light); color: #065F46; border-color: #A7F3D0; }
.alert-warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert-info    { background: var(--info-light); color: #164E63; border-color: #A5F3FC; }
.alert-dismissible { position: relative; padding-right: 40px; }
.alert-close {
  position: absolute; right: 12px; top: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1; color: inherit; opacity: 0.6;
}
.alert-close:hover { opacity: 1; }
.error-list { list-style: disc; padding-left: 20px; margin-top: 6px; }
.error-list li { margin-bottom: 2px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-wrapper { position: relative; }
.input-wrapper .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-wrapper .form-input { padding-left: 40px; }
.input-wrapper .toggle-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; }
.input-wrapper .toggle-password:hover { color: var(--text); }

/* ---- Checkbox ---- */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.form-check-group { margin-bottom: 18px; }
.form-row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { background: var(--bg); padding: 12px 16px; text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }
.proje-kodu { font-size: 0.75rem; background: var(--border-light); padding: 2px 6px; border-radius: 4px; font-family: monospace; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 0.875rem; color: var(--text-secondary); transition: all var(--transition); }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Modal ---- */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.active { display: flex; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(2px); }
.modal-box { position: relative; background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); z-index: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 16px; color: var(--border); }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ---- Utility ---- */
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.ml-1 { margin-left: 6px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .modal-box { max-width: 100%; margin: 0; border-radius: var(--radius) var(--radius) 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 95vh; }
  .modal { align-items: flex-end; padding: 0; }
}
