:root {
      --primary: #1A2B4C;
      --primary-light: #2C4270;
      --accent: #D35400;
      --accent-hover: #B84300;
      --bg: #F4F7F6;
      --card-bg: #FFFFFF;
      --text: #2C3E50;
      --text-muted: #64748B;
      --border: #E2E8F0;
      --radius: 12px;
      --shadow: 0 4px 15px rgba(26, 43, 76, 0.05);
      --font: 'Plus Jakarta Sans', sans-serif;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* Giriş Ekranı */
    #login-screen {
      position: fixed;
      inset: 0;
      background: linear-gradient(135deg, #1A2B4C 0%, #0F172A 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 3000;
      padding: 1.5rem;
    }
    .login-card {
      width: 100%;
      max-width: 420px;
      background: #FFFFFF;
      border-radius: 16px;
      padding: 2.5rem 2rem;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
      text-align: center;
    }
    .login-card .logo {
      font-size: 1.6rem;
      font-weight: 800;
      color: var(--primary);
      margin-bottom: 0.35rem;
    }
    .login-card .logo span { color: var(--accent); }
    .login-card p {
      color: var(--text-muted);
      font-size: 0.9rem;
      margin-bottom: 1.5rem;
    }
    .admin-otp-input {
      font-size: 1.8rem !important;
      letter-spacing: 12px !important;
      text-align: center !important;
      font-weight: 800 !important;
      padding: 0.75rem 1rem !important;
      color: var(--primary) !important;
      background: #F8FAFC !important;
      border: 2px solid #CBD5E1 !important;
      border-radius: 12px !important;
      margin: 1rem auto !important;
      max-width: 280px;
      display: block;
      width: 100%;
    }
    .admin-otp-input:focus {
      border-color: var(--accent) !important;
      background: #FFFFFF !important;
      box-shadow: 0 0 0 4px rgba(211, 84, 0, 0.15) !important;
    }

    /* Dashboard Düzeni */
    #dashboard-screen {
      display: none;
      width: 100%;
      height: 100%;
      flex-direction: row;
    }

    /* Sol Sidebar */
    .sidebar {
      width: 260px;
      background: var(--primary);
      color: #fff;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      white-space: nowrap;
      position: relative;
    }
    .sidebar.collapsed {
      width: 70px;
    }
    .sidebar.collapsed .sidebar-header span,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .nav-item-badge {
      display: none !important;
      opacity: 0;
    }
    .sidebar.collapsed .sidebar-header {
      justify-content: center;
      padding: 1.5rem 0.5rem;
    }
    .sidebar.collapsed .nav-item {
      justify-content: center;
      padding: 0.85rem 0;
      gap: 0;
    }
    .sidebar.collapsed .nav-item i {
      font-size: 1.2rem;
      margin: 0;
    }
    .sidebar-header {
      padding: 1.5rem;
      font-size: 1.2rem;
      font-weight: 800;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      align-items: center;
      gap: 10px;
      overflow: hidden;
    }
    .sidebar-header i { color: var(--accent); flex-shrink: 0; }
    .sidebar-nav {
      flex: 1;
      padding: 1.5rem 0;
      overflow-y: auto;
      overflow-x: hidden;
    }
    .nav-item {
      padding: 0.85rem 1.5rem;
      display: flex;
      align-items: center;
      gap: 12px;
      color: rgba(255, 255, 255, 0.7);
      text-decoration: none;
      font-weight: 600;
      font-size: 0.92rem;
      transition: all 0.2s;
      cursor: pointer;
      border-left: 4px solid transparent;
      overflow: hidden;
    }
    .nav-item i { flex-shrink: 0; width: 20px; text-align: center; }
    .nav-item:hover, .nav-item.active {
      background: rgba(255, 255, 255, 0.08);
      color: #FFFFFF;
      border-left-color: var(--accent);
    }
    .nav-item-badge {
      margin-left: auto;
      background: var(--accent);
      color: #fff;
      font-size: 0.7rem;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 10px;
    }

    /* İçerik Alanı */
    .main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: var(--bg);
      overflow-y: auto;
      min-width: 0;
    }
    .topbar {
      background: var(--card-bg);
      padding: 0.9rem 2rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .btn-sidebar-toggle {
      background: #F8FAFC;
      border: 1px solid var(--border);
      color: var(--primary);
      width: 38px;
      height: 38px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 1rem;
      transition: all 0.2s ease;
      flex-shrink: 0;
    }
    .btn-sidebar-toggle:hover {
      background: var(--primary);
      border-color: var(--primary);
      color: #FFFFFF;
    }
    .topbar-title {
      font-size: 1.2rem;
      font-weight: 700;
      color: var(--primary);
    }
    .topbar-user {
      display: flex;
      align-items: center;
      gap: 1rem;
      font-size: 0.9rem;
      font-weight: 600;
    }
    .topbar-user a {
      color: var(--primary);
      text-decoration: none;
      font-size: 0.85rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* Dashboard Gövdesi */
    .dashboard-body {
      padding: 2rem;
      max-width: 1400px;
      width: 100%;
      margin: 0 auto;
    }

    /* İstatistik Kartları */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 1.25rem;
      margin-bottom: 2rem;
    }
    .stat-card {
      background: var(--card-bg);
      padding: 1.4rem;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      border-left: 4px solid var(--primary);
    }
    .stat-card.accent { border-left-color: var(--accent); }
    .stat-card h4 {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-bottom: 0.4rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .stat-card .value {
      font-size: 1.8rem;
      font-weight: 800;
      color: var(--primary);
    }

    /* Paneller & Tablolar */
    .panel {
      background: var(--card-bg);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      margin-bottom: 2rem;
      overflow: hidden;
    }
    .panel-header {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1rem;
    }
    .panel-title {
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .panel-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .table-container {
      overflow-x: auto;
      min-height: 220px;
      padding-bottom: 2.5rem;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.9rem;
    }
    th, td {
      padding: 0.9rem 1.25rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }
    th {
      font-size: 0.8rem;
      text-transform: uppercase;
      color: var(--text-muted);
      font-weight: 600;
      background: #F8FAFC;
    }
    tr:hover td { background: #FAFCFE; }

    /* Rozetler */
    .badge {
      padding: 0.3rem 0.7rem;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .badge-pending { background: #FEF9C3; color: #854D0E; }
    .badge-approved { background: #DCFCE7; color: #166534; }
    .badge-rejected { background: #FEE2E2; color: #991B1B; }
    .badge-suspended { background: #F1F5F9; color: #475569; }
    .badge-admin { background: #EAEFF8; color: #1A2B4C; border: 1px solid #1A2B4C; }
    .badge-active-student { background: #E8F8F0; color: #1E824C; border: 1px solid #27AE60; }
    .badge-passive-student { background: #FDEDEC; color: #C0392B; border: 1px solid #E74C3C; }

    /* Form ve Butonlar */
    .form-group { margin-bottom: 1rem; text-align: left; }
    .form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--primary); }
    .form-group input, .form-group select, .form-group textarea {
      width: 100%;
      padding: 0.75rem 0.9rem;
      border: 1px solid var(--border);
      border-radius: 8px;
      outline: none;
      font-size: 0.9rem;
      font-family: inherit;
    }
    .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
      border-color: var(--primary);
    }
    .btn {
      padding: 0.65rem 1.15rem;
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: 8px;
      font-weight: 600;
      font-size: 0.88rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
      text-decoration: none;
    }
    .btn:hover { background: var(--primary-light); }
    .btn-accent { background: var(--accent); }
    .btn-accent:hover { background: var(--accent-hover); }
    .btn-outline {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
    }
    .btn-outline:hover { background: #F1F5F9; color: var(--primary); }
    .btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
    .btn-danger { background: #E74C3C; }
    .btn-danger:hover { background: #C0392B; }

    .search-input {
      padding: 0.55rem 0.9rem 0.55rem 2.2rem;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 0.88rem;
      outline: none;
      width: 240px;
    }
    .search-wrapper { position: relative; }
    .search-wrapper i { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }

    /* İşlem Dropdown Menüsü */
    .row-actions-dropdown {
      position: relative;
      display: inline-block;
    }
    .btn-row-action-trigger {
      background: #FFFFFF;
      border: 1px solid var(--border);
      color: var(--text-muted);
      width: 34px;
      height: 34px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 1rem;
      transition: all 0.2s ease;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
    .btn-row-action-trigger:hover,
    .btn-row-action-trigger.active {
      background: var(--primary);
      color: #FFFFFF;
      border-color: var(--primary);
      box-shadow: 0 2px 6px rgba(26, 43, 76, 0.2);
    }
    .row-actions-menu {
      display: none;
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      background: #FFFFFF;
      border: 1px solid #CBD5E1;
      border-radius: 10px;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
      min-width: 195px;
      z-index: 1000;
      padding: 6px;
      text-align: left;
    }
    .row-actions-menu.show {
      display: block;
      animation: fadeInDropdown 0.15s ease-out;
    }
    @keyframes fadeInDropdown {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .row-action-item {
      width: 100%;
      padding: 9px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      background: transparent;
      border: none;
      border-radius: 6px;
      color: #334155;
      font-size: 0.86rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
      text-align: left;
    }
    .row-action-item i {
      width: 18px;
      font-size: 0.95rem;
      color: #64748B;
      text-align: center;
      transition: color 0.15s ease;
    }
    .row-action-item:hover {
      background: #F1F5F9;
      color: var(--primary);
    }
    .row-action-item:hover i {
      color: var(--accent);
    }

    /* Modallar */
    .app-modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 2500;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
    }
    .app-modal--open { display: flex; }
    .app-modal__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); }
    .app-modal__content {
      position: relative;
      background: #FFFFFF;
      border-radius: var(--radius);
      width: 100%;
      max-width: 620px;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
      z-index: 10;
    }
    .app-modal__header {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .app-modal__header h3 { font-size: 1.1rem; color: var(--primary); }
    .app-modal__close { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
    .app-modal__body { padding: 1.5rem; overflow-y: auto; }
    .app-modal__footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

    /* Fatura & Dekont Önizleme */
    .receipt-preview-box {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 1rem;
      background: #F8FAFC;
      text-align: center;
      margin-bottom: 1.25rem;
    }
    .receipt-preview-img {
      max-width: 100%;
      max-height: 350px;
      border-radius: 6px;
      object-fit: contain;
    }

    
    .sidebar-backdrop {
      display: none;
    }

    @media (max-width: 1024px) {
      .dashboard-body {
        padding: 1.25rem;
      }
      .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
      }
    }

    @media (max-width: 768px) {
      #dashboard-screen {
        position: relative;
        overflow-x: hidden;
      }

      /* Sidebar Mobil Çekmece (Drawer) */
      .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 2100;
        width: 270px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.35);
      }
      .sidebar.mobile-open {
        transform: translateX(0);
      }
      .sidebar.collapsed {
        width: 270px; /* Mobilde daraltma yerine tam drawer kullan */
      }
      .sidebar.collapsed .sidebar-header span,
      .sidebar.collapsed .nav-text,
      .sidebar.collapsed .nav-item-badge {
        display: inline-block !important;
        opacity: 1;
      }
      .sidebar.collapsed .sidebar-header {
        justify-content: flex-start;
        padding: 1.5rem;
      }
      .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 0.85rem 1.5rem;
        gap: 12px;
      }

      .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(3px);
        z-index: 2050;
      }
      .sidebar-backdrop.active {
        display: block;
      }

      /* Topbar Mobil */
      .topbar {
        padding: 0.65rem 0.85rem;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        gap: 0.5rem;
      }
      .topbar-title {
        font-size: 1rem;
        max-width: 130px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .topbar-user {
        font-size: 0.82rem;
        gap: 0.4rem;
        flex-shrink: 0;
      }
      .admin-topbar-text {
        display: none !important; /* Mobilde dar barda sadece ikonlar görünür, taşma yapmaz */
      }
      .btn-refresh-compact {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.82rem;
        border-radius: 6px;
      }
      .topbar-site-link {
        padding: 0.4rem 0.6rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: #F8FAFC;
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
      }
      .topbar-admin-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
        padding: 0.2rem 0.4rem;
      }

      /* Dashboard Gövdesi Mobil */
      .dashboard-body {
        padding: 0.85rem 0.65rem;
        max-width: 100%;
        box-sizing: border-box;
      }
      .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
      }
      .stat-card {
        padding: 1.1rem;
      }
      .stat-card .value {
        font-size: 1.5rem;
      }

      /* Panel ve Başlık Mobil */
      .panel {
        margin-bottom: 1.25rem;
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
      }
      .panel-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
      }
      .panel-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
      }
      .panel-actions > * {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
      }
      .panel-actions .search-wrapper {
        width: 100% !important;
      }
      .panel-actions .search-input {
        width: 100% !important;
      }
      .panel-actions .btn {
        width: 100% !important;
        justify-content: center;
      }

      /* Bildirim Tarih Aralığı Mobilde Esnek Yerleşim */
      .notif-date-range-filter {
        width: 100% !important;
        display: flex !important;
        align-items: center;
        gap: 0.35rem;
        box-sizing: border-box;
        flex-wrap: wrap;
      }
      .notif-date-range-filter input[type="date"] {
        flex: 1 1 110px !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem;
      }

      /* Tablolar Mobil */
      .table-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 180px;
        padding-bottom: 3.5rem; /* Dropdown menünün kesilmemesi için ekstra alan */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .table-container table {
        min-width: 620px;
        width: 100%;
      }
      th, td {
        padding: 0.75rem 0.85rem;
        font-size: 0.84rem;
        white-space: nowrap;
      }

      /* Modal Mobil */
      .app-modal {
        padding: 0.75rem;
        align-items: flex-end; /* Mobilde bottom-sheet hissi */
      }
      .app-modal__content {
        max-height: 92vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
      }
      .app-modal__header {
        padding: 1rem 1.15rem;
      }
      .app-modal__body {
        padding: 1.15rem;
      }
      .app-modal__footer {
        padding: 0.85rem 1.15rem;
        flex-direction: column-reverse;
      }
      .app-modal__footer .btn {
        width: 100%;
        justify-content: center;
      }
    }


    /* ── MODERN ADMİN TOAST BİLDİRİM SİSTEMİ ── */
    .admin-toast-container {
      position: fixed;
      top: 1.5rem;
      right: 1.5rem;
      z-index: 99999;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      pointer-events: none;
      max-width: 440px;
      width: calc(100% - 3rem);
    }

    .admin-toast {
      pointer-events: auto;
      display: flex;
      align-items: flex-start;
      gap: 0.9rem;
      padding: 1rem 1.25rem;
      border-radius: 12px;
      background: #FFFFFF;
      color: var(--text);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
      border-left: 4px solid #10B981;
      animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      transition: all 0.3s ease;
    }

    .admin-toast.toast-error {
      border-left-color: #EF4444;
    }

    .admin-toast.toast-info {
      border-left-color: var(--primary);
    }

    .admin-toast.toast-warning {
      border-left-color: #F59E0B;
    }

    .admin-toast__icon {
      font-size: 1.3rem;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .admin-toast.toast-success .admin-toast__icon { color: #10B981; }
    .admin-toast.toast-error .admin-toast__icon { color: #EF4444; }
    .admin-toast.toast-info .admin-toast__icon { color: var(--primary); }
    .admin-toast.toast-warning .admin-toast__icon { color: #F59E0B; }

    .admin-toast__body {
      flex: 1;
      font-size: 0.92rem;
      line-height: 1.45;
      font-weight: 500;
    }

    .admin-toast__close {
      background: none;
      border: none;
      color: #94A3B8;
      cursor: pointer;
      font-size: 0.95rem;
      padding: 2px 4px;
      border-radius: 4px;
      transition: color 0.2s;
      flex-shrink: 0;
    }
    .admin-toast__close:hover {
      color: #334155;
    }

    .admin-toast.toast-leaving {
      opacity: 0;
      transform: translateX(35px);
    }

    @keyframes toastSlideIn {
      from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }