/* ========================
   SinapStudy — Kurum Paneli CSS
   institution.css
   sinaps/styles/institution.css olarak ekleyin
   ======================== */

/* ─── GENEL LAYOUT ─────────────────────────────────── */
.inst-overview {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.inst-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .inst-two-col { grid-template-columns: 1fr; }
  .inst-overview { padding: 16px; gap: 16px; }
}

/* ─── KART ──────────────────────────────────────────── */
.inst-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inst-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.inst-card-header svg {
  width: 18px; height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── STAT KARTLAR ──────────────────────────────────── */
.inst-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.inst-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.inst-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.inst-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inst-stat-icon svg { width: 22px; height: 22px; }

.inst-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.1;
}
.inst-stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 500;
}

/* ─── TABLO ─────────────────────────────────────────── */
.inst-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
.inst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.inst-table thead th {
  background: var(--bg-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.inst-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.inst-table tbody tr:last-child td { border-bottom: none; }
.inst-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── BADGE ─────────────────────────────────────────── */
.inst-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: rgba(52,211,153,0.15); color: var(--success); border: 1px solid rgba(52,211,153,0.25); }
.badge-danger  { background: rgba(248,113,113,0.15); color: var(--danger);  border: 1px solid rgba(248,113,113,0.25); }
.badge-warning { background: rgba(251,191,36,0.15);  color: var(--warning); border: 1px solid rgba(251,191,36,0.25); }
.badge-muted   { background: rgba(136,145,170,0.12); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── USER CELL ─────────────────────────────────────── */
.inst-user-cell {
  display: flex; align-items: center; gap: 10px;
}
.inst-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
  flex-shrink: 0;
}
.inst-user-name { font-weight: 600; font-size: 0.875rem; }
.inst-user-sub  { font-size: 0.75rem; color: var(--text-muted); }

/* ─── PROGRESS BAR ──────────────────────────────────── */
.inst-progress-bar {
  height: 6px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
  max-width: 120px;
}
.inst-progress-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.6s ease;
}
.inst-progress-fill.success { background: var(--success); }
.inst-progress-fill.warning { background: var(--warning); }
.inst-progress-fill.danger  { background: var(--danger); }

/* ─── MİNİ BAR (Şube) ───────────────────────────────── */
.inst-mini-bar {
  height: 8px; background: var(--bg-2);
  border-radius: 99px; overflow: hidden;
  min-width: 80px;
}
.inst-mini-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
}

/* ─── SPARK ─────────────────────────────────────────── */
.inst-spark {
  display: inline-flex;
  align-items: center;
}

/* ─── WEAK LIST (En zayıf branşlar) ─────────────────── */
.inst-weak-list {
  display: flex; flex-direction: column; gap: 12px;
}
.inst-weak-item {
  display: flex; align-items: center; gap: 12px;
}
.inst-weak-rank {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(248,113,113,0.15);
  color: var(--danger); font-weight: 800; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inst-weak-info { flex: 1; }
.inst-weak-name { font-size: 0.875rem; font-weight: 600; margin-bottom: 5px; }
.inst-progress-fill.danger { background: var(--danger); }
.inst-weak-net {
  font-size: 0.875rem; font-weight: 700;
  color: var(--danger); min-width: 36px; text-align: right;
}

/* ─── FİLTRE ROW ────────────────────────────────────── */
.inst-filter-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ─── UYARI BANNER ──────────────────────────────────── */
.inst-alert-banner {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--danger);
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 10px;
}
.inst-alert-banner svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── RİSK ROW ──────────────────────────────────────── */
.inst-risk-row td { background: rgba(248,113,113,0.02); }

/* ─── MÜFREDAт GRID ─────────────────────────────────── */
.curr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.curr-week-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.curr-week-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  border-color: var(--border-accent);
}
.curr-week-card:active { cursor: grabbing; }

.curr-week-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px;
}
.curr-week-badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.75rem; font-weight: 700;
}
.curr-week-actions { display: flex; gap: 4px; }

.curr-topics { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.curr-topic-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.8rem; color: var(--text-primary);
}
.curr-subject-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}

.curr-week-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px; margin-top: 4px;
}
.curr-week-date { font-size: 0.75rem; color: var(--text-muted); }

.curr-topic-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}

/* ─── MODAL ─────────────────────────────────────────── */
.inst-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.inst-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.inst-modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.inst-modal-header h3 {
  font-size: 1.05rem; font-weight: 700;
  font-family: var(--font-display);
}
.inst-modal-body {
  padding: 20px 24px;
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 14px;
}
.inst-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── DENEME GİRİŞ ALANI ────────────────────────────── */
.exam-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.exam-subject-input {
  display: flex; flex-direction: column; gap: 6px;
}
.exam-subject-label {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.exam-subject-row {
  display: flex; align-items: center; gap: 8px;
}
.exam-net-preview {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 52px; text-align: center;
}

.exam-total-box {
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
}
.exam-total-label {
  font-size: 0.875rem; color: var(--text-secondary);
}
.exam-total-value {
  font-size: 2rem; font-weight: 800;
  font-family: var(--font-display);
  color: var(--accent);
}

/* ─── KURUM PROFİL AYARLARI ─────────────────────────── */
.inst-profile-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .inst-profile-grid { grid-template-columns: 1fr; }
}

.inst-logo-upload {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 24px;
  background: var(--bg-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s;
}
.inst-logo-upload:hover { border-color: var(--accent); }
.inst-logo-preview {
  width: 100px; height: 100px;
  border-radius: 16px;
  object-fit: contain;
  background: var(--bg-1);
  border: 1px solid var(--border);
}
.inst-logo-placeholder {
  width: 100px; height: 100px;
  border-radius: 16px;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.inst-logo-placeholder svg { width: 40px; height: 40px; }
.inst-logo-hint {
  font-size: 0.8rem; color: var(--text-muted);
  text-align: center;
}

/* ─── SIDEBAR KURUM NAVLARI ─────────────────────────── */
.inst-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  margin: 8px 12px 4px;
}
.inst-sidebar-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-2);
  flex-shrink: 0;
}
.inst-sidebar-name {
  font-weight: 700; font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inst-sidebar-role {
  font-size: 0.7rem; color: var(--accent);
}

/* ─── EXAM ENTRY TAB ────────────────────────────────── */
.exam-tab-bar {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}
.exam-tab {
  padding: 9px 16px;
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-bottom: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.exam-tab.active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  margin-bottom: -1px;
}
.exam-tab:hover:not(.active) { color: var(--text-primary); }

/* ─── SINIF KART GRİD ───────────────────────────────── */
.inst-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding-top: 8px;
}

.inst-class-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.inst-class-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  border-color: var(--accent);
}

.inst-class-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inst-class-card-avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.inst-class-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-class-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--text-secondary);
}
.inst-class-card-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inst-class-card-stat svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.inst-class-card-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ─── BADGE BLUE ────────────────────────────────────── */
.badge-blue { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.25); }

/* ─── PAGE CONTENT PADDING ──────────────────────────── */
.page-content { flex: 1; overflow-y: auto; }

/* ─── RESPONSIVE TWEAKS ─────────────────────────────── */
@media (max-width: 600px) {
  .inst-stat-grid { grid-template-columns: 1fr 1fr; }
  .inst-stat-value { font-size: 1.3rem; }
  .exam-entry-grid { grid-template-columns: 1fr 1fr; }
  .curr-grid { grid-template-columns: 1fr 1fr; }
  .inst-class-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .inst-stat-grid { grid-template-columns: 1fr; }
  .exam-entry-grid { grid-template-columns: 1fr; }
  .curr-grid { grid-template-columns: 1fr; }
}