/* ABIS Admin — Admina template bridge for existing views */

/* Neutralize classic Admina sidebar margins when twin-sidebar is active */
body:has(.twin-sidebar) .dashboard-main {
  margin-inline-start: calc(var(--ts-rail-w, 72px) + var(--ts-panel-w, 248px)) !important;
  margin-left: calc(var(--ts-rail-w, 72px) + var(--ts-panel-w, 248px)) !important;
  width: auto !important;
  max-width: 100% !important;
  overflow-x: clip;
  flex-wrap: nowrap !important;
  transition: margin-left 0.25s ease, margin-inline-start 0.25s ease;
}
body:has(.twin-sidebar).twin-collapsed .dashboard-main {
  margin-inline-start: var(--ts-rail-w, 72px) !important;
  margin-left: var(--ts-rail-w, 72px) !important;
}
@media (max-width: 1199px) {
  body:has(.twin-sidebar) .dashboard-main,
  body:has(.twin-sidebar).twin-collapsed .dashboard-main {
    margin-inline-start: 0 !important;
    margin-left: 0 !important;
  }
}

/* Menü açıkken yatay kayma / scrollbar zıplaması */
html:has(.twin-sidebar) {
  scrollbar-gutter: stable;
  overflow-x: hidden;
}
body:has(.twin-sidebar) {
  overflow-x: hidden;
}
body:has(.twin-sidebar) .twin-sidebar {
  overflow-x: hidden;
}
body:has(.twin-sidebar) .rail-icon .rail-tip {
  pointer-events: none;
}

/* Akademisyen paneli: ikon raysız, grup başlıklı tek seviye menü */
body:has(.twin-sidebar.panel-flat-nav) .dashboard-main {
  margin-inline-start: var(--ts-panel-w, 248px) !important;
  margin-left: var(--ts-panel-w, 248px) !important;
}
body:has(.twin-sidebar.panel-flat-nav).twin-collapsed .dashboard-main {
  margin-inline-start: 0 !important;
  margin-left: 0 !important;
}
@media (max-width: 1199px) {
  body:has(.twin-sidebar.panel-flat-nav) .dashboard-main,
  body:has(.twin-sidebar.panel-flat-nav).twin-collapsed .dashboard-main {
    margin-inline-start: 0 !important;
    margin-left: 0 !important;
  }
  /* Sabit mobil menü düğmesi logonun üstüne binmesin */
  .twin-sidebar.panel-flat-nav .twin-panel__head {
    padding-inline-start: 72px;
  }
}
.twin-sidebar.panel-flat-nav {
  border-right: 1px solid var(--ts-border);
}
.twin-sidebar.panel-flat-nav.is-collapsed {
  border-right: 0;
}
.twin-sidebar.panel-flat-nav .twin-menu {
  display: block;
  animation: none;
}
.twin-sidebar.panel-flat-nav .twin-panel__body {
  min-height: 0;
}
.panel-nav-group {
  margin: 16px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa2b1;
}
.twin-panel__body > .panel-nav-group:first-child {
  margin-top: 4px;
}
.dark .panel-nav-group {
  color: #8b93a3;
}

.admin-alert {
  border-radius: 0.75rem;
  border: 1px solid rgb(191 219 254);
  background: rgb(239 246 255);
  color: rgb(30 64 175);
  padding: 0.85rem 1rem;
  font-size: 0.925rem;
}

.dark .admin-alert {
  border-color: rgb(30 64 175 / 0.45);
  background: rgb(30 64 175 / 0.2);
  color: rgb(191 219 254);
}

/* Panel — sağ üst toast */
.abis-toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.abis-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 14px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.abis-toast.is-on {
  opacity: 1;
  transform: translateX(0);
}
.abis-toast.is-out {
  opacity: 0;
  transform: translateX(16px);
}
.abis-toast.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.abis-toast.is-error {
  border-color: #fecaca;
  background: #fef2f2;
}
.abis-toast__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.abis-toast.is-success .abis-toast__icon {
  background: #dcfce7;
  color: #15803d;
}
.abis-toast.is-error .abis-toast__icon {
  background: #fee2e2;
  color: #b80610;
}
.abis-toast__text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}
.abis-toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.abis-toast__close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}
.dark .abis-toast {
  background: #1e293b;
  border-color: #334155;
}
.dark .abis-toast.is-success {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(74, 222, 128, 0.35);
}
.dark .abis-toast.is-error {
  background: rgba(184, 6, 16, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
}
.dark .abis-toast__text {
  color: #f8fafc;
}
.dark .abis-toast__close {
  color: #94a3b8;
}

.admin-card {
  border-radius: 1rem;
  border: 1px solid rgb(229 231 235);
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.dark .admin-card {
  border-color: rgb(82 82 91);
  background: rgb(64 64 64);
}

.admin-page-title {
  color: rgb(23 23 23);
  font-weight: 600;
}

.dark .admin-page-title {
  color: #fff;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-stat {
  border-radius: 1rem;
  border: 1px solid rgb(229 231 235);
  background: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dark .admin-stat {
  border-color: rgb(82 82 91);
  background: rgb(64 64 64);
}

.admin-stat-label {
  font-size: 0.8rem;
  color: rgb(115 115 115);
}

.dark .admin-stat-label {
  color: rgb(163 163 163);
}

.admin-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgb(23 23 23);
  line-height: 1.1;
}

.dark .admin-stat-value {
  color: #fff;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgb(229 231 235);
  text-align: left;
  vertical-align: middle;
}

.dark .admin-table th,
.dark .admin-table td {
  border-bottom-color: rgb(82 82 91);
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(115 115 115);
  font-weight: 600;
}

.dark .admin-table th {
  color: rgb(163 163 163);
}

.admin-table tbody tr:hover {
  background: rgb(250 250 250);
}

.dark .admin-table tbody tr:hover {
  background: rgb(82 82 91 / 0.35);
}

.admin-btn,
.admin-btn-ghost,
button.admin-btn,
a.admin-btn,
a.admin-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 9999px;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
}

.admin-btn {
  background: rgb(37 99 235);
  color: #fff;
}

.admin-btn:hover {
  background: rgb(29 78 216);
  color: #fff;
}

.admin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-btn-ghost {
  background: #fff;
  border-color: rgb(229 231 235);
  color: rgb(64 64 64);
}

.admin-btn-ghost:hover {
  border-color: rgb(37 99 235);
  color: rgb(37 99 235);
}

.admin-btn-danger,
button.admin-btn-danger,
a.admin-btn-danger {
  background: #b42318;
  color: #fff;
  border-color: #b42318;
}

.admin-btn-danger:hover {
  background: #912018;
  color: #fff;
}

.admin-btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.dark .admin-btn-ghost {
  background: rgb(64 64 64);
  border-color: rgb(82 82 91);
  color: #fff;
}

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(64 64 64);
}

.dark .form-label {
  color: rgb(229 229 229);
}

.form-control {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(229 231 235);
  background: #fff;
  color: rgb(23 23 23);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: rgb(37 99 235);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

.dark .form-control {
  border-color: rgb(82 82 91);
  background: rgb(82 82 91);
  color: #fff;
}

.text-muted {
  color: rgb(115 115 115) !important;
}

.dark .text-muted {
  color: rgb(163 163 163) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1.25rem !important; }
.me-2 { margin-inline-end: 0.5rem !important; }
.pb-3 { padding-bottom: 0.75rem !important; }
.m-0 { margin: 0 !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.small { font-size: 0.875rem; }
.fw-semibold { font-weight: 600; }
.text-uppercase { text-transform: uppercase; }
.border-bottom { border-bottom: 1px solid rgb(229 231 235); }
.list-unstyled { list-style: none; padding-left: 0; margin: 0; }
.h4 { font-size: 1.35rem; font-weight: 700; margin: 0 0 0.35rem; }
.h5 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.75rem; }
.h6 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; }

/* Panel content cards (legacy class kept for existing views) */
.panel-card {
  border-radius: 1rem;
  border: 1px solid rgb(229 231 235);
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  color: rgb(23 23 23);
}
.dark .panel-card {
  border-color: rgb(82 82 91);
  background: rgb(64 64 64);
  color: #fff;
}
.panel-card .badge.bg-info,
.panel-card .badge.bg-warning,
.panel-card .badge.bg-light { color: #1a2332 !important; }

/* Lightweight Bootstrap-like helpers for Panel forms/tables */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.4rem;
}
.row > [class*="col-"] {
  padding: 0 0.4rem;
  width: 100%;
}
.g-2 { row-gap: 0.5rem; }
@media (min-width: 768px) {
  .col-md-2 { width: 16.666%; }
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.333%; }
  .col-md-6 { width: 50%; }
  .col-md-12 { width: 100%; }
}

.btn,
.btn-primary,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
  background: rgb(37 99 235);
  color: #fff;
}
.btn:hover,
.btn-primary:hover { background: rgb(29 78 216); color: #fff; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn.rounded-lg,
.btn-primary.rounded-lg { border-radius: 0.5rem; }
.btn-outline-primary,
.btn-outline-secondary {
  background: #fff;
  border-color: rgb(229 231 235);
  color: rgb(64 64 64);
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  border-color: rgb(37 99 235);
  color: rgb(37 99 235);
}
.btn-outline-danger {
  background: #fff;
  border-color: rgb(252 165 165);
  color: rgb(185 28 28);
}
.btn-outline-danger:hover {
  background: rgb(254 242 242);
  color: rgb(153 27 27);
}
.dark .btn-outline-primary,
.dark .btn-outline-secondary {
  background: rgb(64 64 64);
  border-color: rgb(82 82 91);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}
.badge.rounded-pill { border-radius: 9999px; }
.bg-primary { background: rgb(37 99 235) !important; }
.bg-success { background: rgb(22 163 74) !important; }
.bg-info { background: rgb(125 211 252) !important; }
.bg-warning { background: rgb(253 224 71) !important; }
.bg-secondary { background: rgb(100 116 139) !important; }
.bg-light { background: rgb(243 244 246) !important; }
.text-dark { color: rgb(23 23 23) !important; }
.border { border: 1px solid rgb(229 231 235) !important; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgb(229 231 235);
  text-align: left;
  vertical-align: middle;
}
.dark .table th,
.dark .table td { border-bottom-color: rgb(82 82 91); }
.table-sm th,
.table-sm td { padding: 0.45rem 0.55rem; font-size: 0.85rem; }

.form-text {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: rgb(115 115 115);
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.form-check-input {
  width: 1rem;
  height: 1rem;
}
.alert,
.alert-info {
  border-radius: 0.75rem;
  border: 1px solid rgb(191 219 254);
  background: rgb(239 246 255);
  color: rgb(30 64 175);
  padding: 0.85rem 1rem;
  font-size: 0.925rem;
}

.abis-yoksis-wait {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}
.abis-yoksis-wait.is-on {
  display: flex;
}
.abis-yoksis-wait__card {
  width: min(420px, 100%);
  border-radius: 16px;
  background: #fff;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}
.dark .abis-yoksis-wait__card {
  background: #1e293b;
}
.abis-yoksis-wait__icon {
  display: inline-flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #b80610;
  font-size: 2rem;
  animation: abis-hourglass 1.6s ease-in-out infinite;
}
.dark .abis-yoksis-wait__icon {
  background: rgba(184, 6, 16, 0.16);
}
.abis-yoksis-wait__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 650;
  color: #0f172a;
}
.dark .abis-yoksis-wait__title {
  color: #fff;
}
.abis-yoksis-wait__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #64748b;
}
@keyframes abis-hourglass {
  0%, 35% { transform: rotate(0deg); }
  50%, 85% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* Panel — profil kartı avatar */
.user-grid-card .panel-profile-cover {
  position: relative;
  z-index: 0;
  max-height: 140px;
  object-fit: cover;
  display: block;
}

.panel-profile-avatar {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  background: #e8f0fe;
}

.dark .panel-profile-avatar {
  border-color: #404040;
  background: rgba(59, 130, 246, 0.15);
}

.panel-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-profile-avatar__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1d4ed8;
  background: #dbeafe;
}

.dark .panel-profile-avatar__initials {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.2);
}

.panel-yoksis-warn {
  margin-left: auto;
  margin-right: auto;
  max-width: 22rem;
  padding: 12px 14px;
  border: 2px solid #b80610;
  border-radius: 10px;
  background: #fff1f1;
  color: #b80610;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.dark .panel-yoksis-warn {
  background: rgba(184, 6, 16, 0.18);
  border-color: #ef4444;
  color: #fecaca;
}

/* Panel — modern onay popup */
.abis-confirm {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.abis-confirm.is-on {
  display: flex;
}
.abis-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.abis-confirm__card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  border-radius: 16px;
  background: #fff;
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}
.dark .abis-confirm__card {
  background: #1e293b;
}
.abis-confirm__icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b80610;
  font-size: 1.75rem;
}
.dark .abis-confirm__icon {
  background: rgba(184, 6, 16, 0.18);
  color: #fecaca;
}
.abis-confirm__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}
.dark .abis-confirm__title {
  color: #fff;
}
.abis-confirm__text {
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #64748b;
}
.dark .abis-confirm__text {
  color: #94a3b8;
}
.abis-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.abis-confirm__btn {
  min-width: 110px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.abis-confirm__btn--ghost {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}
.abis-confirm__btn--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.dark .abis-confirm__btn--ghost {
  background: transparent;
  border-color: #475569;
  color: #e2e8f0;
}
.abis-confirm__btn--danger {
  background: #b80610;
  color: #fff;
}
.abis-confirm__btn--danger:hover {
  background: #96040d;
  color: #fff;
}
