:root {
  --bg: #f0f2f5;
  --surface: #fff;
  --panel: #f8f9fb;
  --border: #e8eaee;
  --text: #1a1a2e;
  --text-2: #555;
  --muted: #5d6675;
  --btn-bg: #f0f1f5;
  --btn-bg-hover: #e8e9ef;
  --brand-ink: #8b0000;
  --tag-amber: #d97706;
  --tag-teal: #0d9488;
  --opt-sel: #f0f0ff;
  --msg-success-bg: #dcfce7;
  --msg-success-text: #16a34a;
  --msg-success-border: #bbf7d0;
  --msg-error-bg: #fee2e2;
  --msg-error-text: #dc2626;
  --msg-error-border: #fecaca;
  --msg-warning-bg: #fef3c7;
  --msg-warning-text: #d97706;
  --msg-warning-border: #fde68a;
}

html[data-theme="dark"] {
  --bg: #0f141f;
  --surface: #1a2233;
  --panel: #232d42;
  --border: #2f3a52;
  --text: #e9edf5;
  --text-2: #b6bfd2;
  --muted: #8d96a9;
  --btn-bg: #28324a;
  --btn-bg-hover: #33405e;
  --brand-ink: #ff8282;
  --tag-amber: #fbbf24;
  --tag-teal: #2dd4bf;
  --opt-sel: rgba(99, 102, 241, 0.22);
  --msg-success-bg: #052e16;
  --msg-success-text: #4ade80;
  --msg-success-border: #14532d;
  --msg-error-bg: #450a0a;
  --msg-error-text: #f87171;
  --msg-error-border: #7f1d1d;
  --msg-warning-bg: #451a03;
  --msg-warning-text: #fbbf24;
  --msg-warning-border: #78350f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Klavye odağı her zaman görünür (WCAG 2.4.7) */
:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip-link: normalde gizli, odakta görünür */
.skip-link {
  position: fixed;
  top: -48px;
  left: 12px;
  z-index: 10000;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 600px 400px at 10% 20%, rgba(139, 0, 0, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 90% 80%, rgba(139, 0, 0, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 44px 36px 36px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 32px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
}

.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #8b0000, #a30000);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 0, 0, 0.2);
}

.card-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.card-header p {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: titlecase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrapper:focus-within .icon {
  color: var(--brand-ink);
}

.form-control {
  width: 100%;
  padding: 13px 16px 13px 44px;
  font-size: 15px;
  color: var(--text);
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.form-control::placeholder {
  color: var(--muted);
}

.form-control:focus {
  border-color: var(--brand-ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

select.form-control {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #8b0000, #a30000);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-ghost {
  background: var(--btn-bg);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--btn-bg-hover);
}

.btn-danger {
  background: var(--msg-error-bg);
  color: var(--msg-error-text);
  border: 1px solid var(--msg-error-border);
}

.btn-danger:hover:not(:disabled) {
  background: var(--msg-error-border);
}

.btn-link {
  background: none;
  color: var(--muted);
  padding: 8px;
  font-size: 13px;
  font-weight: 400;
  width: auto;
}

.btn-link:hover {
  color: var(--brand-ink);
}

.form-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 18px;
}

.message {
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.4;
  display: none;
}

.message.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.message.success {
  background: var(--msg-success-bg);
  color: var(--msg-success-text);
  border: 1px solid var(--msg-success-border);
}

.message.error {
  background: var(--msg-error-bg);
  color: var(--msg-error-text);
  border: 1px solid var(--msg-error-border);
}

.message.warning {
  background: var(--msg-warning-bg);
  color: var(--msg-warning-text);
  border: 1px solid var(--msg-warning-border);
}

.timer {
  text-align: center;
  margin-bottom: 22px;
  padding: 14px;
  background: var(--panel);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.timer-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.timer-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-ink);
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.timer.expired .timer-value {
  color: var(--muted);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@media (max-width: 480px) {
  .card {
    padding: 32px 20px 28px;
    border-radius: 16px;
  }

  .container {
    padding: 12px;
  }
}

/* ===== Admin Dashboard ===== */

body.dashboard-body {
  display: block;
  background: var(--bg);
  padding: 0;
}

body.dashboard-body::before {
  display: none;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #8b0000, #a30000);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-logo .logo-text small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Sidebar link grupları: her grup ayrı kart gibi görünür */
.nav-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 12px;
}

.nav-card:last-child {
  margin-bottom: 0;
}

.nav-card .nav-item:hover {
  background: var(--surface);
}

.nav-card .nav-section-title {
  padding: 4px 10px 6px;
}

.nav-card .nav-section-title:first-child {
  padding-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--muted);
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item:hover i {
  color: var(--text-2);
}

.nav-item.active {
  background: rgba(139, 0, 0, 0.08);
  color: var(--brand-ink);
}

.nav-item.active i {
  color: var(--brand-ink);
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 20px 14px 6px;
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Main area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b0000, #a30000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.topbar-user .user-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.topbar-user .user-role {
  font-size: 11px;
  color: var(--muted);
}

.topbar .btn-logout {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar .btn-logout:hover {
  background: var(--msg-error-bg);
  color: var(--msg-error-text);
  border-color: var(--msg-error-border);
}

/* Content area */
.content-area {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

.content-header {
  margin-bottom: 24px;
}

.content-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.content-header p {
  font-size: 14px;
  color: var(--muted);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.stat-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

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

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Section titles */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: var(--brand-ink);
  font-size: 15px;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

#quickLinks {
  grid-template-columns: repeat(4, 1fr);
}

/* Modüller + İşlemler: satırda her zaman 2 kart (mobilde tek sütun) */
#quickLinksModules,
#quickLinksOps {
  grid-template-columns: repeat(2, 1fr);
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.report-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-card h4 i {
  color: var(--brand-ink);
  font-size: 14px;
}

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.2s;
  display: block;
}

.link-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border-color: var(--border);
  transform: translateY(-2px);
}

.link-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(139, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--brand-ink);
  margin-bottom: 14px;
}

.link-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.link-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.link-card .card-icon {
  position: relative;
}

@keyframes fr-pulse {
  0%, 100% { opacity:1; box-shadow: 0 0 16px rgba(220,38,38,0.5); transform:scale(1); }
  25% { opacity:0.7; box-shadow: 0 0 40px rgba(220,38,38,0.9); transform:scale(1.02); }
  50% { opacity:1; box-shadow: 0 0 16px rgba(220,38,38,0.5); transform:scale(1); }
  75% { opacity:0.85; box-shadow: 0 0 30px rgba(220,38,38,0.75); transform:scale(1.01); }
}

.link-card.highlight {
  animation: fr-pulse 1.2s ease-in-out infinite;
}

.card-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Announcements */
.announcements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

/* Schools: 2 sütunlu kart ızgarası (mobilde tek sütun) */
.schools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .schools-grid {
    grid-template-columns: 1fr;
  }
}

/* Okullar üst bölümü: yarıda 2x2 stat kartları, yarıda dağılım halkası */
.schools-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
.schools-top .stats-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 0;
}
.schools-top .donut-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 900px) {
  .schools-top {
    grid-template-columns: 1fr;
  }
}
.donut-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
}
.donut-center-value {
  font-size: 26px;
  font-weight: 700;
  fill: var(--text);
}
.donut-center-label {
  font-size: 11px;
  fill: var(--muted);
}
/* İkili halka: grup + tür dağılımı aynı kartta, taşmadan yan yana */
.donut-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.donut-item {
  min-width: 0;
  text-align: center;
}
.donut-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 2px;
}
.donut-item .donut-legend {
  margin-top: 6px;
  text-align: left;
}
@media (max-width: 480px) {
  .donut-duo {
    grid-template-columns: 1fr;
  }
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.donut-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-count {
  margin-left: auto;
  font-weight: 700;
  color: var(--text);
}
/* Donut etkileşimi: hover'da dilim kalınlaşır, diğerleri solar + imleç baloncuğu */
.donut-seg {
  transition: stroke-width 0.18s ease, opacity 0.18s ease;
  cursor: pointer;
}
.donut-seg:hover {
  stroke-width: 30;
}
.donut-item svg:hover .donut-seg:not(:hover) {
  opacity: 0.35;
}
.donut-tip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  display: none;
}
.donut-tip.show {
  display: block;
}
.donut-tip .muted {
  color: var(--muted);
  font-weight: 400;
}
/* Ayarlar yedek kartları: düğmeler düşeyde aynı hizada */
.settings-split {
  display: flex;
  flex-direction: column;
}
.settings-split .add-btn {
  margin-top: auto;
  align-self: flex-start;
}
/* Modül kartları: ikon + yazı + anahtar (açık/koyu uyumlu) */
.msw-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.msw-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.msw-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.msw-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.msw-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.msw-desc {
  font-size: 12px;
  color: var(--muted);
}
.msw-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  margin-top: 4px;
  flex-shrink: 0;
}
.msw-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.msw-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--brand-ink);
  border: 1px solid var(--brand-ink);
  border-radius: 20px;
  transition: 0.2s;
}
.msw-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 2px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  transition: 0.2s;
}
.msw-switch input:checked + .msw-slider {
  background: #16a34a;
  border-color: #16a34a;
}
.msw-switch input:checked + .msw-slider::before {
  transform: translateX(18px);
}
.msw-switch input:focus-visible + .msw-slider {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}
/* Dosya girdisi: düğme dahil tema uyumlu */
input[type="file"] {
  color: var(--text-2);
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: var(--btn-bg-hover);
}
/* Star Students tarzı okul satırı: ikon + bilgi + rozetler */
.school-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
/* Kompakt satır: tek satırda ad + ilçe + e-posta + kod; hover'da detay kartı açar */
.school-row--compact {
  padding: 10px 14px;
  position: relative;
}
.school-row--compact:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}
.school-row-line {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.school-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.school-row-sub {
  color: var(--muted);
  white-space: nowrap;
}
.school-row-mail {
  color: var(--text-2);
}
/* Satır detay kartı: hover/odakta açılır, okul bilgilerini gösterir */
.school-detail-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  padding: 16px 18px;
}
.school-row:hover .school-detail-pop,
.school-row:focus-within .school-detail-pop {
  display: block;
}
.school-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  font-size: 13px;
  color: var(--text-2);
}
/* Okul araç çubuğu: sonuç sayacı (arama + tür filtresi başlıkta, Kullanıcılar ile aynı) */
.schools-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.schools-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
/* Liste paneli: donut paneliyle dengeli kart */
.schools-list-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 12px;
  min-width: 0;
}
.schools-list-panel .announcements-list {
  margin-bottom: 0;
}
/* Sayfalama altlığı */
.schools-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0 8px;
}
.schools-pagination .pg-btn {
  min-width: 34px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.schools-pagination .pg-btn:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  color: var(--text);
}
.schools-pagination .pg-btn[aria-current="page"] {
  background: #8b0000;
  border-color: #8b0000;
  color: #fff;
}
.schools-pagination .pg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.schools-pagination .pg-info {
  font-size: 12px;
  color: var(--muted);
  margin: 0 6px;
}
/* Genel Bakış ikiye bölünme: Hızlı Erişim + Takvim */
.overview-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 28px;
}
/* Sağ sütun (takvim): başlıklar üstte kalır, takvim kutusu aşağı doğru
   uzayarak sol sütundaki İşlemler kartlarının alt kenarıyla aynı hizaya gelir. */
.overview-split > div:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.overview-split .cal-box {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.overview-split .cal-grid {
  flex: 1;
  grid-template-rows: auto repeat(6, 1fr);
}
.overview-split .cal-day {
  aspect-ratio: auto;
  max-height: none;
  height: 100%;
}
/* İşlemler kartlarının alt boşluğu sütun yüksekliğine dahil olmasın:
   takvimin alt kenarı tam olarak kartların alt kenarına oturur. */
.overview-split .cards-grid:last-child {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .overview-split {
    grid-template-columns: 1fr;
  }
  .overview-split .cal-box {
    flex: none;
    display: block;
  }
  .overview-split .cal-grid {
    flex: none;
    grid-template-rows: none;
  }
  .overview-split .cal-day {
    aspect-ratio: 1;
    max-height: 44px;
    height: auto;
  }
  .overview-split .cards-grid:last-child {
    margin-bottom: 28px;
  }
}
/* Takvim kutusu (referans minimal ay ızgarası, marka kırmızısı vurgu) */
.cal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  min-width: 0;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.cal-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(139, 0, 0, 0.08);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.cal-nav-btn:hover {
  background: rgba(139, 0, 0, 0.16);
}
.cal-today-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cal-today-btn:hover {
  background: var(--btn-bg-hover);
  color: var(--text);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 0;
}
.cal-day {
  position: relative;
  aspect-ratio: 1;
  max-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  padding: 0;
}
.cal-day:hover {
  background: var(--btn-bg);
}
.cal-day.is-dim {
  color: var(--muted);
  opacity: 0.55;
}
.cal-day.is-today {
  border-color: var(--brand-ink);
  font-weight: 700;
}
.cal-day.is-selected {
  background: #8b0000;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(139, 0, 0, 0.4);
}
.cal-day.has-event::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b91c1c;
}
.cal-day.is-selected.has-event::after {
  background: #fff;
}
.cal-day.has-event {
  background: rgba(139, 0, 0, 0.07);
}
.cal-day.is-selected.has-event {
  background: #8b0000;
}
.cal-day:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}
/* Sütun aralarında soluk çizgi: başlık + gün hücreleri aynı kolonda kilitlenir (kutu modelini oynatmaz) */
.cal-grid > :not(:nth-child(7n + 1)) {
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--text) 9%, transparent);
}
.cal-grid > .cal-day.is-selected:not(:nth-child(7n + 1)) {
  box-shadow:
    0 6px 18px rgba(139, 0, 0, 0.4),
    inset 1px 0 0 color-mix(in srgb, #ffffff 25%, transparent);
}
/* Gün detay kartı: hover/odak/dokunma ile açılır */
.cal-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: max-content;
  max-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  text-align: left;
  font-weight: 400;
}
.cal-day:hover .cal-pop,
.cal-day:focus-within .cal-pop,
.cal-day.pop-open .cal-pop {
  display: block;
}
.cal-pop h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.cal-pop-item {
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.cal-pop-item:first-of-type {
  border-top: none;
  padding-top: 0;
}
.cal-pop-date {
  font-size: 11px;
  color: var(--muted);
}
.cal-upcoming {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
/* Grafik türü seçici: radyo haplar (rapor ilçe görünümü) */
.chart-radio {
  display: inline-flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}
.chart-radio label {
  margin: 0;
}
.chart-radio input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.chart-radio span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chart-radio span:hover {
  color: var(--text);
}
.chart-radio input:checked + span {
  background: #8b0000;
  color: #fff;
}
.chart-radio input:focus-visible + span {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}
/* Kullanıcı başlığı: arama + haplar, add-btn (40px) ile aynı yükseklik */
.users-toolbar .form-control {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}
.users-toolbar .chart-radio span {
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
}
/* SVG grafikler: tema uyumlu eksen/yazı, yatay kaydırmalı kap */
.chart-scroll {
  overflow-x: auto;
}
.chart-scroll svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}
.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-axis-text {
  fill: var(--muted);
  font-size: 11px;
}
.chart-bar-label {
  fill: var(--text-2);
  font-size: 11px;
}
.chart-point-label {
  fill: var(--text);
  font-size: 10px;
  font-weight: 600;
}
/* İlçe grafik giriş animasyonları: sütunlar yükselir, çizgi çizilir, satırlar belirir */
.chart-bar-anim {
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: chartBarRise 0.5s cubic-bezier(0.22, 0.9, 0.3, 1.15) both;
}
@keyframes chartBarRise {
  to {
    transform: scaleY(1);
  }
}
.chart-dot-anim {
  opacity: 0;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  animation: chartDotPop 0.3s ease-out both;
}
@keyframes chartDotPop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.chart-area-anim {
  opacity: 0;
  animation: chartFadeIn 0.6s ease-out 0.5s both;
}
@keyframes chartFadeIn {
  to {
    opacity: 1;
  }
}
.district-row-anim {
  opacity: 0;
  animation: chartFadeIn 0.35s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .chart-bar-anim,
  .chart-dot-anim,
  .chart-area-anim,
  .district-row-anim {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
.school-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.school-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.school-row-main {
  flex: 1;
  min-width: 0;
}
.school-row-main h4 {
  margin-bottom: 2px;
}
.school-row-meta {
  font-size: 12px;
  color: var(--muted);
}
.school-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .school-row {
    flex-wrap: wrap;
  }
  .school-row-side {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.announcement-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.announcement-item .ann-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.ann-tag.admin { background: rgba(139, 0, 0, 0.1); color: var(--brand-ink); }
.ann-tag.all { background: rgba(139, 0, 0, 0.1); color: var(--brand-ink); }
.ann-tag.lise { background: rgba(245, 158, 11, 0.1); color: var(--tag-amber); }
.ann-tag.ortaokul { background: rgba(13, 148, 136, 0.1); color: var(--tag-teal); }
.ann-tag.diger { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.ann-tag.resmi { background: rgba(34, 197, 94, 0.12); color: #166534; }
.ann-tag.ozel { background: rgba(245, 158, 11, 0.14); color: #92400e; }

.announcement-item h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.announcement-item p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
  margin-bottom: 6px;
}

.announcement-item .ann-date {
  font-size: 11px;
  color: var(--muted);
}

/* Users Table */
.users-table-wrapper {
  overflow-x: auto;
  margin-bottom: 28px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.users-table thead th {
  text-align: left;
  padding: 13px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.users-table tbody tr {
  transition: background 0.12s;
}

.users-table tbody tr:hover {
  background: var(--panel);
}

.users-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.users-table .cell-email {
  color: var(--text);
  font-weight: 500;
}

.users-table .cell-date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.users-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.role-select {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  min-width: 140px;
}

.role-select:hover {
  border-color: var(--border);
}

.role-select:focus {
  border-color: var(--brand-ink);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
  background: transparent;
  color: var(--muted);
}

.btn-icon:hover {
  background: var(--btn-bg);
  color: var(--text-2);
}

.btn-icon-danger:hover {
  background: var(--msg-error-bg);
  color: var(--msg-error-text);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text-2);
}

.modal-body {
  padding: 24px 28px;
}

.modal-body .form-group {
  margin-bottom: 16px;
}

.modal-body p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 28px 24px;
}

.modal-footer .btn {
  padding: 10px 20px;
  font-size: 13px;
  width: auto;
}

/* Hamburger toggle */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}

/* Theme toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--btn-bg-hover);
  color: var(--text);
}

/* Theme switch (Uiverse by Galahhad) - topbar boyutuna uyarlandı (~62x28px) */
.theme-switch {
  --toggle-size: 11px;
  --container-width: 5.625em;
  --container-height: 2.5em;
  --container-radius: 6.25em;
  --container-light-bg: #3D7EAE;
  --container-night-bg: #1D1F2C;
  --circle-container-diameter: 3.375em;
  --sun-moon-diameter: 2.125em;
  --sun-bg: #ECCA2F;
  --moon-bg: #C4C9D1;
  --spot-color: #959DB1;
  --circle-container-offset: calc((var(--circle-container-diameter) - var(--container-height)) / 2 * -1);
  --stars-color: #fff;
  --clouds-color: #F3FDFF;
  --back-clouds-color: #AACADF;
  --transition: .5s cubic-bezier(0, -0.02, 0.4, 1.25);
  --circle-transition: .3s cubic-bezier(0, -0.02, 0.35, 1.17);
  flex-shrink: 0;
  display: inline-block;
}
.theme-switch, .theme-switch *, .theme-switch *::before, .theme-switch *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-size: var(--toggle-size);
}
.theme-switch__container {
  width: var(--container-width);
  height: var(--container-height);
  background-color: var(--container-light-bg);
  border-radius: var(--container-radius);
  overflow: hidden;
  cursor: pointer;
  -webkit-box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25), 0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25), 0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  position: relative;
}
.theme-switch__container::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  -webkit-box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset, 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
  box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset, 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
  border-radius: var(--container-radius);
}
.theme-switch__checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.theme-switch:focus-within .theme-switch__container {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}
.theme-switch__circle-container {
  width: var(--circle-container-diameter);
  height: var(--circle-container-diameter);
  background-color: rgba(255, 255, 255, 0.1);
  position: absolute;
  left: var(--circle-container-offset);
  top: var(--circle-container-offset);
  border-radius: var(--container-radius);
  -webkit-box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), 0 0 0 0.625em rgba(255, 255, 255, 0.1), 0 0 0 1.25em rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), 0 0 0 0.625em rgba(255, 255, 255, 0.1), 0 0 0 1.25em rgba(255, 255, 255, 0.1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-transition: var(--circle-transition);
  -o-transition: var(--circle-transition);
  transition: var(--circle-transition);
  pointer-events: none;
}
.theme-switch__sun-moon-container {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  width: var(--sun-moon-diameter);
  height: var(--sun-moon-diameter);
  margin: auto;
  border-radius: var(--container-radius);
  background-color: var(--sun-bg);
  -webkit-box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #a1872a inset;
  box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #a1872a inset;
  -webkit-filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25)) drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
  filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25)) drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
  overflow: hidden;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
}
.theme-switch__moon {
  -webkit-transform: translateX(100%);
  -ms-transform: translateX(100%);
  transform: translateX(100%);
  width: 100%;
  height: 100%;
  background-color: var(--moon-bg);
  border-radius: inherit;
  -webkit-box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #969696 inset;
  box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #969696 inset;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  position: relative;
}
.theme-switch__spot {
  position: absolute;
  top: 0.75em;
  left: 0.312em;
  width: 0.75em;
  height: 0.75em;
  border-radius: var(--container-radius);
  background-color: var(--spot-color);
  -webkit-box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
  box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
}
.theme-switch__spot:nth-of-type(2) {
  width: 0.375em;
  height: 0.375em;
  top: 0.937em;
  left: 1.375em;
}
.theme-switch__spot:nth-last-of-type(3) {
  width: 0.25em;
  height: 0.25em;
  top: 0.312em;
  left: 0.812em;
}
.theme-switch__clouds {
  width: 1.25em;
  height: 1.25em;
  background-color: var(--clouds-color);
  border-radius: var(--container-radius);
  position: absolute;
  bottom: -0.625em;
  left: 0.312em;
  -webkit-box-shadow: 0.937em 0.312em var(--clouds-color), -0.312em -0.312em var(--back-clouds-color), 1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color), 2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color), 2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color), 3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color), 4.5em -0.312em var(--clouds-color), 3.375em -0.437em var(--back-clouds-color), 4.625em -1.75em 0 0.437em var(--clouds-color), 4em -0.625em var(--back-clouds-color), 4.125em -2.125em 0 0.437em var(--back-clouds-color);
  box-shadow: 0.937em 0.312em var(--clouds-color), -0.312em -0.312em var(--back-clouds-color), 1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color), 2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color), 2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color), 3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color), 4.5em -0.312em var(--clouds-color), 3.375em -0.437em var(--back-clouds-color), 4.625em -1.75em 0 0.437em var(--clouds-color), 4em -0.625em var(--back-clouds-color), 4.125em -2.125em 0 0.437em var(--back-clouds-color);
  -webkit-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  -o-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
}
.theme-switch__stars-container {
  position: absolute;
  color: var(--stars-color);
  top: -100%;
  left: 0.312em;
  width: 2.75em;
  height: auto;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
}
.theme-switch__checkbox:checked + .theme-switch__container {
  background-color: var(--container-night-bg);
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container {
  left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter));
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container:hover {
  left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter) - 0.187em);
}
.theme-switch__circle-container:hover {
  left: calc(var(--circle-container-offset) + 0.187em);
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__moon {
  -webkit-transform: translate(0);
  -ms-transform: translate(0);
  transform: translate(0);
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__clouds {
  bottom: -4.062em;
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__stars-container {
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
}

/* Add-item button (Uiverse by andrew-demchenk0) - oluşturma düğmeleri için */
.add-btn {
  --add-bg: #3aa856;
  --add-border: #34974d;
  --add-icon-bg: #34974d;
  --add-hover: #34974d;
  --add-active: #2e8644;
  position: relative;
  width: 175px;
  height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--add-border);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--add-bg);
  font-family: inherit;
  font-size: 13px;
  padding: 0;
  flex-shrink: 0;
}
/* Kırmızı varyant (silme işlemleri) */
.add-btn--red {
  --add-bg: #dc2626;
  --add-border: #b91c1c;
  --add-icon-bg: #b91c1c;
  --add-hover: #b91c1c;
  --add-active: #991b1b;
}
/* Turkuaz varyant (Excel içe aktarma) */
.add-btn--teal {
  --add-bg: #0d9488;
  --add-border: #0f766e;
  --add-icon-bg: #0f766e;
  --add-hover: #0f766e;
  --add-active: #115e59;
}
/* Gri varyant (İptal / Vazgeç / Kapat / Geri) */
.add-btn--gray {
  --add-bg: #6b7280;
  --add-border: #4b5563;
  --add-icon-bg: #4b5563;
  --add-hover: #4b5563;
  --add-active: #374151;
}
/* Turuncu varyant (Soru Ekle) */
.add-btn--orange {
  --add-bg: #f59e0b;
  --add-border: #d97706;
  --add-icon-bg: #d97706;
  --add-hover: #d97706;
  --add-active: #b45309;
}
/* Kompakt boy (modal altlıkları, kısa yazılar: Sil/Kaydet/İptal/Geri/CSV/...) */
.add-btn.add-btn--sm {
  width: 150px;
}
.add-btn.add-btn--sm .add-btn__text {
  transform: translateX(30px);
}
.add-btn.add-btn--sm .add-btn__icon {
  transform: translateX(109px);
}
.add-btn.add-btn--sm:hover .add-btn__icon {
  width: 148px;
}
/* Ekstra kompakt (takvim başlığı: Bugün düğmesiyle aynı yükseklik 32px) */
.add-btn.add-btn--xs {
  width: 120px;
  height: 32px;
  font-size: 12px;
}
.add-btn.add-btn--xs .add-btn__text {
  transform: translateX(14px);
}
.add-btn.add-btn--xs .add-btn__icon {
  transform: translateX(79px);
}
.add-btn.add-btn--xs:hover .add-btn__icon {
  width: 118px;
}
/* Devre dışı durumu */
.add-btn:disabled,
.add-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.add-btn:disabled:hover .add-btn__text,
.add-btn[disabled]:hover .add-btn__text {
  color: #fff;
}
.add-btn:disabled:hover .add-btn__icon,
.add-btn[disabled]:hover .add-btn__icon {
  width: 39px;
  transform: translateX(134px);
}
.add-btn--sm:disabled:hover .add-btn__icon,
.add-btn--sm[disabled]:hover .add-btn__icon {
  width: 39px;
  transform: translateX(109px);
}
.add-btn, .add-btn__icon, .add-btn__text {
  transition: all 0.3s;
}
.add-btn .add-btn__text {
  transform: translateX(16px);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.add-btn .add-btn__icon {
  position: absolute;
  transform: translateX(134px);
  height: 100%;
  width: 39px;
  background-color: var(--add-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-btn .svg {
  width: 30px;
  stroke: #fff;
}
.add-btn:hover {
  background: var(--add-hover);
}
.add-btn:hover .add-btn__text {
  color: transparent;
}
.add-btn:hover .add-btn__icon {
  width: 173px;
  transform: translateX(0);
}
.add-btn:active .add-btn__icon {
  background-color: var(--add-active);
}
.add-btn:active {
  border: 1px solid var(--add-active);
}
.add-btn:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    bottom: 0;
    z-index: 100;
    background: var(--surface);
    transition: left 0.25s ease;
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .sidebar-toggle {
    display: block;
  }

  .topbar {
    padding: 0 16px;
  }

  .content-area {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-grid,
  #quickLinks,
  #quickLinksModules,
  #quickLinksOps {
    grid-template-columns: 1fr;
  }
}

/* Tablet ara kademe: 4 sütun direkt 1'e düşmesin */
@media (min-width: 769px) and (max-width: 1200px) {
  #quickLinks,
  #quickLinksModules,
  #quickLinksOps {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Koyu temada etiket kontrastı */
html[data-theme="dark"] .ann-tag.resmi { color: #4ade80; }
html[data-theme="dark"] .ann-tag.ozel { color: #fbbf24; }
html[data-theme="dark"] .ann-tag.diger { color: #f9a8d4; }

/* Hareket hassasiyeti (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Global Loader (Uiverse) - kitaplik animasyonu */
.peg-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
}
.peg-loader-overlay.show { display: flex; }
.peg-loader-overlay .peg-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.peg-loader {
  width: 192px;
  height: 192px;
  overflow: visible;
}
.peg-loader-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: loader-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes loader-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
