/* =============================================
   অ্যাডমিন প্যানেল স্টাইল
   ============================================= */

:root {
  --primary: #0d5c3a;
  --primary-dark: #083d27;
  --primary-light: #1a7a4a;
  --gold: #c9a84c;
  --gold-light: #e8d5a3;
  --gold-dark: #a07c30;
  --bg: #f0f4f1;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-light: #555;
  --text-muted: #888;
  --border: #e0e8e3;
  --danger: #e53e3e;
  --danger-light: #fff5f5;
  --warning: #d97706;
  --success: #2f855a;
  --sidebar-width: 260px;
  --shadow: 0 2px 12px rgba(13, 92, 58, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease;
}

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

body {
  font-family: 'Hind Siliguri', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
input, textarea, select { font-family: inherit; }

/* =============================================
   লগইন স্ক্রিন
   ============================================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 1.5rem;
}

.login-box {
  background: white;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.login-logo {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.login-box h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.login-box > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-form { text-align: right; }

.login-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 4px 15px rgba(13, 92, 58, 0.3);
}

/* =============================================
   অ্যাডমিন অ্যাপ লেআউট
   ============================================= */
.admin-app {
  display: flex;
  min-height: 100vh;
}

/* সাইডবার */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-dark);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  font-size: 1.8rem;
  color: var(--gold);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}

.sidebar-header small {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.sidebar-toggle {
  display: none;
  background: none;
  color: var(--gold);
  font-size: 1.3rem;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
  border-right: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.nav-item.active {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
  border-right-color: var(--gold);
}

.nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  background: var(--gold);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.nav-badge.danger {
  background: var(--danger);
  color: white;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logout-btn {
  width: 100%;
  padding: 0.65rem;
  background: rgba(229, 62, 62, 0.15);
  color: #fc8181;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
  border: 1px solid rgba(229, 62, 62, 0.3);
}

.logout-btn:hover {
  background: rgba(229, 62, 62, 0.25);
}

.public-link {
  text-align: center;
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  padding: 0.4rem;
  transition: color 0.2s;
}

.public-link:hover {
  color: var(--gold-light);
}

/* মেইন কন্টেন্ট */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 2rem;
  max-width: calc(100vw - var(--sidebar-width));
}

.tab-content { display: block; }

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =============================================
   স্ট্যাটস কার্ড (ড্যাশবোর্ড)
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 92, 58, 0.15);
}

.stat-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* দ্রুত কার্যক্রম */
.dashboard-actions h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.action-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  border: 2px solid var(--border);
  transition: var(--transition);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
}

.action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(13, 92, 58, 0.15);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 2.5rem;
}

/* =============================================
   টেবিল (কুপন তালিকা)
   ============================================= */
.table-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: white;
  transition: var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 92, 58, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.filter-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group select {
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.filter-group select:focus {
  border-color: var(--primary);
}

.export-btn {
  padding: 0.65rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.export-btn:hover {
  background: var(--primary-dark);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: white;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-table th {
  background: var(--primary);
  color: white;
  padding: 0.85rem 1rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.85rem;
}

.admin-table th:first-child {
  text-align: center;
  width: 45px;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.admin-table td:first-child {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(13, 92, 58, 0.03);
}

.loading-cell {
  text-align: center;
  padding: 2rem !important;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gold-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  text-align: center;
  padding: 2rem;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ডিলিট বাটন */
.delete-btn {
  padding: 0.35rem 0.75rem;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fed7d7;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}

.delete-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* পুরস্কার ব্যাজ */
.prize-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.prize-500 { background: #fef3c7; color: #92400e; }
.prize-200 { background: #dcfce7; color: #15803d; }
.prize-100 { background: #dbeafe; color: #1e40af; }
.prize-50 { background: #f3e8ff; color: #7e22ce; }
.prize-0 { background: #f1f5f9; color: #64748b; }

/* =============================================
   বিজয়ী নির্বাচন কার্ড
   ============================================= */
.winner-selection-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 700px;
}

.week-info, .month-info {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 1rem;
}

.eligible-count {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1.1rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: white;
  border: none;
  cursor: pointer;
}

.weekly-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.monthly-btn {
  background: linear-gradient(135deg, #6b3a0d 0%, #a05a20 100%);
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-icon { font-size: 1.4rem; }

.current-winner-display {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--border);
}

.current-winner-display h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 1.25rem;
}

.winner-detail-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.winner-detail-card p {
  margin: 0.4rem 0;
  display: flex;
  gap: 0.5rem;
}

.winner-detail-card strong {
  color: var(--text-muted);
  min-width: 100px;
  font-weight: 600;
}

.photo-upload-section {
  margin-top: 1rem;
}

.photo-upload-section h4 {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.photo-upload-section input[type="file"] {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  margin-bottom: 0.75rem;
  display: block;
}

.upload-btn {
  padding: 0.6rem 1.5rem;
  background: var(--gold);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.upload-btn:hover {
  background: var(--gold-dark);
}

/* =============================================
   ইনার ট্যাব (আগের বিজয়ীরা)
   ============================================= */
.tabs-inner {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.inner-tab {
  padding: 0.65rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
}

.inner-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.inner-tab:hover {
  color: var(--primary);
}

.section-controls {
  margin-bottom: 1.25rem;
}

.add-btn {
  padding: 0.65rem 1.25rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.add-btn:hover {
  background: var(--primary-dark);
}

/* বিজয়ীদের ম্যানেজ লিস্ট */
.winners-manage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.winner-manage-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
}

.winner-manage-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-light);
  margin-bottom: 0.75rem;
}

.winner-manage-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}

.winner-manage-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.15rem 0;
}

.winner-current-badge {
  display: inline-block;
  background: var(--success);
  color: white;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.winner-manage-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.85rem;
}

.edit-btn {
  padding: 0.35rem 0.75rem;
  background: rgba(13, 92, 58, 0.1);
  color: var(--primary);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(13, 92, 58, 0.2);
  transition: var(--transition);
}

.edit-btn:hover {
  background: var(--primary);
  color: white;
}

/* =============================================
   ডুপ্লিকেট অনুরোধ
   ============================================= */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.5rem 1rem;
  background: white;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active:hover {
  color: white;
}

.disputes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dispute-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-right: 4px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.dispute-card.pending { border-right-color: var(--warning); }
.dispute-card.approved { border-right-color: var(--success); }
.dispute-card.rejected { border-right-color: var(--danger); }

.dispute-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.dispute-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.2rem 0;
}

.dispute-status {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pending { background: #fef3c7; color: var(--warning); }
.status-approved { background: #dcfce7; color: var(--success); }
.status-rejected { background: #fee2e2; color: var(--danger); }

.dispute-review-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.dispute-review-btn:hover {
  background: var(--primary-dark);
}

/* পর্যালোচনা মডালের কন্টেন্ট */
.dispute-review-content {
  padding: 1.5rem;
}

.dispute-review-photo {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.dispute-review-info {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.dispute-review-info p {
  font-size: 0.9rem;
  margin: 0.3rem 0;
  display: flex;
  gap: 0.5rem;
}

.dispute-review-info strong {
  min-width: 120px;
  color: var(--text-muted);
}

.dispute-actions {
  padding: 0 1.5rem 1.5rem;
}

.dispute-btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.approve-btn {
  flex: 1;
  padding: 0.75rem;
  background: var(--success);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.approve-btn:hover {
  background: #276749;
}

.reject-btn {
  flex: 1;
  padding: 0.75rem;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.reject-btn:hover {
  background: #c53030;
}

/* =============================================
   পুরস্কার সেটিংস
   ============================================= */
.prizes-form-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 700px;
}

.prize-note {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: #92400e;
  margin-bottom: 1.5rem;
}

.prizes-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.75rem;
}

.prize-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.prize-row input {
  padding: 0.6rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: var(--transition);
}

.prize-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 92, 58, 0.1);
}

.frequency-total {
  background: var(--bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin: 1rem 0;
  color: var(--text);
}

.freq-warning {
  color: var(--danger);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.save-btn {
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.save-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 4px 15px rgba(13, 92, 58, 0.3);
}

.save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =============================================
   মডাল (সাধারণ)
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-container {
  background: white;
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: sticky;
  top: 0.75rem;
  float: right;
  margin: 0.75rem 0.75rem 0 0;
  width: 34px;
  height: 34px;
  background: var(--bg);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
}

.modal-close:hover { background: #fee; color: var(--danger); }

.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
  clear: both;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.winner-form {
  padding: 1.5rem 1.75rem 2rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.required { color: var(--danger); }

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(13, 92, 58, 0.08);
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-left: 0.5rem;
}

.form-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 0.9rem;
}

/* নিশ্চিতকরণ ডায়ালগ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.confirm-box {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  text-align: center;
}

.confirm-box p {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.confirm-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-yes {
  padding: 0.65rem 1.5rem;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: var(--transition);
}

.confirm-yes:hover { background: #c53030; }

.confirm-no {
  padding: 0.65rem 1.5rem;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
}

.confirm-no:hover { border-color: var(--primary); color: var(--primary); }

/* সাফল্য/ত্রুটি টোস্ট */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 9999;
  animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
  max-width: 350px;
}

.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.warning { background: var(--warning); color: white; }
.toast.info { background: var(--primary); color: white; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* বাটন টেক্সট + স্পিনার */
.btn-text { display: inline; }
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* খালি তালিকা বার্তা */
.empty-msg {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  background: white;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
}

.empty-msg-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* =============================================
   রেসপন্সিভ
   ============================================= */
@media (max-width: 900px) {
  :root { --sidebar-width: 220px; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 200;
  }

  .sidebar-header { display: none; }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    padding: 0;
    overflow-x: auto;
    width: 100%;
  }

  .nav-item {
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    gap: 0.2rem;
    font-size: 0.7rem;
    border-right: none;
    border-top: 3px solid transparent;
    min-width: 60px;
    text-align: center;
  }

  .nav-item.active {
    border-top-color: var(--gold);
    border-right: none;
  }

  .nav-text { font-size: 0.7rem; }
  .nav-icon { font-size: 1.1rem; width: auto; }
  .nav-badge { display: none; }

  /* মোবাইলে লগআউট বাটন — উপরে টপ বারে দেখান */
  .sidebar-footer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 201;
    background: var(--primary-dark);
    padding: 0.5rem 1rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-top: none;
  }

  .sidebar-footer .public-link { order: 1; }
  .sidebar-footer .logout-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    order: 2;
  }

  .admin-main {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(3.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .prizes-table-header, .prize-row { grid-template-columns: 1fr; }

  /* Toast — বটম নেভের উপরে */
  .toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.4rem; }
}
