/* ===== RishtayDekho Admin Panel — Professional CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --green-900: #0D3B24;
  --green-800: #145A35;
  --green-700: #1B6B3A;
  --green-600: #217A42;
  --green-500: #2E8B57;
  --green-400: #3DAA6A;
  --green-100: #E8F5EE;
  --green-50:  #F0FAF4;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --white: #FFFFFF;
  --bg: #F4F7F6;
  --card: #FFFFFF;
  --border: #E2EAE6;
  --text: #1A2E22;
  --text-muted: #6B7F74;
  --text-light: #9AAFAB;
  --danger: #E53935;
  --warning: #F59E0B;
  --info: #3B82F6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
.hidden { display: none !important; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; background: var(--green-900);
}
.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(27,107,58,0.6) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(21,90,53,0.4) 0%, transparent 50%);
}
.login-bg::before, .login-bg::after {
  content: '🌙'; position: absolute; font-size: 200px; opacity: 0.03;
}
.login-bg::before { top: -20px; right: -40px; transform: rotate(-20deg); }
.login-bg::after { bottom: -40px; left: -20px; transform: rotate(30deg); }

.login-card {
  position: relative; z-index: 1; background: var(--white); border-radius: 20px;
  padding: 48px 44px; width: 440px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.3); animation: slideUp 0.5s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(24px); } to { opacity:1; transform: none; } }

.login-logo { text-align: center; margin-bottom: 36px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; display: block; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--green-700); letter-spacing: -0.5px; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.input-icon-wrap input { width: 100%; padding: 13px 16px 13px 42px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition); background: var(--bg); }
.input-icon-wrap input:focus { border-color: var(--green-500); background: var(--white); box-shadow: 0 0 0 3px rgba(46,139,87,0.12); }
.pwd-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; font-size: 16px; padding: 4px; }

.login-error { background: #FEE2E2; color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }

.btn-login {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: white; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition); margin-top: 8px;
}
.btn-login:hover { background: linear-gradient(135deg, var(--green-800), var(--green-600)); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(27,107,58,0.35); }
.btn-arrow { font-size: 18px; transition: transform 0.2s; }
.btn-login:hover .btn-arrow { transform: translateX(4px); }
.login-footer { text-align: center; color: var(--text-light); font-size: 12px; margin-top: 28px; }

/* ===== ADMIN SHELL ===== */
.admin-shell { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w); background: var(--green-900); color: white;
  display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto;
  transition: transform 0.3s ease; position: relative; z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-logo {
  display: flex; align-items: center; justify-content: space-between; padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo-icon { font-size: 28px; }
.sidebar-logo-text { font-size: 16px; font-weight: 700; display: block; }
.sidebar-logo-sub { font-size: 11px; color: rgba(255,255,255,0.5); display: block; }
.sidebar-close-btn { display: none; }

.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: rgba(255,255,255,0.35); padding: 16px 20px 8px; text-transform: uppercase; }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px;
  margin: 2px 8px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  color: rgba(255,255,255,0.7); cursor: pointer; position: relative;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: var(--green-700); color: white; box-shadow: 0 2px 12px rgba(27,107,58,0.5); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge { background: #FF5252; color: white; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; margin-left: auto; }

.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 12px;
}
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: white; flex-shrink: 0; }
.admin-profile-mini { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.admin-name-mini { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role-mini { font-size: 11px; color: rgba(255,255,255,0.5); }
.btn-logout { background: rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; font-size: 16px; transition: var(--transition); flex-shrink: 0; }
.btn-logout:hover { background: rgba(239,68,68,0.3); }

/* ===== MAIN AREA ===== */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h); background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0; box-shadow: var(--shadow-sm);
  position: relative; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { background: none; font-size: 20px; color: var(--text-muted); padding: 4px 8px; border-radius: 8px; transition: var(--transition); border: none; cursor: pointer; }
.sidebar-toggle:hover { background: var(--bg); color: var(--green-700); }
.breadcrumb { font-size: 16px; font-weight: 600; color: var(--text); }

/* Mobile Brand Header */
.mobile-brand { display: flex; align-items: center; gap: 10px; }
.mobile-brand-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(13,59,36,0.25);
}
.mobile-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-size: 15px; font-weight: 800; color: var(--green-900); letter-spacing: -0.3px; }
.breadcrumb-sub { font-size: 11px; font-weight: 600; color: var(--green-700); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-time { font-size: 12px; color: var(--text-muted); }
.admin-profile-top { display: flex; align-items: center; gap: 10px; }
.admin-avatar-top { width: 36px; height: 36px; border-radius: 50%; background: var(--green-700); color: white; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ===== PAGE CONTENT ===== */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-track { background: var(--bg); }
.page-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.page-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: gap; gap: 16px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; transition: var(--transition);
  animation: fadeIn 0.4s ease; min-height: 92px; height: 100%;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card > div:last-child { flex: 1; min-width: 0; }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.green { background: var(--green-50); }
.stat-icon.blue { background: #EFF6FF; }
.stat-icon.orange { background: #FFF7ED; }
.stat-icon.purple { background: #F5F3FF; }
.stat-icon.red { background: #FEF2F2; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.1; word-break: break-word; overflow-wrap: anywhere; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; line-height: 1.25; word-break: break-word; }
.stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up { color: var(--green-500); }
.stat-change.down { color: var(--danger); }

/* ===== CARDS ===== */
.card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; }
.btn-primary { background: var(--green-700); color: white; }
.btn-primary:hover { background: var(--green-800); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27,107,58,0.3); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #FEE2E2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ===== TABLE ===== */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
table th { background: var(--bg); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 12px 16px; text-align: left; white-space: nowrap; }
table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table tbody tr { transition: background 0.1s; }
table tbody tr:hover { background: var(--green-50); }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* ===== SEARCH BAR ===== */
.search-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; width: 100%; }
.search-input { padding: 9px 14px 9px 38px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; background: var(--white); width: 100%; transition: var(--transition); position: relative; }
.search-wrap { position: relative; flex: 1 1 220px; }
.search-wrap::before { content: '\f002'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); pointer-events: none; z-index: 1; }
.search-input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(46,139,87,0.1); }
.filter-select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; background: var(--white); flex: 0 1 auto; }

/* ===== BADGES / STATUS ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-active { background: #DCFCE7; color: #166534; }
.badge-pending { background: #FEF9C3; color: #854D0E; }
.badge-suspended { background: #FEE2E2; color: #991B1B; }
.badge-blocked { background: #F3F4F6; color: #374151; }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-blue { background: #EFF6FF; color: #1D4ED8; }
.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge-gray { background: #F3F4F6; color: #6B7280; }
.badge-verified { background: #DCFCE7; color: #166534; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ===== FORM STYLES ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-inline { display: flex; flex-direction: column; gap: 6px; }
.form-group-inline label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; transition: var(--transition); background: var(--white); }
.form-input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(46,139,87,0.1); }
.form-select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; background: var(--white); }
.form-textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; resize: vertical; min-height: 80px; transition: var(--transition); }
.form-textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(46,139,87,0.1); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-full { grid-column: 1 / -1; }

/* ===== TOGGLE ===== */
.toggle-wrap { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 12px; }
.toggle-info { flex: 1; }
.toggle-label { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #CBD5E1; border-radius: 24px; transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; left: 3px; top: 3px; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
input:checked + .toggle-slider { background: var(--green-600); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; animation: fadeIn 0.2s ease; }
.modal-box { background: var(--white); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: scaleIn 0.25s ease; }
@keyframes scaleIn { from { opacity:0; transform: scale(0.92); } to { opacity:1; transform: none; } }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--white); z-index: 1; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--text-muted); font-size: 16px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--border); }
.modal-body { padding: 24px; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; background: var(--text); color: white; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease; min-width: 280px; max-width: 380px; }
.toast.success { background: var(--green-700); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1A1A1A; }
@keyframes toastIn { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform: none; } }
@keyframes toastOut { from { opacity:1; transform: none; } to { opacity:0; transform: translateX(100%); } }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }
.pagination-btn { padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--white); color: var(--text); font-size: 13px; transition: var(--transition); }
.pagination-btn:hover { border-color: var(--green-500); color: var(--green-700); }
.pagination-btn.active { background: var(--green-700); border-color: var(--green-700); color: white; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info { font-size: 12px; color: var(--text-muted); }

/* ===== AVATAR ===== */
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; object-fit: cover; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.empty-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ===== PLAN CARD ===== */
#plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan-card { background: var(--white); border-radius: var(--radius); padding: 24px; border: 2px solid var(--border); transition: var(--transition); position: relative; display: flex; flex-direction: column; }
.plan-card:hover { border-color: var(--green-500); box-shadow: var(--shadow); }
.plan-card.popular { border-color: var(--green-600); }
.plan-popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--green-700); color: white; font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 100px; }
.plan-name { font-size: 18px; font-weight: 700; color: var(--text); }
.plan-price { font-size: 32px; font-weight: 800; color: var(--green-700); margin: 12px 0 4px; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; margin: 16px 0; }
.plan-features li { padding: 6px 0; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.plan-features li:last-child { border: none; }
.plan-features li::before { content: '✓'; color: var(--green-600); font-weight: 700; }

/* ===== TICKET ===== */
.ticket-item { padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; transition: var(--transition); background: var(--white); }
.ticket-item:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.ticket-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }

/* ===== LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--green-600); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-in { animation: fadeIn 0.3s ease; }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; width: 100%; max-width: 100%; min-height: 240px; max-height: 360px; overflow: hidden; }
.chart-container canvas { width: 100% !important; max-width: 100% !important; height: 100% !important; }

/* =============================================================================
   RESPONSIVE BREAKPOINT SYSTEM
   Desktop: 1024px+ | Tablet: 768px-1023px | Mobile: 480px-767px | Small Mobile: <480px
   ============================================================================= */

/* Desktop Specific (>= 1024px) */
@media (min-width: 1024px) {
  .sidebar-toggle { display: none; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* Large Screens (>= 1280px) */
@media (min-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet & Mobile (< 1024px) */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; right: -100%; left: auto; width: min(82vw, 320px); max-width: 320px;
    height: 100dvh; z-index: 100; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0,0,0,0.25); overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .sidebar.open { right: 0; left: auto; }
  .sidebar-close-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 22px; color: rgba(255,255,255,0.7); background: none; border: none; cursor: pointer; border-radius: 8px; }
  .sidebar-close-btn:hover { color: white; background: rgba(255,255,255,0.1); }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 99; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
  .page-content { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  #plans-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Standard Mobile & Small Tablet (< 768px) */
@media (max-width: 767px) {
  .topbar { padding: 0 16px; }
  .topbar-time { display: none; }
  #admin-name-top { display: none; }
  .admin-profile-top { gap: 6px; }
  .breadcrumb { font-size: 14px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-content { padding: 12px; }
  .card { padding: 14px; margin-bottom: 16px; max-width: 100%; overflow: hidden; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header .btn { width: 100%; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  #plans-grid { grid-template-columns: 1fr; }
  .search-wrap { flex: 1 1 100%; }
  .filter-select { flex: 1 1 100%; width: 100%; }
  .search-bar .btn { width: 100%; justify-content: center; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-header .btn { width: 100%; justify-content: center; }
  .form-actions { flex-direction: column-reverse; gap: 8px; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .table-actions { flex-wrap: wrap; }
  .table-actions .btn { padding: 8px 12px; min-height: 38px; }
  .pagination { justify-content: center; gap: 6px; }
  .modal-overlay { padding: 12px; }
  .modal-box { max-height: 94vh; }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 16px 20px; }
  .chart-container { min-height: 200px; max-height: 280px; }

  /* Mobile Table-to-Card Transformation */
  .table-wrap { border: none; overflow-x: visible; margin-bottom: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
  .table-wrap thead { display: none !important; }
  .table-wrap tbody tr {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
  }
  .table-wrap tbody tr:last-child { margin-bottom: 0; }
  .table-wrap tbody tr:hover { background: var(--white); }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg);
    font-size: 13px;
    text-align: right;
    word-break: break-word;
  }
  .table-wrap td:last-child { border-bottom: none; }
  .table-wrap td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 12px;
    text-align: left;
    flex-shrink: 0;
  }
}

/* ===== MOBILE DATA CARDS ===== */
.data-card-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.data-card { background: var(--white); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; transition: var(--transition); }
.data-card:hover { border-color: var(--green-400); box-shadow: var(--shadow); }
.data-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.data-card-body { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.data-card-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
  .topbar { padding: 0 10px; height: 56px; }
  .page-content { padding: 10px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 10px; }
  .stat-value { font-size: 22px; }
  .card { padding: 12px; margin-bottom: 12px; }
  .breadcrumb { font-size: 13px; max-width: 110px; }
  .login-card { padding: 32px 20px; border-radius: 16px; }
  .nav-item { min-height: 44px; }
  .pagination-info { flex: 1 1 100%; text-align: center; margin-bottom: 4px; }
  .pagination-btn { padding: 6px 10px; font-size: 12px; min-height: 38px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 90vh; animation: slideUpSheet 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
  @keyframes slideUpSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .modal-body { padding: 20px 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .form-input, .form-select, .btn { min-height: 44px; }
/* ===== MOBILE BOTTOM NAVIGATION BAR ===== */
.mobile-bottom-nav { display: none; }

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 990;
    height: 60px;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding: 6px 0;
  }
  .mobile-nav-item i {
    font-size: 17px;
    transition: var(--transition);
  }
  .mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--green-600);
    font-weight: 600;
  }
  .mobile-nav-item.active i {
    transform: translateY(-1px);
  }
  .page-content {
    padding-bottom: max(76px, env(safe-area-inset-bottom)) !important;
  }
}

