/* =====================================================
   OSHO NAGAR COLONY MANAGEMENT SYSTEM
   Custom Stylesheet
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
  --primary:     #1a56db;
  --primary-dark:#1342b0;
  --secondary:   #16a34a;
  --accent:      #f59e0b;
  --danger:      #dc2626;
  --dark:        #111827;
  --gray:        #6b7280;
  --light-bg:    #f3f4f6;
  --card-bg:     #ffffff;
  --border:      #e5e7eb;
  --sidebar-bg:  #0f172a;
  --sidebar-text:#cbd5e1;
  --sidebar-hover:#1e293b;
  --sidebar-active:#1a56db;
}

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

body {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  background: var(--light-bg);
  color: var(--dark);
  font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: all 0.3s;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h5 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.sidebar-brand small {
  color: var(--accent);
  font-size: 11px;
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-section-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}

.sidebar-link.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}

.sidebar-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  transition: all 0.3s;
}

/* ===== TOPBAR ===== */
.topbar {
  background: #fff;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-icon {
  position: relative;
  cursor: pointer;
  color: var(--gray);
  font-size: 20px;
  transition: color 0.2s;
}

.topbar-icon:hover { color: var(--primary); }

.notif-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ===== CONTENT AREA ===== */
.content-area {
  padding: 24px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border-radius: 12px 12px 0 0;
}

.card-header h5, .card-header h6 {
  font-weight: 600;
  margin: 0;
  font-size: 15px;
}

.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stat-card {
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: none;
}

.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
  font-weight: 500;
}

.stat-card .stat-change {
  font-size: 11px;
  margin-top: 8px;
  opacity: 0.8;
}

.stat-blue   { background: linear-gradient(135deg,#1a56db,#3b82f6); color:#fff; }
.stat-green  { background: linear-gradient(135deg,#16a34a,#22c55e); color:#fff; }
.stat-orange { background: linear-gradient(135deg,#d97706,#f59e0b); color:#fff; }
.stat-red    { background: linear-gradient(135deg,#dc2626,#ef4444); color:#fff; }
.stat-purple { background: linear-gradient(135deg,#7c3aed,#a78bfa); color:#fff; }
.stat-teal   { background: linear-gradient(135deg,#0d9488,#14b8a6); color:#fff; }

/* ===== TABLES ===== */
.table-custom thead th {
  background: var(--light-bg);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  border: none;
  padding: 12px 16px;
}

.table-custom tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-color: var(--border);
  font-size: 13px;
}

.table-custom tbody tr:hover { background: #f8faff; }

/* ===== FORMS ===== */
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  transition: all 0.2s;
  font-family: inherit;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* ===== BUTTONS ===== */
.btn {
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 16px;
  font-family: inherit;
  transition: all 0.2s;
}

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

.btn-success { background: var(--secondary); border-color: var(--secondary); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== BADGES ===== */
.badge { font-size: 11px; padding: 4px 8px; border-radius: 6px; font-weight: 500; }

/* ===== ALERTS ===== */
.alert { border-radius: 10px; font-size: 13px; border: none; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #eff6ff; color: #1e40af; }

/* ===== NOTICE CARDS ===== */
.notice-card {
  border-left: 4px solid var(--primary);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 0 10px 10px 0;
  background: #fff;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.notice-card.urgent { border-left-color: var(--danger); }
.notice-card.high   { border-left-color: var(--accent); }

/* ===== EVENT CARDS ===== */
.event-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.event-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.event-date-box {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.event-date-box .day { font-size: 22px; line-height: 1; }
.event-date-box .month { font-size: 10px; text-transform: uppercase; }

/* ===== EMERGENCY CARDS ===== */
.emergency-card {
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.emergency-card:hover {
  transform: scale(1.03);
  border-color: currentColor;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.emergency-card .ec-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 10px;
}

/* ===== COMPLAINT TIMELINE ===== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute;
  left: -26px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: #fff;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  color: #fff;
}

/* ===== AVATAR ===== */
.member-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    overflow: hidden;
  }

  .sidebar.mobile-open {
    width: 260px;
  }

  .main-wrapper {
    margin-left: 0;
  }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 24px;
}

.page-header h4 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.page-header p {
  color: var(--gray);
  margin: 4px 0 0;
  font-size: 13px;
}

/* ===== HERO BANNER ===== */
.hero-banner {
  background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
  color: #fff;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '🏘️';
  position: absolute;
  right: 20px;
  bottom: -10px;
  font-size: 80px;
  opacity: 0.2;
}

/* ===== SIDEBAR TOGGLE ===== */
.toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--dark);
}

@media (max-width: 768px) {
  .toggle-btn { display: block; }
}
