/* ============================================================
   Client Portal — Frontend Dashboard CSS  (v5.1)
   Minimal, kart tabanlı, responsive tasarım
   ============================================================ */

/* ─── Temel Reset ─────────────────────────────── */
.cp-wrap * { box-sizing: border-box; }

/* ─── Layout ──────────────────────────────────── */
.cp-wrap {
  display: flex;
  gap: 24px;
  max-width: 1100px;
  margin: 32px auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #1a1a2e;
}

/* ─── Sidebar ─────────────────────────────────── */
.cp-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  padding: 24px 16px;
  align-self: flex-start;
  position: sticky;
  top: 32px;
}

.cp-sidebar__avatar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.cp-avatar { border-radius: 50%; }

.cp-sidebar__info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.cp-sidebar__info span {
  font-size: 12px;
  color: #888;
  word-break: break-all;
}

/* ─── Sidebar Çıkış ───────────────────────────── */
.cp-sidebar__logout {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.cp-btn--logout {
  width: 100%;
  justify-content: center;
  color: #555;
  font-size: 13px;
}

.cp-btn--logout:hover {
  background: #fee2e2;
  color: #b91c1c;
  opacity: 1;
}

/* ─── Nav ─────────────────────────────────────── */
.cp-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-nav__item {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: #555;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.cp-nav__item:hover {
  background: #f5f5f5;
  color: #111;
}

.cp-nav__item--active {
  background: #16243d;
  color: #fff !important;
}

/* ─── Main ────────────────────────────────────── */
.cp-main { flex: 1; min-width: 0; }

/* ─── Page Header ─────────────────────────────── */
.cp-page-header { margin-bottom: 24px; }

.cp-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin: 0 0 4px;
}

.cp-page-sub { margin: 0; color: #777; font-size: 14px; }

/* ─── Stats Grid ──────────────────────────────── */
.cp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cp-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px !important;
}

.cp-stat-icon { font-size: 28px; }

.cp-stat-number {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: #16243d;
  line-height: 1;
}

.cp-stat-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ─── Cards ───────────────────────────────────── */
.cp-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  padding: 24px;
  margin-bottom: 20px;
}

.cp-card__head {
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.cp-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* ─── Cards Grid (hizmetler) ──────────────────── */
.cp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.cp-service-card { padding: 20px !important; }

.cp-service-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.cp-service-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.cp-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.cp-service-desc {
  font-size: 13px;
  color: #666;
  margin: 0 0 10px;
  line-height: 1.5;
}

.cp-service-meta { font-size: 12px; color: #aaa; }

.cp-service-files { margin-top: 12px; font-size: 13px; }
.cp-service-files ul { list-style: none; padding: 0; margin: 6px 0 0; }
.cp-service-files li { margin-bottom: 4px; }

.cp-file-link {
  color: #16243d;
  text-decoration: none;
  font-size: 13px;
}
.cp-file-link:hover { text-decoration: underline; }

/* ─── Table ───────────────────────────────────── */
.cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cp-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #f0f0f0;
}

.cp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f8f8f8;
  vertical-align: middle;
}

.cp-table tbody tr:hover { background: #fafafa; }

/* ─── Badges ──────────────────────────────────── */
.cp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.cp-badge--pending    { background: #dbeafe; color: #1e40af; }
.cp-badge--progress   { background: #cfe2ff; color: #0a58ca; }
.cp-badge--done       { background: #d1e7dd; color: #146c43; }
.cp-badge--unpaid     { background: #f8d7da; color: #842029; }
.cp-badge--paid       { background: #d1e7dd; color: #146c43; }
.cp-badge--refunded   { background: #e2d9f3; color: #432874; }
.cp-badge--admin      { background: #e2e8f0; color: #334155; }
.cp-badge--client     { background: #dbeafe; color: #1e40af; }

/* ─── Category Badges ─────────────────────────── */
.cp-badge--cat           { background: #e8ecf0; color: #3d4e60; }
.cp-badge--cat-sozlesme  { background: #dbeafe; color: #1e40af; }
.cp-badge--cat-fatura    { background: #dcfce7; color: #166534; }
.cp-badge--cat-rapor     { background: #dbeafe; color: #1e40af; }
.cp-badge--cat-teklif    { background: #f3e8ff; color: #6b21a8; }
.cp-badge--cat-diger     { background: #f1f5f9; color: #475569; }

/* ─── Buttons ─────────────────────────────────── */
.cp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s, background .15s;
  background: #f0f0f0;
  color: #333;
}

.cp-btn:hover { opacity: .85; }

.cp-btn--primary { background: #16243d; color: #fff; }
.cp-btn--danger  { background: #fee2e2; color: #b91c1c; }
.cp-btn--sm      { padding: 5px 10px; font-size: 12px; }

/* ─── Upload Form ─────────────────────────────── */
.cp-upload-form { display: flex; flex-direction: column; gap: 14px; }

.cp-form-row { display: flex; flex-direction: column; gap: 5px; }

.cp-form-row label { font-size: 13px; font-weight: 500; color: #555; }

.cp-form-row input[type="text"],
.cp-form-row input[type="file"],
.cp-form-row input[type="email"],
.cp-form-row input[type="password"],
.cp-form-row textarea {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  background: #fff;
  color: #1a1a2e;
}

.cp-form-row input:focus,
.cp-form-row textarea:focus {
  border-color: #16243d;
}

/* ─── Category select ─────────────────────────── */
.cp-select {
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
  background: #fff;
  color: #333;
  outline: none;
}
.cp-select:focus { border-color: #16243d; }

/* ─── Notices ─────────────────────────────────── */
.cp-notice {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  background: #d1e7dd;
  color: #146c43;
}

.cp-notice--error { background: #f8d7da; color: #842029; }

.cp-empty { text-align: center; color: #aaa; padding: 24px 0; margin: 0; }

/* ─── File icon ───────────────────────────────── */
.cp-file-icon { margin-right: 4px; }

/* ═══════════════════════════════════════════════
   NOTLARIM — Kullanıcı Öz-Not Sistemi
═══════════════════════════════════════════════ */

.cp-notes-list {
  display: flex;
  flex-direction: column;
}

.cp-note-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f1;
}

.cp-note-item:last-child { border-bottom: none; }

.cp-note-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.cp-note-item__date {
  font-size: 11px;
  color: #9ca3af;
}

.cp-note-edited {
  font-size: 10px;
  color: #c4c9d4;
  margin-left: 6px;
  font-style: italic;
}

.cp-note-item__body {
  font-size: 13px;
  color: #374151;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.cp-note-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cp-notes-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
}

.cp-notes-empty__icon {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

.cp-notes-empty p {
  font-size: 13px;
  margin: 0;
}

/* ═══════════════════════════════════════════════
   PROFİLİM
═══════════════════════════════════════════════ */

.cp-profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

/* Şifre alanı wrapper */
.cp-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cp-pass-wrap input {
  flex: 1;
  padding-right: 40px !important;
}

.cp-pass-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  color: #9ca3af;
  transition: color .15s;
}

.cp-pass-toggle:hover { color: #16243d; }

.cp-pass-strength {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.cp-pass-hint {
  font-size: 11px;
  color: #9ca3af;
  margin: 0;
  font-style: italic;
}

/* Profil meta kutusu — kart tasarımıyla uyumlu */
.cp-profile-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  font-size: 12px;
  color: #6b7280;
}

.cp-profile-meta strong {
  color: #374151;
  font-weight: 600;
}

.cp-profile-actions {
  margin-top: 4px;
  padding-bottom: 8px;
}

.cp-profile-actions .cp-btn {
  min-width: 200px;
  justify-content: center;
}

/* ═══════════════════════════════════════════════
   İLETİŞİM SAYFASI
═══════════════════════════════════════════════ */

.cp-contact-wrap {
  max-width: 700px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cp-contact-info { margin-bottom: 20px; }

.cp-contact-text {
  font-size: 14px;
  color: #555;
  margin: 0 0 12px;
}

.cp-contact-email { margin: 0; }

.cp-contact-mailto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #16243d;
  text-decoration: none;
  padding: 10px 18px;
  border: 2px solid #16243d;
  border-radius: 8px;
  transition: background .15s, color .15s;
}

.cp-contact-mailto:hover {
  background: #16243d;
  color: #fff;
}

.cp-contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-required {
  color: #ef4444;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .cp-wrap {
    flex-direction: column;
    margin: 16px;
    gap: 16px;
  }

  .cp-sidebar {
    width: 100%;
    position: static;
  }

  .cp-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .cp-nav__item {
    flex: 1 0 auto;
    text-align: center;
    font-size: 12px;
    padding: 8px 10px;
  }

  .cp-cards-grid {
    grid-template-columns: 1fr;
  }

  .cp-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cp-profile-meta {
    flex-direction: column;
    gap: 8px;
  }

  .cp-profile-actions .cp-btn {
    min-width: 100%;
  }

  .cp-table {
    font-size: 12px;
  }

  .cp-table th,
  .cp-table td {
    padding: 8px;
  }

  .cp-note-item__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .cp-contact-wrap {
    padding: 0 4px;
  }
}

/* ═══════════════════════════════════════════════
   DESTEK SAYFASI
═══════════════════════════════════════════════ */

.cp-support-form {
    padding: 8px 0 4px;
}

/* WPForms entegrasyonu — panel tasarimiyla uyumlu */
.cp-support-form .wpforms-container {
    max-width: 100%;
}

.cp-support-form .wpforms-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.cp-support-form .wpforms-field input[type="text"],
.cp-support-form .wpforms-field input[type="email"],
.cp-support-form .wpforms-field textarea,
.cp-support-form .wpforms-field select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
}

.cp-support-form .wpforms-field input:focus,
.cp-support-form .wpforms-field textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.cp-support-form .wpforms-submit-container .wpforms-submit {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.cp-support-form .wpforms-submit-container .wpforms-submit:hover {
    background: #4f46e5;
}
