/* Genel */
.nsu-portal { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; color:#222; }
.nsu-portal * { box-sizing: border-box; }

/* Üst sekmeler */
.nsu-tabs {
  display: flex;
  flex-wrap: wrap; /* butonlar alta geçsin */
  gap: .5rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding: .5rem;
  border-bottom: 1px solid #eee;
}
.nsu-tab {
  flex: 1 1 45%; /* mobilde 2 sütun */
  padding:.65rem .5rem;
  border:none;
  background:#f6f7f9;
  border-radius:10px;
  font-weight:600;
  transition: background .25s ease;
}
.nsu-tab.active { background: var(--nsu-primary,#1976d2); color:#fff; }
@media (min-width: 600px) {
  .nsu-tab { flex:1; } /* tablet ve üstünde eşit genişlik */
}

/* Araç çubuğu */
.nsu-toolbar { display:flex; justify-content:flex-end; padding:.5rem; }
.nsu-primary { background: var(--nsu-primary,#1976d2); color:#fff; border:none; padding:.6rem 1rem; border-radius:10px; font-weight:600; }
.nsu-danger { background: var(--nsu-danger,#e53935); color:#fff; border:none; padding:.6rem 1rem; border-radius:10px; font-weight:600; }

/* Liste ve kartlar */
.nsu-list { padding:.75rem; display:grid; gap:.85rem; }
.nsu-card { background:#fff; border-radius:16px; box-shadow: 0 10px 25px rgba(0,0,0,.06); overflow:hidden; border:1px solid #f1f2f4; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.nsu-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.08); border-color:#e9ebef; }
.nsu-card-bar { height: 4px; background: linear-gradient(90deg, var(--nsu-primary,#1976d2), rgba(25,118,210,.2)); }
.nsu-card-body { padding: .9rem .95rem; display:flex; flex-direction:column; gap:.55rem; }
.nsu-card-head { display:flex; align-items:center; gap:.5rem; justify-content:space-between; }
.nsu-card-title { font-weight:700; line-height:1.2; font-size:1.02rem; }
.nsu-chip { display:inline-block; padding:.2rem .6rem; border-radius:999px; font-size:.75rem; background:#eef2ff; color:#3949ab; white-space:nowrap; }
.nsu-card-meta { display:grid;grid-template-columns:1fr;row-gap:.35rem; color:#333; font-size:.92rem; }
.nsu-rowline strong { color:#555; }

/* Detay sayfası */
.nsu-detail { position: fixed; inset:0; background:#fff; display:flex; flex-direction:column; z-index: 40; }
.nsu-detail.hidden { display:none; }
.nsu-detail-header { display:flex; align-items:center; gap:.6rem; padding:.75rem; border-bottom:1px solid #eee; }
.nsu-back { background:transparent; border:none; font-size:1.1rem; }
.nsu-detail-body { padding: .75rem; overflow:auto; display:flex; flex-direction:column; gap:.75rem; }
.nsu-content { line-height:1.5; }
.nsu-files a { display:inline-block; margin-right:.5rem; font-size:.9rem; }
.nsu-replies { display:flex; flex-direction:column; gap:.6rem; }
.nsu-reply { background:#f7f7f8; border-radius:10px; padding:.6rem .75rem; }
.nsu-reply.admin { background:#e8f0ff; }
.nsu-detail-footer { border-top:1px solid #eee; padding:.75rem; display:flex; flex-direction:column; gap:.5rem; }
.nsu-detail-footer textarea { width:100%; border:1px solid #ddd; border-radius:10px; padding:.6rem; }

/* Bilgi tablosu (detay meta) */
.nsu-info-table { display:grid; grid-template-columns: 1fr 1fr; gap:.5rem; background:#fafbfc; border:1px solid #eee; border-radius:12px; padding:.6rem; }
.nsu-info-table > div { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.35rem .5rem; background:#fff; border:1px solid #f0f0f0; border-radius:10px; }
.nsu-info-table > div span { color:#666; font-size:.85rem; }
.nsu-info-table > div strong { font-weight:700; }

/* İlk Talep kartı */
.nsu-initial-card {
  position: relative;
  background: #fff;
  border: 1px solid #e9ebef;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  padding: .85rem .95rem;
}
.nsu-initial-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.45rem; }
.nsu-initial-badge { display:inline-block; padding:.2rem .55rem; border-radius:999px; font-weight:700; font-size:.75rem; background: var(--nsu-primary,#1976d2); color:#fff; }
.nsu-initial-date { color:#666; font-size:.85rem; }
.nsu-initial-body { line-height:1.55; }
.nsu-initial-files { margin-top:.4rem; }
.nsu-initial-files a { display:inline-block; margin-right:.5rem; font-size:.9rem; }

/* Modal (yeni talep) */
.nsu-modal { position: fixed; inset:0; background: rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; padding:0; z-index: 1000; }
.nsu-modal.hidden { display:none !important; }
.nsu-modal-content { width:100%; height:100%; max-width:680px; max-height:100%; background:#fff; border-radius:16px 16px 0 0; margin-top:auto; display:flex; flex-direction:column; }
.nsu-modal-header { padding:1rem; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #eee; }
.nsu-form { padding:1rem; display:flex; flex-direction:column; gap:.8rem; overflow:auto; }
.nsu-form label { display:flex; flex-direction:column; gap:.35rem; font-weight:600; }
.nsu-form input[type="text"], .nsu-form select, .nsu-form textarea, .nsu-form input[type="file"] { padding:.6rem; border:1px solid #ddd; border-radius:10px; width:100%; }
.nsu-form-actions { display:flex; gap:.6rem; justify-content:flex-end; }
@media (min-width: 700px) {
  .nsu-modal-content { border-radius:16px; height:auto; margin:auto; }
}

/* App tarzı confirm modal */
.nsu-confirm { position: fixed; inset:0; background: rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; z-index: 1100; }
.nsu-confirm.hidden { display:none !important; }
.nsu-confirm-card { width:90%; max-width:420px; background:#fff; border-radius:16px; padding:1rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.nsu-confirm-card h3 { margin:.2rem 0 .4rem; }
.nsu-confirm-card p { color:#555; margin:0 0 .8rem; }
.nsu-confirm-actions { display:flex; justify-content:flex-end; gap:.5rem; }
.nsu-confirm-actions button { padding:.55rem .9rem; border:none; border-radius:10px; }
.nsu-confirm-actions #nsu-confirm-cancel { background:#f1f3f5; }

/* Toast */
.nsu-toast { position: fixed; left:50%; transform: translateX(-50%); bottom: 16px; background:#222; color:#fff; padding:.6rem .9rem; border-radius:12px; z-index:1200; box-shadow:0 10px 20px rgba(0,0,0,.2); }
.nsu-toast.hidden { display:none !important; }

/* Öncelik chip (detay) – JS ile atanır */
.nsu-pri-chip { display:inline-block; padding:.15rem .5rem; border-radius:999px; font-size:.8rem; background:#eee; }

/* Temel değişkenler */
#nsu-portal { --nsu-primary: var(--nsu-primary, #1976d2); --nsu-danger: var(--nsu-danger, #e53935); }
/* Mobilde info satırlarının tek satır kalması için iyileştirme */
@media (max-width: 480px) {
  .nsu-info-table > div {
    /* flex yerine grid: label ve değer iki kolon */
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: .5rem;
  }
  .nsu-info-table > div span {
    white-space: nowrap;        /* "Oluşturma" gibi label kırılmasın */
  }
  .nsu-info-table > div strong {
    justify-self: end;          /* sağa yasla */
    white-space: nowrap;        /* tarih TEK satır */
    overflow: hidden; 
    text-overflow: ellipsis;    /* aşırı dar ekranda üç nokta */
    max-width: 60vw;            /* güvenli bir üst sınır */
  }
}
/* Ortak balon */
.nsu-reply {
  position: relative; /* kuyruğu absolute konumlandırmak için */
  border-radius: 10px;
  padding: .6rem .75rem;
  max-width: 85%;
}

/* Kullanıcı cevabı (gri, sağda) */
.nsu-reply {
  background: #f7f7f8;
  margin-left: auto;   /* sağa yasla */
}
.nsu-reply::before {
  content: "";
  position: absolute;
  top: 0.6rem;              /* kuyruğun dikey konumu */
  right: -10px;             /* sağa çıkar */
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-left-color: #f7f7f8; /* gri balon rengi */
  border-right: 0;
  border-top: 0;
}

/* Admin cevabı (mavi, solda) */
.nsu-reply.admin {
  background: #e8f0ff;
  margin-right: auto;  /* sola yasla */
}
.nsu-reply.admin::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  left: -10px;              /* sola çıkar */
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-right-color: #e8f0ff; /* mavi balon rengi */
  border-left: 0;
  border-top: 0;
}
/* Kullanıcı (gri) sağa yaslı */
.nsu-reply {
  margin-left: auto;
  margin-right: 0;   /* özellikle sıfırla */
}

/* Admin (mavi) sola yaslı */
.nsu-reply.admin {
  margin-right: auto;
  margin-left: 0;    /* soldaki boşluğu kaldırır */
}

/* Kuyruğun dışarı taşarken bıraktığı görsel boşluğu azaltmak istersen: */
.nsu-reply.admin::before { left: -8px; }  /* önce -10px idi */
.nsu-reply::before        { right: -8px; } /* önce -10px idi */

/* Ticket detay üst bar */
.nsu-detail-header {
  padding: .5rem .75rem;        /* daha dar padding */
  gap: .4rem;                   /* elemanlar arası boşluk azalt */
}

/* Başlık küçük puntolu, en fazla 2 satır */
#nsu-detail-subject {
  font-size: 0.95rem;           /* daha küçük yazı */
  line-height: 1.3;
  font-weight: 600;
  max-width: 65%;               /* sağdaki chip ile çakışmasın */
  display: -webkit-box;
  -webkit-line-clamp: 2;        /* en fazla 2 satır */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
