* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  direction: rtl;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 40px;
  width: 340px;
  text-align: center;
}

.login-box h1 {
  font-size: 20px;
  margin-bottom: 24px;
  color: #2ecc71;
}

.login-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #e6edf3;
  font-size: 15px;
}

.login-box button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #2ecc71;
  color: #05210f;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}

.login-box button:hover { background: #27ae60; }

.error-msg {
  color: #f85149;
  margin-top: 10px;
  font-size: 14px;
  min-height: 18px;
}

/* ============ Dashboard ============ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #30363d;
  background: #161b22;
}

.topbar h1 { font-size: 18px; margin: 0; color: #2ecc71; }

.status-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}
.status-open { background: #1a3a26; color: #2ecc71; }
.status-close { background: #3a1a1a; color: #f85149; }
.status-unknown { background: #33301a; color: #d4b106; }

.logout-btn {
  background: transparent;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.logout-btn:hover { border-color: #f85149; color: #f85149; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

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

.stat-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.stat-card .value { font-size: 26px; font-weight: bold; color: #2ecc71; }
.stat-card .label { font-size: 13px; color: #8b949e; margin-top: 6px; }

.panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}
.panel h2 { font-size: 16px; margin-top: 0; margin-bottom: 16px; }

.send-form { display: flex; gap: 10px; flex-wrap: wrap; }
.send-form input, .send-form textarea {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #e6edf3;
  padding: 10px;
  font-size: 14px;
}
.send-form input { flex: 1; min-width: 160px; }
.send-form textarea { width: 100%; min-height: 70px; resize: vertical; }
.send-form button {
  background: #2ecc71;
  border: none;
  color: #05210f;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.send-form button:hover { background: #27ae60; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px; text-align: right; border-bottom: 1px solid #30363d; }
th { color: #8b949e; font-weight: normal; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge-sent { background: #1a3a26; color: #2ecc71; }
.badge-failed { background: #3a1a1a; color: #f85149; }

.small-btn {
  background: #30363d;
  border: none;
  color: #e6edf3;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.small-btn:hover { background: #444c56; }

.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.filters select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 8px;
  border-radius: 8px;
}

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.pagination button {
  background: #30363d;
  border: none;
  color: #e6edf3;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.msg-preview { max-width: 260px; white-space: normal; word-break: break-word; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #21262d;
  border: 1px solid #30363d;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
