/* Grace Parth Care Portal - Main Stylesheet */
:root {
  --blue-900: #0e1e4d;
  --blue-800: #1a3470;
  --blue-700: #1e4db7;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --purple-800: #3b1f6e;
  --purple-700: #5b2d9a;
  --purple-600: #7c3aed;
  --purple-400: #a78bfa;
  --purple-100: #ede9fe;
  --green-600: #059669;
  --green-500: #10b981;
  --green-100: #d1fae5;
  --red-600:  #dc2626;
  --red-100:  #fee2e2;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white: #ffffff;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition: all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; line-height: 1.6; background: var(--gray-100); color: var(--gray-800); }

/* Auth Pages */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--purple-800) 50%, var(--blue-800) 100%); }
.auth-body::before { content:''; position:fixed; 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"); pointer-events:none; }

.auth-card { background: var(--white); border-radius: 20px; box-shadow: 0 25px 50px rgba(0,0,0,.3); padding: 48px 44px; width: 100%; max-width: 480px; position: relative; animation: slideUp .4s ease; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { width: 72px; height: 72px; object-fit: contain; }
.auth-logo h1 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; color: var(--blue-900); margin-top: 12px; }
.auth-logo p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }
.auth-title { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.auth-sub { color: var(--gray-500); margin-bottom: 28px; font-size: 14px; }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--blue-900); color: var(--white); display: flex; flex-direction: column; z-index: 1000; transition: transform .3s ease, width .3s ease; overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.brand-name { display: block; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14px; color: var(--white); }
.brand-sub { display: block; font-size: 11px; color: rgba(255,255,255,.5); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 10px; color: rgba(255,255,255,.7); text-decoration: none; transition: var(--transition); margin-bottom: 2px; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,.1); color: var(--white); }
.nav-item.active { background: linear-gradient(135deg, var(--blue-600), var(--purple-600)); color: var(--white); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-section { padding: 16px 16px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.35); font-weight: 600; }
.nav-logout:hover { background: rgba(220,38,38,.2); color: #fca5a5; }

/* Main Wrapper */
.main-wrapper { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .3s ease; }

/* Topbar */
.topbar { height: var(--topbar-h); background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); gap: 16px; }
.sidebar-toggle { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--gray-600); font-size: 18px; display: none; transition: var(--transition); }
.sidebar-toggle:hover { background: var(--gray-100); color: var(--blue-600); }
.topbar-title { font-weight: 700; font-size: 16px; color: var(--gray-900); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.icon-btn { position: relative; background: none; border: none; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--gray-600); font-size: 18px; transition: var(--transition); }
.icon-btn:hover { background: var(--gray-100); color: var(--blue-600); }
.badge { position: absolute; top: 2px; right: 2px; background: var(--red-600); color: white; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.user-menu-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-avatar { width: 38px; height: 38px; background: linear-gradient(135deg, var(--blue-600), var(--purple-600)); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.user-name { display: block; font-weight: 600; font-size: 13px; color: var(--gray-900); }
.user-role { display: block; font-size: 11px; color: var(--gray-500); }

/* Notification Dropdown */
.notif-wrap { position: relative; }
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 320px; display: none; z-index: 200; overflow: hidden; }
.notif-wrap.open .notif-dropdown { display: block; animation: slideDown .2s ease; }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--gray-200); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.mark-read { font-size: 12px; color: var(--blue-600); font-weight: 500; text-decoration: none; }
.notif-item { display: block; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--gray-100); transition: var(--transition); }
.notif-item:hover { background: var(--gray-50); }
.notif-item strong { display: block; font-size: 13px; color: var(--gray-900); margin-bottom: 2px; }
.notif-item p { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.notif-item span { font-size: 11px; color: var(--gray-400); }
.notif-empty { padding: 24px; text-align: center; color: var(--gray-500); font-size: 13px; }
.notif-empty i { display: block; font-size: 24px; color: var(--green-500); margin-bottom: 8px; }
.notif-success { border-left: 3px solid var(--green-500); }
.notif-danger { border-left: 3px solid var(--red-600); }
.notif-warning { border-left: 3px solid var(--amber-600); }
.notif-info { border-left: 3px solid var(--blue-500); }

/* Main Content */
.main-content { flex: 1; padding: 28px 28px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; color: var(--gray-900); }
.page-header p { color: var(--gray-500); margin-top: 4px; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-200); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-weight: 700; font-size: 15px; color: var(--gray-900); }
.card-body { padding: 22px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--gray-200); display: flex; align-items: center; gap: 16px; transition: var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.blue { background: var(--blue-100); color: var(--blue-600); }
.stat-icon.purple { background: var(--purple-100); color: var(--purple-600); }
.stat-icon.green { background: var(--green-100); color: var(--green-600); }
.stat-icon.amber { background: var(--amber-100); color: var(--amber-600); }
.stat-icon.red { background: var(--red-100); color: var(--red-600); }
.stat-number { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: var(--transition); line-height: 1.4; }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--purple-600)); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.btn-success { background: var(--green-600); color: white; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--red-600); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--amber-600); color: white; }
.btn-outline { background: transparent; color: var(--blue-600); border: 2px solid var(--blue-600); }
.btn-outline:hover { background: var(--blue-50); }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; font-size: 13px; color: var(--gray-700); margin-bottom: 6px; }
.form-label .req { color: var(--red-600); }
.form-control { width: 100%; padding: 10px 14px; border: 2px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--gray-900); background: var(--white); transition: var(--transition); outline: none; }
.form-control:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.form-control.error { border-color: var(--red-600); }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red-600); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; cursor: pointer; accent-color: var(--blue-600); flex-shrink: 0; }
.form-check label { font-size: 14px; color: var(--gray-700); cursor: pointer; }

/* Tabs */
.tab-nav { display: flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: 10px; margin-bottom: 24px; overflow-x: auto; }
.tab-btn { padding: 9px 18px; border-radius: 8px; border: none; background: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--gray-600); transition: var(--transition); white-space: nowrap; }
.tab-btn.active { background: var(--white); color: var(--blue-600); box-shadow: var(--shadow); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .3s ease; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--gray-50); padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; color: var(--gray-800); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--blue-50); }

/* Status Badges */
.badge-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-status::before { content:''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.badge-pending { background: var(--amber-100); color: var(--amber-600); }
.badge-pending::before { background: var(--amber-600); }
.badge-active { background: var(--green-100); color: var(--green-600); }
.badge-active::before { background: var(--green-600); }
.badge-inactive { background: var(--gray-100); color: var(--gray-600); }
.badge-inactive::before { background: var(--gray-400); }
.badge-suspended { background: var(--red-100); color: var(--red-600); }
.badge-suspended::before { background: var(--red-600); }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 12px; font-size: 14px; }
.alert-success { background: var(--green-100); color: #065f46; border-left: 4px solid var(--green-500); }
.alert-danger { background: var(--red-100); color: #991b1b; border-left: 4px solid var(--red-600); }
.alert-warning { background: var(--amber-100); color: #92400e; border-left: 4px solid var(--amber-600); }
.alert-info { background: var(--blue-100); color: #1e40af; border-left: 4px solid var(--blue-500); }
.alert-dismissible { position: relative; }
.alert-close { position: absolute; top: 10px; right: 14px; background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* Progress Steps */
.steps { display: flex; margin-bottom: 32px; overflow-x: auto; gap: 0; }
.step { flex: 1; text-align: center; position: relative; min-width: 100px; }
.step::before { content: ''; position: absolute; top: 18px; left: 50%; right: -50%; height: 2px; background: var(--gray-300); z-index: 0; }
.step:last-child::before { display: none; }
.step.done::before { background: var(--blue-500); }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-300); color: var(--gray-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin: 0 auto 8px; position: relative; z-index: 1; transition: var(--transition); }
.step.active .step-num { background: var(--blue-600); color: white; box-shadow: 0 0 0 4px var(--blue-100); }
.step.done .step-num { background: var(--green-500); color: white; }
.step-label { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.step.active .step-label { color: var(--blue-600); }
.step.done .step-label { color: var(--green-600); }

/* Search & Filter Bar */
.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-control { max-width: 280px; }
.search-input-wrap { position: relative; }
.search-input-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.search-input-wrap .form-control { padding-left: 36px; }

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; margin-top: 20px; justify-content: center; }
.page-btn { padding: 8px 13px; border-radius: 8px; border: 1px solid var(--gray-300); background: white; color: var(--gray-700); cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; transition: var(--transition); }
.page-btn:hover { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-600); }
.page-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: white; }
.page-btn.disabled { opacity: .4; cursor: not-allowed; }

/* Upload Zone */
.upload-zone { border: 2px dashed var(--gray-300); border-radius: 10px; padding: 32px; text-align: center; cursor: pointer; transition: var(--transition); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue-500); background: var(--blue-50); }
.upload-zone i { font-size: 36px; color: var(--gray-400); margin-bottom: 12px; }
.upload-zone p { color: var(--gray-600); font-size: 14px; }
.upload-zone span { color: var(--blue-600); font-weight: 600; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: white; border-radius: 16px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp .3s ease; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-weight: 700; font-size: 16px; color: var(--gray-900); }
.modal-close { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--gray-500); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 12px; }

/* Sidebar overlay (mobile) */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }

/* Animations */
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.visible { display: block; }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 32px 24px; margin: 0 16px; }
  .filter-bar .form-control { max-width: 100%; width: 100%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* Membership Number Badge */
.member-num { font-family: monospace; background: var(--blue-50); color: var(--blue-700); padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 700; border: 1px solid var(--blue-200); }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-500); }
.empty-state i { font-size: 48px; color: var(--gray-300); margin-bottom: 16px; display: block; }

/* Print */
@media print { .sidebar, .topbar, .btn, .filter-bar { display: none !important; } .main-wrapper { margin-left: 0; } }
