/* ===== FADL GRANTS PORTAL - MAIN CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #1a6b3a;
  --primary-dark: #145530;
  --primary-light: #e8f5ee;
  --secondary: #d4a017;
  --secondary-dark: #b8880f;
  --accent: #2ecc71;
  --text-dark: #1a1a2e;
  --text-medium: #4a5568;
  --text-light: #718096;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 20px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all .3s ease;
}

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

body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
  background: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.7;
}

/* ===== PRELOADER ===== */
#preloader {
  position: fixed; inset: 0; background: var(--primary); z-index: 9999;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  transition: opacity .5s ease;
}
#preloader .logo-text { color: #fff; font-size: 1.5rem; font-weight: 700; margin-top: 1rem; }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOPBAR ===== */
.top-bar { background: var(--primary-dark); color: rgba(255,255,255,.85); font-size: .8rem; padding: .4rem 0; }
.top-bar a { color: rgba(255,255,255,.85); text-decoration: none; }
.top-bar a:hover { color: var(--secondary); }
.top-bar .social-links a { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.1); transition: var(--transition); }
.top-bar .social-links a:hover { background: var(--secondary); color: #fff; }

/* ===== NAVBAR ===== */
.navbar { background: var(--bg-white) !important; box-shadow: var(--shadow-sm); padding: .8rem 0; position: sticky; top: 0; z-index: 1000; transition: var(--transition); }
.navbar.scrolled { box-shadow: var(--shadow); }
.navbar-brand { font-size: 1.3rem; font-weight: 800; color: var(--primary) !important; display: flex; align-items: center; gap: .6rem; }
.navbar-brand img { height: 44px; width: 44px; object-fit: contain; }
.navbar-brand span { line-height: 1.2; }
.navbar-brand small { font-size: .7rem; font-weight: 400; color: var(--text-light); display: block; }
.nav-link { color: var(--text-dark) !important; font-weight: 500; padding: .5rem .9rem !important; border-radius: var(--radius-sm); transition: var(--transition); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--primary) !important; background: var(--primary-light); }
.dropdown-menu { border: none; box-shadow: var(--shadow); border-radius: var(--radius); padding: .5rem; }
.dropdown-item { border-radius: var(--radius-sm); padding: .5rem 1rem; color: var(--text-dark); font-size: .9rem; }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.navbar-search .form-control { border-radius: 20px 0 0 20px; border-color: var(--border); font-size: .85rem; }
.navbar-search .btn { border-radius: 0 20px 20px 0; background: var(--primary); border: none; color: #fff; }
.nav-cta { background: var(--primary) !important; color: #fff !important; border-radius: 25px !important; padding: .5rem 1.4rem !important; }
.nav-cta:hover { background: var(--primary-dark) !important; }

/* ===== HERO ===== */
.hero-section { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #1e8449 100%); min-height: 85vh; display: flex; align-items: center; position: relative; overflow: hidden; }
.hero-section::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-bg-circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,.05); }
.hero-bg-circle:nth-child(1) { width: 600px; height: 600px; top: -200px; left: -200px; }
.hero-bg-circle:nth-child(2) { width: 400px; height: 400px; bottom: -100px; right: -100px; }
.hero-content { position: relative; z-index: 1; }
.hero-badge { background: rgba(255,255,255,.15); backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255,255,255,.2); padding: .4rem 1.2rem; border-radius: 20px; font-size: .85rem; display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; }
.hero-title { font-size: 3rem; font-weight: 900; color: #fff; line-height: 1.3; margin-bottom: 1.2rem; }
.hero-title span { color: var(--secondary); }
.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,.8); margin-bottom: 2rem; max-width: 550px; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2rem; }
.hero-stat { text-align: center; }
.hero-stat .number { font-size: 2rem; font-weight: 800; color: var(--secondary); line-height: 1; }
.hero-stat .label { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: .2rem; }
.hero-search-box { background: #fff; border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-lg); }
.hero-search-box h5 { color: var(--primary); font-weight: 700; margin-bottom: 1rem; }
.hero-search-box .form-control, .hero-search-box .form-select { border: 2px solid var(--border); border-radius: var(--radius-sm); font-family: 'Cairo', sans-serif; padding: .65rem 1rem; }
.hero-search-box .form-control:focus, .hero-search-box .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,58,.1); }
.btn-search { background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); padding: .7rem 2rem; font-family: 'Cairo', sans-serif; font-weight: 600; width: 100%; transition: var(--transition); }
.btn-search:hover { background: var(--primary-dark); color: #fff; }

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-badge { background: var(--primary-light); color: var(--primary); font-size: .8rem; font-weight: 600; padding: .4rem 1.2rem; border-radius: 20px; display: inline-block; margin-bottom: .8rem; }
.section-title { font-size: 2rem; font-weight: 800; color: var(--text-dark); margin-bottom: .5rem; }
.section-subtitle { color: var(--text-light); font-size: 1rem; max-width: 550px; margin: 0 auto; }
.section-divider { width: 60px; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 2px; margin: 1rem auto 0; }

/* ===== CATEGORIES ===== */
.category-card { background: #fff; border-radius: var(--radius); padding: 1.5rem; text-align: center; transition: var(--transition); border: 2px solid transparent; cursor: pointer; text-decoration: none; display: block; color: var(--text-dark); height: 100%; }
.category-card:hover, .category-card.active { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-4px); color: var(--primary); }
.category-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 1rem; transition: var(--transition); }
.category-card:hover .category-icon { background: var(--primary); color: #fff; }
.category-name { font-weight: 700; font-size: .95rem; margin-bottom: .3rem; }
.category-count { font-size: .8rem; color: var(--text-light); }

/* ===== GRANT CARDS ===== */
.grant-card { background: #fff; border-radius: var(--radius); overflow: hidden; transition: var(--transition); border: 1px solid var(--border); height: 100%; display: flex; flex-direction: column; }
.grant-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: var(--primary); }
.grant-card-img { height: 180px; background: linear-gradient(135deg, var(--primary), #2ecc71); position: relative; overflow: hidden; }
.grant-card-img img { width: 100%; height: 100%; object-fit: cover; }
.grant-card-img .grant-badge { position: absolute; top: .8rem; right: .8rem; }
.grant-card-img .grant-deadline { position: absolute; bottom: .8rem; left: .8rem; background: rgba(0,0,0,.6); color: #fff; padding: .3rem .8rem; border-radius: 15px; font-size: .75rem; }
.grant-card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.grant-category { color: var(--primary); font-size: .78rem; font-weight: 600; margin-bottom: .4rem; }
.grant-title { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; color: var(--text-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grant-org { font-size: .85rem; color: var(--text-light); margin-bottom: .8rem; }
.grant-meta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--border); }
.grant-meta-item { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-medium); }
.grant-meta-item i { color: var(--primary); }
.badge-featured { background: var(--secondary); color: #fff; padding: .3rem .8rem; border-radius: 15px; font-size: .75rem; font-weight: 600; }
.badge-new { background: var(--accent); color: #fff; padding: .3rem .8rem; border-radius: 15px; font-size: .75rem; font-weight: 600; }
.grant-amount { background: var(--primary-light); color: var(--primary); padding: .2rem .7rem; border-radius: 10px; font-size: .78rem; font-weight: 600; }

/* ===== BUTTONS ===== */
.btn-primary-custom { background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); padding: .7rem 1.8rem; font-family: 'Cairo', sans-serif; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; gap: .5rem; }
.btn-primary-custom:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(26,107,58,.3); }
.btn-secondary-custom { background: var(--secondary); color: #fff; border: none; border-radius: var(--radius-sm); padding: .7rem 1.8rem; font-family: 'Cairo', sans-serif; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; gap: .5rem; }
.btn-secondary-custom:hover { background: var(--secondary-dark); color: #fff; }
.btn-outline-primary-custom { background: transparent; color: var(--primary); border: 2px solid var(--primary); border-radius: var(--radius-sm); padding: .65rem 1.8rem; font-family: 'Cairo', sans-serif; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; gap: .5rem; }
.btn-outline-primary-custom:hover { background: var(--primary); color: #fff; }

/* ===== STATS SECTION ===== */
.stats-section { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 4rem 0; }
.stat-item { text-align: center; }
.stat-number { font-size: 3rem; font-weight: 900; color: var(--secondary); line-height: 1; }
.stat-label { font-size: 1rem; color: rgba(255,255,255,.8); margin-top: .5rem; }

/* ===== GRANT DETAIL ===== */
.grant-detail-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 3rem 0; }
.grant-detail-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: .8rem; }
.grant-info-card { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 1.5rem; }
.grant-info-card h5 { color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary-light); padding-bottom: .7rem; margin-bottom: 1rem; }
.info-item { display: flex; align-items: flex-start; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--bg-light); }
.info-item:last-child { border-bottom: none; }
.info-item i { color: var(--primary); width: 18px; margin-top: .2rem; }
.info-item .label { font-size: .8rem; color: var(--text-light); }
.info-item .value { font-weight: 600; font-size: .9rem; }
.apply-btn-sidebar { background: var(--primary); color: #fff; border: none; border-radius: var(--radius); padding: 1rem; font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1.1rem; width: 100%; transition: var(--transition); margin-bottom: .8rem; }
.apply-btn-sidebar:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }
.share-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-btn { flex: 1; min-width: 80px; border: none; border-radius: var(--radius-sm); padding: .5rem; font-size: .8rem; font-family: 'Cairo', sans-serif; transition: var(--transition); color: #fff; cursor: pointer; }
.share-whatsapp { background: #25D366; }
.share-twitter { background: #1DA1F2; }
.share-facebook { background: #1877F2; }
.share-copy { background: var(--text-medium); }

/* ===== APPLICATION FORM ===== */
.apply-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 2.5rem 0; }
.steps-indicator { display: flex; align-items: center; justify-content: center; margin: 2rem 0; gap: 0; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-item:not(:last-child)::after { content: ''; position: absolute; top: 20px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.step-item.completed:not(:last-child)::after { background: var(--primary); }
.step-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--border); color: var(--text-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; position: relative; z-index: 1; transition: var(--transition); }
.step-item.active .step-circle { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(26,107,58,.2); }
.step-item.completed .step-circle { background: var(--primary); color: #fff; }
.step-label { font-size: .75rem; color: var(--text-light); margin-top: .4rem; text-align: center; font-weight: 600; }
.step-item.active .step-label { color: var(--primary); }
.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.form-card { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.form-card h4 { color: var(--primary); font-weight: 700; margin-bottom: 1.5rem; padding-bottom: .8rem; border-bottom: 2px solid var(--primary-light); }
.form-label { font-weight: 600; color: var(--text-dark); font-size: .9rem; }
.form-control, .form-select { border: 2px solid var(--border); border-radius: var(--radius-sm); font-family: 'Cairo', sans-serif; padding: .65rem 1rem; transition: var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,58,.1); outline: none; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; cursor: pointer; transition: var(--transition); background: var(--bg-light); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone i { font-size: 2rem; color: var(--primary); margin-bottom: .5rem; }
.upload-zone p { color: var(--text-light); font-size: .85rem; margin: 0; }
.btn-next, .btn-prev, .btn-submit { border-radius: var(--radius-sm); padding: .7rem 2rem; font-family: 'Cairo', sans-serif; font-weight: 600; transition: var(--transition); border: none; }
.btn-next, .btn-submit { background: var(--primary); color: #fff; }
.btn-next:hover, .btn-submit:hover { background: var(--primary-dark); }
.btn-prev { background: var(--bg-light); color: var(--text-dark); border: 2px solid var(--border); }
.btn-prev:hover { background: var(--border); }

/* ===== ADMIN LAYOUT ===== */
.admin-wrapper { display: flex; min-height: 100vh; direction: rtl; }
.admin-sidebar { width: 270px; background: var(--primary-dark); position: fixed; top: 0; right: 0; height: 100vh; overflow-y: auto; z-index: 1000; transition: var(--transition); }
.sidebar-brand { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand h5 { color: #fff; font-weight: 800; font-size: 1rem; margin: 0; }
.sidebar-brand small { color: rgba(255,255,255,.5); font-size: .75rem; }
.sidebar-menu { padding: 1rem 0; }
.sidebar-menu a { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.5rem; color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; font-weight: 500; transition: var(--transition); border-right: 3px solid transparent; }
.sidebar-menu a:hover, .sidebar-menu a.active { color: #fff; background: rgba(255,255,255,.08); border-right-color: var(--secondary); }
.sidebar-menu a i { width: 20px; text-align: center; }
.sidebar-menu .menu-group { padding: .5rem 1.5rem .3rem; font-size: .7rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-top: .5rem; }
.admin-content { margin-right: 270px; flex: 1; background: var(--bg-light); }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.admin-topbar h4 { font-weight: 700; color: var(--text-dark); margin: 0; font-size: 1.1rem; }
.admin-main { padding: 1.5rem; }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-dark); font-size: 1.3rem; cursor: pointer; }

/* ===== ADMIN CARDS ===== */
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; transition: var(--transition); }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card-icon { width: 60px; height: 60px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-card-icon.green { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.gold { background: #fef3c7; color: var(--secondary); }
.stat-card-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-card-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-card-body h3 { font-size: 2rem; font-weight: 800; color: var(--text-dark); line-height: 1; margin-bottom: .2rem; }
.stat-card-body p { color: var(--text-light); font-size: .85rem; margin: 0; }
.data-table { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.data-table-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.data-table-header h5 { font-weight: 700; margin: 0; color: var(--text-dark); }
.table { margin: 0; font-size: .88rem; }
.table thead th { background: var(--bg-light); color: var(--text-medium); font-weight: 600; border-bottom: 2px solid var(--border); padding: .8rem 1rem; white-space: nowrap; }
.table tbody td { padding: .8rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--bg-light); }
.table tbody tr:hover { background: var(--bg-light); }
.status-badge { padding: .3rem .8rem; border-radius: 15px; font-size: .75rem; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-review { background: #dbeafe; color: #1e40af; }
.status-active { background: #d1fae5; color: #065f46; }
.status-inactive { background: #f3f4f6; color: #6b7280; }
.action-btns { display: flex; gap: .4rem; }
.btn-sm-action { width: 30px; height: 30px; border: none; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: .8rem; cursor: pointer; transition: var(--transition); }
.btn-view { background: #e0f2fe; color: #0284c7; }
.btn-edit { background: #fef3c7; color: var(--secondary-dark); }
.btn-delete { background: #fee2e2; color: #dc2626; }

/* ===== FORMS ===== */
.card-form { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); }
.card-form-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--bg-light); border-radius: var(--radius) var(--radius) 0 0; }
.card-form-header h5 { font-weight: 700; margin: 0; color: var(--text-dark); }
.card-form-body { padding: 1.5rem; }

/* ===== PAGE COMPONENTS ===== */
.breadcrumb-section { background: var(--primary-light); padding: 1rem 0; }
.breadcrumb { margin: 0; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-light); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }
.news-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: var(--transition); height: 100%; }
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.news-card-img { height: 200px; overflow: hidden; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.news-card:hover .news-card-img img { transform: scale(1.05); }
.news-card-body { padding: 1.2rem; }
.news-date { color: var(--text-light); font-size: .8rem; }
.news-title { font-weight: 700; font-size: 1rem; margin: .5rem 0; color: var(--text-dark); }
.news-excerpt { color: var(--text-light); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-content h2 { color: var(--primary); font-weight: 700; }
.page-content ul li { margin-bottom: .4rem; }
.contact-info-card { background: var(--primary-light); border-radius: var(--radius); padding: 1.5rem; height: 100%; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.contact-icon { width: 48px; height: 48px; background: var(--primary); color: #fff; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* ===== AUTH PAGES ===== */
.auth-wrapper { min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 64px; }
.auth-logo h4 { color: var(--primary); font-weight: 800; margin-top: .5rem; }
.auth-logo p { color: var(--text-light); font-size: .85rem; }
.auth-title { font-weight: 700; color: var(--text-dark); margin-bottom: .3rem; }
.auth-subtitle { color: var(--text-light); font-size: .85rem; margin-bottom: 1.5rem; }
.input-group-custom { position: relative; }
.input-group-custom .form-control { padding-right: 2.8rem; }
.input-group-custom .input-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-light); }

/* ===== FOOTER ===== */
.site-footer { background: #0f3d22; color: rgba(255,255,255,.8); padding: 3rem 0 1.5rem; }
.footer-brand h5 { color: #fff; font-weight: 800; }
.footer-brand p { font-size: .85rem; color: rgba(255,255,255,.6); }
.footer-heading { color: var(--secondary); font-weight: 700; margin-bottom: 1.2rem; font-size: .95rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .6rem; }
.footer-links a { color: rgba(255,255,255,.65); text-decoration: none; font-size: .88rem; transition: var(--transition); }
.footer-links a:hover { color: var(--secondary); padding-right: .3rem; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); text-decoration: none; transition: var(--transition); margin-left: .5rem; }
.footer-social a:hover { background: var(--secondary); color: #fff; transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.5rem; font-size: .82rem; color: rgba(255,255,255,.5); }

/* ===== ALERTS & TOASTS ===== */
.toast-container { position: fixed; top: 1.5rem; left: 1.5rem; z-index: 9999; }
.toast-custom { background: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: .8rem; min-width: 280px; border-right: 4px solid var(--primary); animation: slideIn .3s ease; }
.toast-custom.success { border-right-color: var(--primary); }
.toast-custom.error { border-right-color: #dc2626; }
.toast-custom.warning { border-right-color: var(--secondary); }
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== PAGINATION ===== */
.pagination .page-link { color: var(--primary); border-color: var(--border); font-family: 'Cairo', sans-serif; padding: .5rem .9rem; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.pagination .page-link:hover { background: var(--primary-light); color: var(--primary); }

/* ===== FILTERS ===== */
.filters-bar { background: #fff; border-radius: var(--radius); padding: 1.2rem 1.5rem; border: 1px solid var(--border); margin-bottom: 1.5rem; }
.filter-tag { background: var(--bg-light); color: var(--text-medium); border: 1px solid var(--border); border-radius: 20px; padding: .3rem .9rem; font-size: .8rem; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: .4rem; }
.filter-tag:hover, .filter-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== BACK TO TOP ===== */
#back-to-top { position: fixed; bottom: 2rem; left: 2rem; width: 44px; height: 44px; background: var(--primary); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 1rem; box-shadow: var(--shadow); transition: var(--transition); z-index: 999; }
#back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }
#back-to-top.visible { display: flex; }

/* ===== DASHBOARD USER ===== */
.user-dashboard { background: var(--bg-light); min-height: 100vh; padding: 2rem 0; }
.user-stat-card { background: #fff; border-radius: var(--radius); padding: 1.2rem; border: 1px solid var(--border); text-align: center; }
.user-stat-card .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.user-stat-card .lbl { font-size: .85rem; color: var(--text-light); }
.application-row { background: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; border: 1px solid var(--border); margin-bottom: .8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; transition: var(--transition); }
.application-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* ===== HOMEPAGE + GRANT CARDS (missing classes referenced by index.php / grants.php) ===== */
:root {
  --display-font: 'El Messiri', 'Cairo', serif;
  --paper: #faf7ef;
}

/* --- hero --- */
.hero-section { background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 55%, #1e8449 100%); min-height: auto; padding: 76px 0 64px; position: relative; overflow: hidden; }
.hero-pattern { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(circle at 12% 20%, rgba(212,160,23,.14), transparent 40%), radial-gradient(circle at 90% 80%, rgba(212,160,23,.10), transparent 45%),
  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.035'%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-section .container { position: relative; }
.hero-title { font-family: var(--display-font); font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 700; }
.hero-desc { font-size: 1.02rem; color: rgba(255,255,255,.82); max-width: 52ch; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.btn-hero-primary, .btn-hero-secondary { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .92rem; padding: .8rem 1.7rem; border-radius: 10px; text-decoration: none; transition: var(--transition); }
.btn-hero-primary { background: var(--secondary); color: #2a1e08; }
.btn-hero-primary:hover { background: var(--secondary-dark); color: #2a1e08; transform: translateY(-2px); }
.btn-hero-secondary { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.35); color: #fff; }
.btn-hero-secondary:hover { background: rgba(255,255,255,.18); color: #fff; }
.hero-stat-item { display: inline-block; }
.hero-stats { display: flex; gap: clamp(1.2rem,3vw,2.4rem); border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.4rem; flex-wrap: wrap; }
.hero-stat-num { font-family: var(--display-font); font-size: 1.7rem; font-weight: 700; color: var(--secondary); line-height: 1; }
.hero-stat-label { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: .3rem; }

.hero-cards-wrap { background: var(--paper); border-radius: var(--radius-lg); padding: 1.4rem 1.3rem; box-shadow: var(--shadow-lg); width: 100%; max-width: 340px; position: relative; }
.hero-cards-wrap::after { content: ''; position: absolute; inset: 7px; border: 1px solid var(--secondary); opacity: .35; border-radius: var(--radius); pointer-events: none; }
.hero-ledger-title { font-size: .82rem; font-weight: 700; color: var(--text-light); display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.hero-float-card { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-top: 1px dashed var(--border); }
.hero-float-card:first-of-type { border-top: none; }
.hero-float-card .card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.hero-float-card .card-title { font-weight: 700; font-size: .9rem; color: var(--text-dark); }
.hero-float-card .card-title span { display: block; font-weight: 400; font-size: .75rem; color: var(--text-light); margin-top: .1rem; }

/* --- search bar (shared: homepage + listing page) --- */
.search-section { background: var(--bg-white); padding: 0; position: relative; z-index: 2; }
.search-bar-wrap { display: flex; gap: .7rem; flex-wrap: wrap; background: var(--bg-white); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 1rem; margin-top: -46px; }
.search-input-wrap { position: relative; flex: 1 1 260px; }
.search-input-wrap .search-icon { position: absolute; top: 50%; right: 1rem; transform: translateY(-50%); color: var(--text-light); }
.search-input-wrap .form-control { padding-right: 2.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.search-bar-wrap .form-select { border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* --- section header eyebrow / divider --- */
.section-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: .4rem 1rem; border-radius: 20px; margin-bottom: .8rem; }
.divider-line { width: 56px; height: 3px; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 2px; margin: 1rem auto 0; }
.section-title { font-family: var(--display-font); }
.section-title span { color: var(--secondary); }

/* --- grant card: complete the missing pieces --- */
.grant-card-header { padding: 1.2rem 1.2rem 0; position: relative; }
.grant-card-header .grant-title { margin-top: .6rem; margin-bottom: 0; }
.featured-star { position: absolute; top: 1rem; left: 1.2rem; width: 30px; height: 30px; border-radius: 50%; background: var(--secondary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .78rem; }
.grant-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .3rem .75rem; border-radius: 20px; }
.grant-badge.badge-active { background: #d1fae5; color: #065f46; }
.grant-badge.badge-upcoming { background: #fef3c7; color: #92400e; }
.grant-badge.badge-closed { background: #f3f4f6; color: #6b7280; }
.grant-badge.badge-draft { background: #f3f4f6; color: #6b7280; }
.grant-desc { font-size: .87rem; color: var(--text-medium); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: .7rem 0 0; }
.grant-card-footer { padding: 1rem 1.2rem 1.2rem; margin-top: auto; }
.grant-amount { display: flex; align-items: center; justify-content: space-between; background: var(--primary-light); border-radius: var(--radius-sm); padding: .6rem .9rem; margin-top: .9rem; }
.grant-amount-label { font-size: .74rem; color: var(--text-light); }
.grant-amount-value { font-family: var(--display-font); font-weight: 700; color: var(--primary); font-size: .95rem; }

/* --- buttons used across grant cards / search / pagination --- */
.btn-apply, .btn-details { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .84rem; padding: .65rem 1.1rem; border-radius: var(--radius-sm); text-decoration: none; border: none; cursor: pointer; font-family: 'Cairo', sans-serif; transition: var(--transition); }
.btn-apply { background: var(--primary); color: #fff; }
.btn-apply:hover { background: var(--primary-dark); color: #fff; }
.btn-details { background: var(--bg-light); color: var(--text-dark); border: 1px solid var(--border); }
.btn-details:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }

/* --- steps section --- */
.step-card { text-align: center; padding: 1.7rem 1rem; }
.step-icon { width: 68px; height: 68px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto .9rem; font-size: 1.6rem; color: #fff; position: relative; }
.step-num { position: absolute; top: -8px; left: -8px; background: var(--secondary); color: #fff; font-size: .62rem; font-weight: 800; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.step-title { font-size: .95rem; font-weight: 800; margin-bottom: .4rem; }
.step-desc { font-size: .82rem; color: var(--text-light); margin: 0; }

/* --- CTA band --- */
.cta-band { padding: 65px 0; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.cta-band-title { color: #fff; font-family: var(--display-font); font-size: 1.7rem; font-weight: 700; margin-bottom: .7rem; }
.cta-band-sub { color: rgba(255,255,255,.75); margin-bottom: 1.7rem; }

/* --- page header banner (grants.php, about.php, etc.) --- */
.page-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 2.4rem 0; }
.page-header-title { font-family: var(--display-font); font-size: 1.8rem; font-weight: 700; margin-bottom: .3rem; }
.page-header-sub { color: rgba(255,255,255,.78); font-size: .95rem; margin: 0; }

/* --- empty state (grants.php with no results) --- */
.empty-state { text-align: center; padding: 3.5rem 1rem; }
.empty-state-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-light); color: var(--text-light); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1.2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .hero-title { font-size: 2rem; }
  .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-content { margin-right: 0; }
  .sidebar-toggle { display: block; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; display: none; }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 767px) {
  .hero-title { font-size: 1.6rem; }
  .hero-stats { gap: 1rem; }
  .hero-stat .number { font-size: 1.5rem; }
  .section-title { font-size: 1.5rem; }
  .stat-number { font-size: 2rem; }
  .steps-indicator { gap: 0; }
  .step-label { display: none; }
}
@media (max-width: 576px) {
  .navbar-brand span { font-size: 1rem; }
  .hero-section { min-height: auto; padding: 3rem 0; }
  .admin-main { padding: 1rem; }
  .data-table { overflow-x: auto; }
}
