* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --success-bg: #ecfdf5;
  --success-text: #059669;
  --success-border: #a7f3d0;
  --error-bg: #fef2f2;
  --error-text: #dc2626;
  --error-border: #fecaca;
}
body {
  font-family: 'Segoe UI', 'Vazirmatn', Tahoma, sans-serif;
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 20px 12px;
}
.container { max-width: 900px; margin: 0 auto; }
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card-bg); padding: 14px 22px; border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06); margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.navbar .logo { font-size: 1.4rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.navbar .nav-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.navbar a.nav-btn {
  color: var(--text-muted); text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: .9rem; transition: .2s;
}
.navbar a.nav-btn:hover { background: #f1f5f9; color: var(--primary); }
.navbar a.nav-btn.active { background: var(--primary); color: #fff; }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,.05);
}
h1, h2 { color: var(--text); margin-bottom: 16px; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; }

input[type=text], input[type=password], input[type=email] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  background: #f8fafc; color: var(--text); font-size: .95rem; margin-bottom: 14px; transition: .2s;
}
input:focus { outline: none; border-color: var(--primary); background: #fff; }

button, .btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none;
  padding: 11px 24px; border-radius: 10px; cursor: pointer; font-size: .95rem; text-decoration: none;
  display: inline-block; font-weight: 500; transition: transform .15s, box-shadow .15s;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn-gray { background: #f1f5f9; color: var(--text-muted); }

.success { color: var(--success-text); background: var(--success-bg); border: 1px solid var(--success-border); padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; word-break: break-all; }
.error { color: var(--error-text); background: var(--error-bg); border: 1px solid var(--error-border); padding: 10px 16px; border-radius: 10px; margin-bottom: 10px; }

.drop-zone {
  border: 2px dashed #c7d2fe; border-radius: 16px; padding: 40px 20px; text-align: center;
  color: var(--text-muted); margin-bottom: 16px; cursor: pointer; transition: .2s; background: #f8faff;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: #eef2ff; color: var(--primary); }
.drop-zone .icon { font-size: 2.2rem; margin-bottom: 8px; }

.progress-wrap { display: none; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); transition: width .1s; }

.file-list { list-style: none; }
.file-list li {
  display: flex; align-items: center; padding: 12px 4px; border-bottom: 1px solid #f1f5f9; gap: 12px; flex-wrap: wrap;
}
.file-list li:last-child { border-bottom: none; }
.file-icon { font-size: 1.6rem; width: 36px; text-align: center; }
.file-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.file-info { flex: 1; min-width: 140px; }
.file-name { word-break: break-all; font-size: .92rem; font-weight: 500; }
.file-meta { color: var(--text-muted); font-size: .78rem; margin-top: 3px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions a, .actions button { font-size: .78rem; padding: 7px 12px; border-radius: 8px; text-decoration: none; border: none; cursor: pointer; font-weight: 500; }
.dl { background: #eff6ff; color: #2563eb; }
.cp { background: #f0fdf4; color: #16a34a; }
.rn { background: #fefce8; color: #ca8a04; }
.del { background: #fef2f2; color: #dc2626; }

.stats { color: var(--text-muted); font-size: .85rem; }
.empty { color: #cbd5e1; text-align: center; padding: 30px; }
.search-box input { margin-bottom: 16px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: .85rem;
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid #f1f5f9; font-size: .9rem; }
table.admin-table th { color: var(--text-muted); font-weight: 600; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-admin { background: #ede9fe; color: #7c3aed; }
.badge-user { background: #f1f5f9; color: #64748b; }

.folder-item { cursor: pointer; }
.breadcrumb { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; font-size: .88rem; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); text-decoration: none; }

@media (max-width: 600px) {
  .navbar { flex-direction: column; align-items: flex-start; }
  .card { padding: 18px; }
  .actions { width: 100%; }
}