@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-card2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --sidebar-w: 260px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--text); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Login Page ─── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 40%, rgba(79,70,229,0.08) 0%, transparent 70%),
              radial-gradient(ellipse at 20% 80%, rgba(14,165,233,0.08) 0%, transparent 60%),
              var(--bg);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow), 0 0 60px rgba(79,70,229,0.05);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .logo-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(79,70,229,0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.login-brand .logo-icon img {
  display: block;
  width: 50px;
  height: 50px;
  max-width: 50px;
  max-height: 50px;
  object-fit: cover;
  border-radius: 12px;
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.login-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* ─── Form Controls ─── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

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

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79,70,229,0.45);
  color: white;
}

.btn-secondary {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16,185,129,0.4);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239,68,68,0.4);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}
.btn-warning:hover {
  transform: translateY(-1px);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-full { width: 100%; justify-content: center; }

/* ─── Alert / Flash ─── */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

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

.alert-success {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
}
.alert-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.alert-warning {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fcd34d;
}

/* ─── App Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

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

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

.sidebar-brand .brand-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-brand .brand-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 2px;
  cursor: pointer;
  text-decoration: none;
}

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

.nav-item.active {
  background: rgba(79,70,229,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 18px;
}

/* Button yang tampil seperti nav-item (untuk sidebar button) */
button.nav-item-btn {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
}
button.nav-item-btn:hover {
  background: var(--bg-card2);
  color: var(--text);
}


.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-card2);
  margin-bottom: 8px;
}

.sidebar-user .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.sidebar-user .user-info { overflow: hidden; }

.sidebar-user .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

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

.content {
  flex: 1;
  padding: 32px;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 24px; }

/* ─── Search Bar ─── */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  width: 280px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.search-bar-icon {
  color: var(--text-dim);
  font-size: 13px;
  flex-shrink: 0;
}

.search-bar-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.search-bar-input::placeholder { color: var(--text-dim); }

.search-bar-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}

.search-bar-clear:hover {
  color: var(--text);
  background: var(--border);
}

.search-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  background: rgba(79,70,229,0.1);
  border: 1px solid rgba(79,70,229,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  align-items: center;
}

/* ─── Guru Search Empty State ─── */
.guru-search-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.guru-search-empty .empty-icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: 8px;
}

.guru-search-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.guru-search-empty p {
  font-size: 0.83rem;
  color: var(--text-dim);
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.stat-icon.blue { background: rgba(79,70,229,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-icon.cyan { background: rgba(14,165,233,0.1); color: var(--secondary); }

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.stat-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Table ─── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg-card2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-admin {
  background: rgba(79,70,229,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
}

.badge-guru {
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.2);
}

.badge-pdf {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.2);
}

.badge-doc {
  background: rgba(6,182,212,0.15);
  color: #67e8f9;
  border: 1px solid rgba(6,182,212,0.2);
}

.badge-approved {
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.2);
  gap: 5px;
}

.badge-rejected {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.2);
  gap: 5px;
}

.badge-pending {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.2);
  gap: 5px;
}

/* ─── Folder Grid ─── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.folder-card:hover {
  border-color: var(--primary);
  background: rgba(79,70,229,0.05);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(79,70,229,0.2);
  color: var(--text);
}

.folder-card .folder-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  color: var(--secondary);
}

.folder-card .folder-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.folder-card .folder-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Upload Area ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(79,70,229,0.05);
}

.upload-zone .upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  color: var(--text-muted);
}

.upload-zone h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-zone input[type="file"] {
  display: none;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a { color: var(--primary-light); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-dim); }

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 20px 0;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--bg-card2);
  color: var(--text);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dim);
}

.empty-state p {
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ─── Guru List Grid ─── */
.guru-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* Guru card untuk tampilan publik (guru lihat guru lain) */
.guru-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.guru-card:hover {
  border-color: var(--secondary);
  background: rgba(6,182,212,0.05);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(6,182,212,0.15);
  color: var(--text);
}

.guru-card .guru-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 12px;
  color: white;
}

.guru-card .guru-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.guru-card .guru-username {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Guru Card Admin (5-kolom grid) ─── */
.guru-card-admin {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  text-align: center;
  transition: all 0.22s cubic-bezier(.25,.8,.25,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.guru-card-admin:hover {
  border-color: var(--primary-light);
  background: rgba(79,70,229,0.04);
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(79,70,229,0.13);
}

.guru-avatar-wrap {
  margin-bottom: 8px;
}

.guru-card-admin .guru-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 14px rgba(79,70,229,0.28);
  margin: 0 auto;
}

.guru-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.guru-card-username {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.guru-card-date {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.guru-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* ─── Form Card ─── */
.form-card {
  max-width: 600px;
}

/* ─── Responsive & Mobile Menu ─── */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-toggle { display: block; }
  
  .sidebar { 
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content { margin-left: 0; }
  .content { padding: 20px 16px; }
  .topbar { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show {
  display: block;
}

@media (max-width: 768px) {
  .folder-grid { grid-template-columns: repeat(2, 1fr); }
  .guru-grid { grid-template-columns: repeat(2, 1fr); }
}

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

/* ─── Action Buttons Group ─── */
.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Toast-like confirm ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active,
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: transform 0.2s;
}

.modal-overlay.active .modal-box,
.modal-overlay.show .modal-box { transform: scale(1); }

.modal-box h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-box p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ─── File type icons ─── */
.file-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.file-icon-pdf {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
}

.file-icon-doc {
  background: rgba(6,182,212,0.15);
  color: #67e8f9;
}

/* ─── Preview Modal ─── */
.preview-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 900px;
  width: 95%;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(.25,.8,.25,1);
  overflow: hidden;
}

.modal-overlay.active .preview-modal-box {
  transform: scale(1);
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.preview-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.preview-modal-close:hover {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.3);
}

.preview-modal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.preview-loading-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-card);
}

.preview-fallback-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  text-align: center;
}

/* ─── Guru Doc Grid (Admin: Data Dokumen) ─── */
.guru-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.guru-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(.25,.8,.25,1);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guru-doc-card:hover {
  border-color: var(--primary-light);
  background: rgba(79,70,229,0.04);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(79,70,229,0.13);
  color: var(--text);
}

.guru-doc-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guru-doc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(79,70,229,0.25);
}

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

.guru-doc-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guru-doc-total {
  font-size: 0.72rem;
  color: var(--primary-light);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.guru-doc-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.guru-doc-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  gap: 8px;
}

.guru-doc-stat-folder {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.77rem;
}

.guru-doc-stat-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.guru-doc-stat-count.has-file {
  color: var(--secondary);
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.2);
}

.guru-doc-no-folder {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ─── File Sharing Page ─── */
.sharing-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-card2);
}

.sharing-upload-zone:hover,
.sharing-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(79,70,229,0.05);
}

.sharing-upload-zone .upload-icon {
  font-size: 42px;
  margin-bottom: 12px;
  display: block;
  color: var(--primary-light);
}

.sharing-upload-zone h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.sharing-upload-zone p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.sharing-upload-zone input[type="file"] {
  display: none;
}

.sharing-selected-file {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(79,70,229,0.07);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--primary-light);
}

.sharing-selected-file.visible {
  display: flex;
}

.sharing-table-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .guru-doc-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .guru-doc-grid { grid-template-columns: 1fr; }
}

