/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0d1b4b;
  --navy2:  #1a2e6e;
  --saffron:#e67e22;
  --gold:   #f0a500;
  --green:  #1b7a3e;
  --green2: #27ae60;
  --white:  #ffffff;
  --light:  #f4f6fb;
  --grey:   #6c757d;
  --border: #dde3f0;
  --shadow: 0 4px 24px rgba(13,27,75,0.10);
  --radius: 12px;
}

body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--light); color: #222; min-height: 100vh; }

a { text-decoration: none; color: inherit; }

/* ===== HEADER / NAV ===== */
.site-header {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy2) 100%);
  color: var(--white);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  position: sticky; top: 0; z-index: 100;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; }
.site-header .brand img { height: 40px; }
.site-header .brand-text h1 { font-size: 1.18rem; font-weight: 700; letter-spacing: .5px; }
.site-header .brand-text p  { font-size: .72rem; opacity: .75; letter-spacing: .3px; }
.site-header nav a {
  color: #ccd6f6; font-size: .9rem; padding: 6px 14px; border-radius: 6px;
  transition: background .2s, color .2s;
}
.site-header nav a:hover, .site-header nav a.active { background: rgba(255,255,255,.13); color: #fff; }
.header-actions { display: flex; gap: 10px; }

/* ===== TRICOLOR STRIP ===== */
.tricolor { height: 4px; background: linear-gradient(90deg, #FF9933 33%, #fff 33% 66%, #138808 66%); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 24px; border-radius: 7px; font-size: .93rem;
  font-weight: 600; cursor: pointer; border: none; transition: all .2s;
}
.btn-primary   { background: var(--saffron); color: #fff; }
.btn-primary:hover { background: #cf6d17; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(230,126,34,.35); }
.btn-outline   { background: transparent; border: 2px solid var(--white); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-navy      { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy2); }
.btn-green     { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green2); }
.btn-sm        { padding: 7px 16px; font-size: .83rem; }
.btn-block     { width: 100%; justify-content: center; }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a8f 60%, #1b7a3e 100%);
  color: var(--white);
  padding: 80px 2rem 70px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); padding: 5px 16px; border-radius: 20px; font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 20px; }
.hero h2 { font-size: 2.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero h2 span { color: var(--gold); }
.hero p { font-size: 1.1rem; opacity: .85; max-width: 600px; margin: 0 auto 32px; line-height: 1.7; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin-top: 50px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.15); }
.hero-stat h3 { font-size: 2rem; font-weight: 800; color: var(--gold); }
.hero-stat p  { font-size: .82rem; opacity: .7; }

/* ===== SECTION ===== */
.section { padding: 60px 2rem; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.section-title p  { color: var(--grey); margin-top: 8px; font-size: .97rem; }
.section-title .divider { width: 50px; height: 4px; background: var(--saffron); border-radius: 2px; margin: 12px auto 0; }

/* ===== CARDS ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; max-width: 1200px; margin: 0 auto; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(13,27,75,.14); }

.card-header {
  padding: 20px 22px 16px;
  display: flex; align-items: center; gap: 14px;
}
.card-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.icon-blue   { background: #e8eeff; }
.icon-green  { background: #e6f7ed; }
.icon-orange { background: #fff4e6; }
.icon-purple { background: #f0e8ff; }
.icon-red    { background: #ffe8e8; }
.icon-teal   { background: #e0f7f7; }

.card-header h3 { font-size: 1.03rem; font-weight: 700; color: var(--navy); }
.card-header p  { font-size: .8rem; color: var(--grey); margin-top: 2px; }

.card-body { padding: 0 22px 20px; }
.card-body p { font-size: .88rem; color: #444; line-height: 1.65; }

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--light);
}
.card-badge { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-green  { background: #e6f7ed; color: var(--green); }
.badge-blue   { background: #e8eeff; color: var(--navy2); }
.badge-orange { background: #fff4e6; color: var(--saffron); }

/* ===== SCHEME CARD (admin/dashboard full) ===== */
.scheme-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.scheme-card-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; }
.scheme-card-head h3 { font-size: 1rem; font-weight: 700; }
.scheme-card-body { padding: 18px 20px; }
.scheme-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.scheme-meta-item { font-size: .82rem; color: #555; }
.scheme-meta-item strong { color: var(--navy); }

/* ===== FORM STYLES ===== */
.form-page {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  background: linear-gradient(135deg, rgba(13, 27, 75, 0.90) 0%, rgba(26, 46, 110, 0.90) 60%, rgba(27, 122, 62, 0.90) 100%), url('../images/schemes_collage.png') no-repeat center center fixed;
  background-size: cover;
}
.form-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 100%; max-width: 450px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.form-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
}
.form-card-header {
  background: linear-gradient(135deg, rgba(13, 27, 75, 0.95), rgba(26, 46, 110, 0.95));
  color: var(--white);
  padding: 28px 32px 24px;
  text-align: center;
}
.form-card-header .form-icon { font-size: 2.5rem; margin-bottom: 10px; }
.form-card-header h2 { font-size: 1.4rem; font-weight: 800; }
.form-card-header p  { font-size: .85rem; opacity: .75; margin-top: 4px; }
.form-card-body { padding: 28px 32px 32px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: #333; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .93rem; transition: border .2s, box-shadow .2s;
  background: #fafbff; color: #222;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(26,46,110,.1);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .78rem; color: var(--grey); margin-top: 5px; }
.form-divider { text-align: center; margin: 18px 0; color: var(--grey); font-size: .85rem; position: relative; }
.form-divider::before, .form-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.form-divider::before { left: 0; } .form-divider::after { right: 0; }
.form-footer { text-align: center; margin-top: 20px; font-size: .88rem; color: var(--grey); }
.form-footer a { color: var(--navy2); font-weight: 600; }
.form-footer a:hover { text-decoration: underline; }

.alert { padding: 11px 16px; border-radius: 8px; font-size: .88rem; margin-bottom: 16px; display: none; }
.alert-error   { background: #ffe8e8; color: #c0392b; border: 1px solid #f5c6c6; }
.alert-success { background: #e6f7ed; color: var(--green); border: 1px solid #b7dfc5; }
.alert-info    { background: #e8eeff; color: var(--navy2); border: 1px solid #c0ccee; }

/* ===== REFERRAL BOX ===== */
.referral-box {
  background: linear-gradient(135deg, #fff8e6, #fff3d0);
  border: 1.5px dashed var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: .85rem;
  color: #7a5800;
}
.referral-box strong { display: block; margin-bottom: 4px; font-size: .9rem; }

/* ===== DASHBOARD LAYOUT ===== */
.dash-layout { display: flex; min-height: calc(100vh - 64px); }
.dash-sidebar {
  width: 240px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy) 0%, #12245e 100%);
  color: var(--white);
  padding: 24px 0;
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
}
.dash-sidebar .user-info { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.dash-sidebar .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--saffron); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.dash-sidebar .user-name { font-size: .95rem; font-weight: 700; }
.dash-sidebar .user-dept { font-size: .75rem; opacity: .65; }
.dash-sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 20px; font-size: .9rem; color: rgba(255,255,255,.7);
  transition: background .18s, color .18s;
}
.dash-sidebar nav a:hover, .dash-sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.dash-sidebar nav a .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.dash-sidebar .sidebar-section { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.35); padding: 14px 20px 6px; }

.dash-main { flex: 1; padding: 30px 28px; background: var(--light); overflow-y: auto; }
.dash-main h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.dash-main .page-subtitle { color: var(--grey); font-size: .9rem; margin-bottom: 28px; }

/* ===== STATS ROW ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-box { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.stat-box h3 { font-size: 1.4rem; font-weight: 800; color: var(--navy); }
.stat-box p  { font-size: .78rem; color: var(--grey); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; background: var(--white); padding: 6px; border-radius: 10px; box-shadow: var(--shadow); }
.tab-btn {
  padding: 9px 18px; border-radius: 8px; font-size: .87rem; font-weight: 600;
  border: none; cursor: pointer; background: transparent; color: var(--grey);
  transition: all .18s;
}
.tab-btn.active, .tab-btn:hover { background: var(--navy); color: #fff; }

/* ===== TABLE ===== */
.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; }
th { padding: 13px 16px; text-align: left; font-size: .82rem; font-weight: 700; letter-spacing: .4px; }
td { padding: 12px 16px; font-size: .87rem; color: #333; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9faff; }

/* ===== ADMIN PANEL ===== */
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; }
.admin-topbar h2 { font-size: 1.05rem; font-weight: 700; color: var(--navy); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 999; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px; background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; display: flex; align-items: center; justify-content: space-between; border-radius: 16px 16px 0 0; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; opacity: .7; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 24px; }

/* ===== FOOTER ===== */
.site-footer { background: var(--navy); color: rgba(255,255,255,.65); text-align: center; padding: 22px; font-size: .82rem; margin-top: auto; }
.site-footer a { color: var(--gold); }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.tag-green  { background: #e6f7ed; color: #1b7a3e; }
.tag-orange { background: #fff4e6; color: #c06010; }
.tag-blue   { background: #e8eeff; color: #1a2e6e; }
.tag-red    { background: #ffe8e8; color: #c0392b; }

/* ===== WELCOME BANNER ===== */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.welcome-banner h2 { font-size: 1.3rem; font-weight: 800; }
.welcome-banner p  { font-size: .88rem; opacity: .8; margin-top: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h2 { font-size: 1.8rem; }
  .hero-stats { gap: 22px; }
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; height: auto; position: relative; top: 0; }
  .dash-main { padding: 20px 14px; }
  .form-card-body { padding: 20px 20px 24px; }
  .site-header .brand-text p { display: none; }
}
