@import url('https://cdn.jsdelivr.net/npm/vazir-font@27.2.2/dist/font-face.css');
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Vazir', Tahoma, sans-serif; direction: rtl; background: #f5f6fa; color: #2d3436; font-size: 14px; }

/* Nav */
nav { background: #2d3436; padding: 12px 24px; display: flex; gap: 20px; align-items: center; }
nav a { color: #dfe6e9; text-decoration: none; font-size: 14px; }
nav a:hover { color: #fff; }
nav .brand { font-size: 18px; font-weight: bold; color: #fff; margin-left: auto; }
nav .logout { color: #fd79a8; }
nav .nav-user { margin-right: auto; color: #74b9ff; font-size: 13px; padding: 4px 8px;
  background: rgba(255,255,255,.08); border-radius: 4px; }

/* Nav dropdown */
.nav-group { position: relative; cursor: pointer; }
.nav-label { color: #dfe6e9; font-size: 14px; padding: 4px 0; user-select: none; }
.nav-dropdown { display: none; position: absolute; top: 100%; right: 0; background: #3d4f52;
  border-radius: 8px; min-width: 160px; box-shadow: 0 6px 20px rgba(0,0,0,.3); z-index: 100;
  padding: 6px 0; }
.nav-dropdown a { display: block; padding: 9px 16px; color: #dfe6e9; font-size: 13px; text-decoration: none; }
.nav-dropdown a:hover { background: #4a6265; color: #fff; }
.nav-group:hover .nav-dropdown { display: block; }

/* Main */
main { padding: 30px; max-width: 1400px; margin: 0 auto; }
h1 { margin-bottom: 20px; color: #2d3436; font-size: 22px; }
h2 { margin: 20px 0 12px; font-size: 17px; }

/* Stats */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.card { background: #fff; border-radius: 10px; padding: 20px 24px; min-width: 130px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.card span { font-size: 28px; }
.card h3 { font-size: 28px; margin: 6px 0 4px; }
.card p { color: #636e72; font-size: 12px; }
.card.pending { border-top: 3px solid #fdcb6e; }
.card.approved { border-top: 3px solid #00b894; }
.card.published { border-top: 3px solid #0984e3; }

/* Table */
table { width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 20px; }
thead { background: #636e72; color: #fff; }
th, td { padding: 10px 14px; text-align: right; border-bottom: 1px solid #f0f0f0; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
tr.blocked td { background: #fff5f5; color: #b2bec3; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #ffeaa7; color: #d35400; }
.badge.approved { background: #d5f5e3; color: #1e8449; }
.badge.rejected { background: #fadbd8; color: #922b21; }
.badge.ready_to_publish { background: #d6eaf8; color: #1a5276; }
.badge.published { background: #d5f5e3; color: #1e8449; }
.badge.archived { background: #f0f0f0; color: #7f8c8d; }

/* Toast notifications */
.toast-container { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 28px; border-radius: 8px; font-size: 14px; color: #fff;
  pointer-events: auto; animation: toastIn .3s ease; min-width: 200px;
  text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.toast.success { background: #27ae60; }
.toast.error   { background: #e74c3c; }
.toast.info    { background: #2980b9; }
@keyframes toastIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* Modal overlay — hidden by default, .open class shows it */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.48);
  z-index:1000; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal-box { background:#fff; border-radius:12px; padding:28px; max-width:520px;
  width:90%; direction:rtl; box-shadow:0 8px 30px rgba(0,0,0,.2); }
.modal-box h3 { margin:0 0 14px; font-size:17px; }
.modal-box pre, .modal-preview { white-space:pre-wrap; background:#f8f8f8; padding:14px;
  border-radius:8px; font-family:Vazir,Tahoma,sans-serif; font-size:13px; line-height:1.7; max-height:200px; overflow-y:auto; }
.modal-box textarea { width:100%; padding:10px; border:1px solid #ddd; border-radius:8px;
  font-family:Vazir,Tahoma,sans-serif; font-size:14px; resize:vertical; margin-top:8px; }
.modal-actions { display:flex; gap:10px; margin-top:18px; justify-content:flex-end; flex-wrap:wrap; }
.modal-step2 { display:none; margin-top:12px; border-top:1px solid #eee; padding-top:12px; }
.modal-step2.show { display:block; }

/* Buttons */
.btn { display: inline-block; padding: 9px 20px; background: #0984e3; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 13px; }
.btn:hover { background: #074b81; }
.btn-sm { padding: 4px 10px; font-size: 12px; border: none; border-radius: 4px;
  cursor: pointer; background: #dfe6e9; color: #2d3436; }
.btn-sm.green { background: #00b894; color: #fff; }
.btn-sm.red { background: #d63031; color: #fff; }
.btn-sm.blue { background: #0984e3; color: #fff; }
.actions { white-space: nowrap; display: flex; gap: 4px; align-items: center; }

/* Filters */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { padding: 7px 12px; border: 1px solid #dfe6e9; border-radius: 6px; }
.filters button { padding: 7px 18px; background: #636e72; color: #fff; border: none; border-radius: 6px; cursor: pointer; }

/* Form box */
.form-box { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.form-box input, .form-box textarea, .form-box select {
  width: 100%; padding: 9px 12px; margin-bottom: 10px;
  border: 1px solid #dfe6e9; border-radius: 6px; font-size: 14px; }

/* Login */
.login-box { max-width: 360px; margin: 80px auto; background: #fff;
  border-radius: 12px; padding: 40px; box-shadow: 0 4px 20px rgba(0,0,0,.1); text-align: center; }
.login-box h1 { margin-bottom: 24px; }
.login-box input { width: 100%; padding: 12px; margin-bottom: 14px;
  border: 1px solid #dfe6e9; border-radius: 8px; font-size: 15px; text-align: center; }
.login-box button { width: 100%; padding: 12px; background: #0984e3; color: #fff;
  border: none; border-radius: 8px; font-size: 15px; cursor: pointer; }
.error { color: #d63031; margin-bottom: 12px; font-size: 13px; }
