@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

:root {
  --color-primary: #2d3e50;
  --color-primary-dark: #1a252f;
  --color-accent: #b3e0ff; /* Assumed from provided #b3e0 */
  --color-white: #ffffff;
  --color-bg: #f8fafc;
  --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.18);
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #222;
  line-height: 1.6;
}

/* Layout */
.residents-container { display: flex; width: 100%; min-height: 100vh; }

.sidebar {
  flex-shrink: 0;
  width: 75px;
  background: var(--color-primary);
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 10;
  overflow-x: hidden; overflow-y: auto; padding-top: 10px;
  transition: width 0.3s ease; display: flex; flex-direction: column;
}
.sidebar:hover { width: 200px; transition: width 0.6s ease; }

.sidebar h2 {
  margin: 0 0 2rem 0; color: var(--color-white);
  font-size: 1.6rem; font-weight: 700; letter-spacing: 2px; white-space: nowrap;
  opacity: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 0 20px; height: 60px; font-family: 'Inter', sans-serif;
}
.sidebar h2 .logo { width: 40px; height: 40px; object-fit: contain; opacity: 1; transition: all 0.3s ease; }
.sidebar:hover h2 { opacity: 1; }
.sidebar:hover h2 .logo { width: 50px; height: 50px; }
.sidebar h2 span { opacity: 0; transition: opacity 0.6s ease; }
.sidebar:hover h2 span { opacity: 1; }

.sidebar ul { flex: 1; padding: 0; margin: 0; display: flex; flex-direction: column; }
.sidebar ul li { list-style: none; margin-bottom: 20px; }
.sidebar ul li:last-child { margin-top: auto; margin-bottom: 20px; }

.sidebar ul li a {
  color: var(--color-white); text-decoration: none; display: flex; gap: 10px;
  padding: 0 20px; height: 60px; align-items: center; position: relative; font-weight: 200;
}
.sidebar ul li a:hover { background: var(--color-accent); color: var(--color-primary); }
.sidebar ul li a i {
  min-width: 30px; height: 60px; font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.sidebar ul li a span { visibility: hidden; opacity: 0; height: 60px; line-height: 60px; font-size: 18px; transition: opacity 0.6s ease; text-transform: uppercase; letter-spacing: 1px; }
.sidebar:hover ul li a span { visibility: visible; opacity: 1; }

.main-content {
  flex: 1; min-height: 100vh; background: var(--color-bg); padding: 0;
  margin-left: 75px; transition: all 0.3s cubic-bezier(.4,0,.2,1); overflow-x: hidden;
}
/* Expand content margin when sidebar is hovered to avoid overlay */
.sidebar:hover ~ .main-content {
  margin-left: 200px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white); padding: 0.5rem 1.25rem; box-shadow: var(--shadow-md);
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  /* Shared action sizing for perfect alignment with brand */
  --header-action-height: clamp(32px, 5.6vw, 40px);
  --header-action-pad-x: clamp(8px, 2.2vw, 12px);
  --header-action-font: clamp(0.88rem, 2.4vw, 0.98rem);
  /* Dedicated sizing for Logout/My Profile header CTAs */
  --header-cta-height: clamp(28px, 4.8vw, 36px);
  --header-cta-pad-x: clamp(10px, 2.4vw, 14px);
  --header-cta-font: clamp(0.9rem, 2.6vw, 1rem);
}
.header .brand { display: flex; align-items: center; gap: 12px; }
.header .brand img { width: 50px; height: 50px; border-radius: 10px; }
.header .brand .title { font-size: 2rem; font-weight: 700; letter-spacing: 1px; }
.header .actions { display: flex; align-items: center; gap: 12px; margin-left: auto; transition: margin 200ms ease, transform 200ms ease, opacity 200ms ease; }
.header .actions .header-cta { height: var(--header-cta-height); padding: 0 var(--header-cta-pad-x); font-size: var(--header-cta-font); }
/* Ensure header action buttons never add extra vertical space */
.header .actions .btn, .header .actions .btn-alert { margin-top: 0; }
/* Preview mode tag styling */
.preview-tag { background: rgba(255,255,255,0.15); color: var(--color-white); border: 1px solid rgba(255,255,255,0.28); border-radius: 12px; height: var(--header-action-height); padding: 0 var(--header-action-pad-x); font-size: var(--header-action-font); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Buttons */
.btn { cursor: pointer; border: none; outline: none; font-weight: 600; border-radius: 10px; transition: all 0.2s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--color-accent); color: var(--color-primary); box-shadow: var(--shadow-md); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-outline { background-color:#b3e0ff; color: rgb(47, 47, 47); border: 1px solid rgba(255,255,255,0.3); }
.btn-outline:hover { background: #2d3e50; color: white; }

/* Receive Alert buttons */
.btn-alert {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}
.btn-alert i { font-size: 1rem; }

/* Primary: prominent, high-contrast */
.btn-alert--primary {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: var(--shadow-md);
}
.btn-alert--primary:hover {
  filter: brightness(1.06);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.btn-alert--primary:active {
  filter: brightness(0.98);
  transform: translateY(0);
}

/* Secondary: subtle yet visible */
.btn-alert--secondary {
  background: var(--color-accent);
  color: var(--color-primary);
  border: 1px solid #d1d5db;
  box-shadow: var(--shadow-md);
}
.btn-alert--secondary:hover {
  background: var(--color-accent);
  color: var(--color-primary);
  border-color: var(--color-accent);
}
.btn-alert--secondary:active { filter: brightness(0.98); }

/* Accessibility focus ring */
.btn-alert:focus-visible {
  outline: 3px solid rgba(179,224,255,0.8);
  outline-offset: 2px;
}

/* Responsive sizing */
@media (min-width: 768px) {
  .btn-alert { min-height: 42px; font-size: 1rem; }
}
@media (max-width: 480px) {
  .btn-alert { width: 100%; min-height: 40px; padding: 10px 12px; font-size: 0.95rem; }
}
/* Button responsive sizing */
@media (min-width: 768px) { .btn { padding: 12px 16px; min-height: 42px; font-size: 1rem; } }
@media (max-width: 480px) { .btn { padding: 10px 12px; min-height: 36px; font-size: 0.95rem; } }

/* Dashboard Hero */
.dashboard-hero { padding: 6rem; color: var(--color-white); background: linear-gradient(135deg, rgba(45,62,80,0.7) 0%, rgba(26,37,47,0.7) 100%), url('../img/hero_overlay1.jpg'); background-size: cover; background-position: center; box-shadow: var(--shadow-md); }
.dashboard-hero h1 { margin: 0; font-size: 2rem; font-weight: 700; }
.dashboard-hero p { margin: 0.5rem 0 0 0; opacity: 0.9; }

/* Cards */
.card { background: #2d3e50; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 1rem; transition: all 0.25s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h3 { margin: 0 0 8px 0; font-size: 1rem; font-weight: 700; color: #fff; }
.card p { margin: 0; color: #fff; }
.limited h3 { color: #ffffff; }

.grid { display: grid; gap: 1rem; align-items: stretch; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Uniform dashboard cards */
.grid > .card { height: 100%; display: flex; flex-direction: column; }
.section .grid > .card .mt-3 { margin-top: auto; }
/* Reset card margins inside grid to keep rows aligned */
.section .grid .card { margin-top: 0 !important; }
/* Consistent actions layout across breakpoints */
.section .grid > .card .mt-3 { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.grid > .card h3 { margin-bottom: 8px; }
.grid > .card p { margin-bottom: 0; }

.section { padding: 1.5rem; }
.section .card + .card { margin-top: 25px; }
/* About Us section */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; align-items: stretch; }
.about-image { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); object-fit: cover; max-height: 360px; }
/* About Us gallery */
.about-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.about-gallery .gallery-img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
@media (min-width: 768px) { .about-gallery .gallery-img { height: 160px; } }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: #2c3e50; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--color-white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.table th { background: #f3f4f6; font-weight: 700; color: #374151; }
.table tr:hover td { background: #f9fafb; }

/* Mobile table wrapper for Alerts */
.table-responsive { width: 100%; overflow-x: hidden; -webkit-overflow-scrolling: auto; }
.table-responsive .table { width: 100%; min-width: 0; table-layout: fixed; }

/* Ensure table content wraps on small screens */
@media (max-width: 640px) {
  .table th, .table td { white-space: normal; word-break: break-word; hyphens: auto; }
}

@media (max-width: 768px) {
  .table th, .table td { padding: 10px 12px; font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .table th, .table td { padding: 8px 10px; font-size: 0.9rem; }
}

/* Forms */
.input { width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(179,224,255,0.6); }
.input.invalid { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.25); }
.label { font-size: 0.9rem; font-weight: 600; color: #374151; margin-bottom: 6px; display: block; }
.help { font-size: 0.8rem; color: #6b7280; }
.muted { font-size: 0.8rem; color: #6b7280; }

/* Ensure labels and muted text are readable on dark cards */
.card .label { color: var(--color-white); }
.card .muted { color: rgba(255,255,255,0.75); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 50; }
.preview-tag { display: inline-block; padding: 8px 2px; border: 1px dashed rgba(255,255,255,0.5); color: var(--color-white); border-radius: 10px; font-weight: 600; background: rgba(255,255,255,0.08); }
.preview-overlay { position: absolute; inset: 0; background: rgba(45,62,80,0.75); backdrop-filter: blur(4px); color: var(--color-white); display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 1rem; border-radius: var(--radius-lg); z-index: 1; }
.preview-overlay h3 { margin: 0 0 6px 0; color: var(--color-white); }
.preview-overlay p { margin: 0 0 12px 0; max-width: 520px; color: var(--color-white); }

/* Footer */
.footer { padding: 1rem 1.5rem; color: #6b7280; text-align: center; letter-spacing: 0.6px; }

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.rounded { border-radius: 10px; }

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-hero { padding: 3rem; }
}

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -75px; }
  .sidebar:hover { left: 0; }
  .main-content { margin-left: 0; }

  .header { padding: 0.5rem 1rem; justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
  .header .brand img { width: 40px; height: 40px; }
  .header .brand .title { font-size: 1.3rem; letter-spacing: 1px; }
  .header .actions { display: inline-flex; gap: 8px; justify-content: flex-start; align-items: center; margin-left: 6px; flex: 0 1 auto; }
  .header .actions.actions--auth { margin-left: auto; justify-content: flex-end; }
  .header .actions .btn, .header .actions .btn-alert, .header .actions .preview-tag { height: var(--header-action-height); padding: 0 var(--header-action-pad-x); font-size: var(--header-action-font); }
}

@media (max-width: 640px) {
  /* Mobile-friendly profile card (phones and small tablets) */
  .profile-card { display: grid; grid-template-columns: 1fr; text-align: center; }
  .profile-avatar { width: 88px; height: 88px; margin: 0 auto 10px; }
  .profile-header .name { font-size: 1.2rem; }
  .profile-header .contact, .profile-header .address { font-size: 0.95rem; }
  .profile-details { grid-template-columns: 1fr; }
  #uploadForm .btn { width: 100%; }

  /* Ensure dashboard cards don’t overlap actions on mobile */
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section .grid > .card .mt-3 { margin-top: 12px; }
  .card .mt-3 { display: flex; flex-wrap: wrap; gap: 8px; }
  .card .mt-3 .btn, .card .mt-3 .btn-alert { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .header {  padding: 0.4rem 1rem; padding-left: calc(1rem + env(safe-area-inset-left, 0px)); padding-right: calc(1rem + env(safe-area-inset-right, 0px)); gap: 6px; justify-content: flex-start; }
  .header .brand img { width: 40px; height: 40px; }
  .header .brand .title { font-size: 1.3rem; letter-spacing: 1px; }
  .header .actions { flex: 0 1 auto; gap: 6px; row-gap: 4px; justify-content: flex-start; padding-top: 0; display: inline-flex; margin-left: 6px; }
  .header .actions.actions--auth { margin-left: auto; justify-content: flex-end; }
  .header .actions .btn, .header .actions .btn-alert { margin-top: 0; }
  .preview-tag { height: var(--header-action-height); padding: 0 var(--header-action-pad-x); font-size: var(--header-action-font); }
  .header .actions .btn-alert {
    width: auto; /* override global 100% width */
    min-height: var(--header-action-height);
    padding: 0 var(--header-action-pad-x);
    font-size: var(--header-action-font);
    white-space: nowrap;
  }
  .header .actions .btn-alert i { font-size: clamp(1rem, 2.4vw, 1.15rem); }
  
/* Mobile and touch target improvements */
.btn-alert { touch-action: manipulation; }

/* Font Family Overrides for Header, Sidebar, Footer */
.header, .header .brand .title, .sidebar, .sidebar h2, .sidebar ul li a span, .footer {
  font-family: 'Bebas Neue', sans-serif;
}
.brand-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.sidebar .brand-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 60px; color: var(--color-white); text-decoration: none; }

/* Modal - Admin Login Inspired */
/* --- Registration modal redesign: Admin login visual parity --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

.modal-overlay { background: transparent; }
.modal-overlay::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../img/hero_overlay1.jpg') center/cover no-repeat;
  filter: brightness(0.8);
  z-index: 0;
}
.modal-overlay::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(45,62,80,0.86) 0%, rgba(26,37,47,0.92) 100%);
  z-index: 1;
}

.modal { position: relative; z-index: 2; width: 92%; max-width: 560px; background: rgba(255,255,255,0.08); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; box-shadow: 0 16px 40px rgba(0,0,0,0.35); padding: 1.5rem; transform: translateY(12px); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.modal-overlay.show { display: flex; }
.modal-overlay.show .modal { transform: translateY(0); opacity: 1; }

.modal-header { background: transparent; color: var(--color-white); padding: 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-title { display: flex; align-items: center; gap: 16px; }
.modal-logos { display: flex; gap: 12px; }
.modal-logos img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); box-shadow: 0 8px 20px rgba(0,0,0,0.35); object-fit: cover; }
.modal-title h3 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.8rem; color: var(--color-white); }
.modal-title .sub { margin: 4px 0 0; color: rgba(255,255,255,0.85); font-weight: 500; }

.icon-btn { background: rgba(255,255,255,0.12); color: var(--color-white); border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; padding: 8px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,0.18); }
/* Ensure close button sits at the top-right of modal */
.modal .icon-btn#registrationClose { position: absolute; top: 12px; right: 12px; z-index: 3; }

.modal-body { font-family: 'Poppins', 'Inter', sans-serif; color: #fff; }
.input-group { margin-bottom: 14px; position: relative; }
.input-group .label { color: rgba(255,255,255,0.95); font-weight: 600; letter-spacing: 0.6px; }
.input-group .label i { color: var(--color-accent); }
.input-group .input { margin-top: 8px; background: rgba(255,255,255,0.92); border: 1px solid rgba(0,0,0,0.08); }
.input-group .input:focus { box-shadow: 0 0 0 3px rgba(179,224,255,0.6); }
.input-group .input-icon { display: none; }
.input-group .input-prefix { position: absolute; left: 44px; top: 50%; transform: translateY(-50%); color: #6b7280; font-weight: 600; }
.input-group input#contact { padding-left: 84px; }
.help { color: rgba(255,255,255,0.85); display: block; margin-top: 6px; }
.status { margin-top: 8px; color: #fef3c7; }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.btn.outline { background: transparent; color: var(--color-white); border: 1px solid rgba(255,255,255,0.4); padding: 10px 14px; border-radius: 10px; }
.btn.outline:hover { background: rgba(255,255,255,0.12); }
.login-btn { background: linear-gradient(180deg, #1f2a37 0%, #0f172a 100%); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 22px rgba(0,0,0,0.35); font-weight: 700; letter-spacing: 0.4px; }
.login-btn:hover { filter: brightness(1.05); }
.login-footer { margin-top: 12px; color: rgba(255,255,255,0.75); font-size: 0.85rem; text-align: center; }

.card.preview-gate { position: relative; overflow: hidden; min-height: clamp(180px, 32vh, 260px); }
.card.preview-gate:hover { transform: none; box-shadow: var(--shadow-md); }
.profile-card { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.profile-avatar { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); color: var(--color-white); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; font-family: 'Bebas Neue', sans-serif; letter-spacing: 2px; box-shadow: var(--shadow-md); }
.profile-header { display: flex; flex-direction: column; gap: 6px; }
.profile-header .name { font-size: 1.4rem; font-weight: 700; color: #2c3e50; }
.profile-header .contact, .profile-header .address { color: #4b5563; }
/* Profile card readability on dark preview gate */
.card.preview-gate .profile-header .name { color: var(--color-white); }
.card.preview-gate .profile-header .contact,
.card.preview-gate .profile-header .address { color: rgba(255,255,255,0.85); }
.profile-details { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.profile-details .item { background: #f9fafb; border-radius: 12px; padding: 12px; }
.profile-details .item h4 { margin: 0 0 6px 0; font-size: 0.95rem; font-weight: 700; color: #374151; }
/* Keep text inside light info tiles legible */
.profile-details .item p { color: #4b5563; }
/* Input prefix styling for +63 in registration modal */
.input-group {
  position: relative;
}
.input-group .input-prefix {
  position: absolute;
  left: 44px; /* after icon */
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 0.95rem;
  pointer-events: none;
}
.input-group input#contact {
  padding-left: 84px; /* accommodate icon + prefix */
}

/* Profile avatar image fit */
.profile-card .profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@media (max-width: 768px) {
  .input-group .input-prefix {
    left: 40px;
    font-size: 0.9rem;
  }
  .input-group input#contact {
    padding-left: 80px;
  }
}
/* Preview Mode card styles */
.preview-card { background: linear-gradient(135deg, rgba(45,62,80,0.92) 0%, rgba(26,37,47,0.96) 100%); color: var(--color-white); border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; box-shadow: 0 14px 28px rgba(0,0,0,0.25); padding: 1.25rem; display: grid; gap: 12px; }
.preview-bar { display: flex; justify-content: flex-end; }
.preview-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.12); color: var(--color-white); border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 6px 10px; font-weight: 700; letter-spacing: 0.4px; }
.preview-content { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; }
.preview-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); }
.preview-icon i { font-size: 1.6rem; color: var(--color-accent); }
.preview-title { margin: 0; font-size: 1.2rem; line-height: 1.35; font-weight: 800; letter-spacing: 0.3px; }
.preview-sub { margin: 6px 0 0; color: rgba(255,255,255,0.85); }
.preview-actions { display: flex; align-items: center; justify-content: flex-end; }

/* Receive Alert button states (usable inside preview card too) */
.btn-alert { transition: all 0.2s ease; }
.btn-alert:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-alert:focus-visible { outline: 3px solid rgba(179,224,255,0.7); outline-offset: 2px; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .preview-content { grid-template-columns: 48px 1fr; }
  .preview-actions { justify-content: flex-start; }
}

/* Global Alert Toast Notifications */
.global-toast-notice {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  min-width: 320px;
  max-width: 400px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #f59e0b;
  animation: slideInRight 0.3s ease-out;
  font-family: inherit;
}

.global-toast-notice.global-toast-critical {
  border-left-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.global-toast-notice.global-toast-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.global-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 8px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.global-toast-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1f2937;
  margin: 0;
}

.global-toast-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.global-toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

.global-toast-body {
  padding: 8px 16px 12px 16px;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-line;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile responsive adjustments for global toast */
@media (max-width: 768px) {
  .global-toast-notice {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }
  
  .global-toast-header {
    padding: 10px 12px 6px 12px;
  }
  
  .global-toast-body {
    padding: 6px 12px 10px 12px;
    font-size: 0.85rem;
  }
  
  @keyframes slideInRight {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}
@media (max-width: 480px) {
  .preview-card { padding: 1rem; }
  .preview-title { font-size: 1.05rem; }
  .preview-content { grid-template-columns: 1fr; }
  .preview-icon { width: 48px; height: 48px; }
  .preview-actions { justify-content: flex-start; }
}
/* Align brand title tightly for baseline harmony */
.header .brand .title { line-height: 1.1; display: inline-flex; align-items: center; }

/* Make Receive Alert perfectly aligned with brand using shared variables */
.header .actions .btn-alert {
  height: var(--header-action-height);
  padding: 0 var(--header-action-pad-x);
  font-size: var(--header-action-font);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.header .actions .btn-alert i { font-size: clamp(1rem, 2.4vw, 1.15rem); }
.header .actions .btn-alert {
    width: auto; /* override global 100% width */
    min-height: 44px; /* Apple/Google recommended touch target */
    padding: 10px 14px;
    font-size: 1rem;
    white-space: nowrap;
  }
  .header .actions .btn-alert i { font-size: 1.1rem; }
  .dashboard-hero { padding: 2rem 1rem; }
  .dashboard-hero h1 { font-size: 1.6rem; }
  .about-grid { grid-template-columns: 1fr; }
}

/* Mobile and touch target improvements */
.btn-alert { touch-action: manipulation; }

/* Header — small screens: inline actions align with brand */
@media (max-width: 640px) {
  .header { padding: 0.4rem 0.875rem; justify-content: flex-start; align-items: center; gap: 8px; flex-wrap: nowrap; }
  .header .brand img { width: 40px; height: 40px; }
  .header .brand .title { font-size: 1.2rem; line-height: 1; }
  .header .actions { flex: 0 1 auto; display: inline-flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; margin-left: 6px; gap: 8px; }
  .header .actions.actions--auth { margin-left: auto; justify-content: flex-end; }
  .header .actions .preview-tag { height: var(--header-action-height); padding: 0 var(--header-action-pad-x); font-size: var(--header-action-font); line-height: 2.4; }
}

/* Header — phones */
@media (max-width: 480px) {
  .header { padding: 0.35rem 0.875rem; gap: 6px; }
  .header .brand img { width: 36px; height: 36px; }
  .header .brand .title { font-size: 1.1rem; line-height: 1; }
  .header .actions { gap: 6px; margin-left: 6px; align-items: center; }
  .header .actions.actions--auth { margin-left: auto; justify-content: flex-end; }
  .header .actions .btn-alert { min-height: var(--header-action-height); padding: 0 var(--header-action-pad-x); font-size: var(--header-action-font); white-space: nowrap; }
  .header .actions .btn-alert i { font-size: clamp(0.95rem, 2.2vw, 1.1rem); }
}

/* Very small devices: stack button full-width when space is tight */
@media (max-width: 360px) {
  .header .actions { flex-wrap: wrap; }
  .header .actions .btn-alert { flex: 1 0 100%; width: 100%; }
}

/* Font Family Overrides for Header, Sidebar, Footer */
.header, .header .brand .title, .sidebar, .sidebar h2, .sidebar ul li a span, .footer {
  font-family: 'Bebas Neue', sans-serif;
}
.brand-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.sidebar .brand-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 60px; color: var(--color-white); text-decoration: none; }

/* Modal - Admin Login Inspired */
/* --- Registration modal redesign: Admin login visual parity --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

.modal-overlay { background: transparent; }
.modal-overlay::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../img/hero_overlay1.jpg') center/cover no-repeat;
  filter: brightness(0.8);
  z-index: 0;
}
.modal-overlay::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(45,62,80,0.86) 0%, rgba(26,37,47,0.92) 100%);
  z-index: 1;
}

.modal { position: relative; z-index: 2; width: 92%; max-width: 560px; background: rgba(255,255,255,0.08); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; box-shadow: 0 16px 40px rgba(0,0,0,0.35); padding: 1.5rem; transform: translateY(12px); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.modal-overlay.show { display: flex; }
.modal-overlay.show .modal { transform: translateY(0); opacity: 1; }

.modal-header { background: transparent; color: var(--color-white); padding: 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-title { display: flex; align-items: center; gap: 16px; }
.modal-logos { display: flex; gap: 12px; }
.modal-logos img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); box-shadow: 0 8px 20px rgba(0,0,0,0.35); object-fit: cover; }
.modal-title h3 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.8rem; color: var(--color-white); }
.modal-title .sub { margin: 4px 0 0; color: rgba(255,255,255,0.85); font-weight: 500; }

.icon-btn { background: rgba(255,255,255,0.12); color: var(--color-white); border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; padding: 8px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,0.18); }
/* Ensure close button sits at the top-right of modal */
.modal .icon-btn#registrationClose { position: absolute; top: 12px; right: 12px; z-index: 3; }

.modal-body { font-family: 'Poppins', 'Inter', sans-serif; color: #fff; }
.input-group { margin-bottom: 14px; position: relative; }
.input-group .label { color: rgba(255,255,255,0.95); font-weight: 600; letter-spacing: 0.6px; }
.input-group .label i { color: var(--color-accent); }
.input-group .input { margin-top: 8px; background: rgba(255,255,255,0.92); border: 1px solid rgba(0,0,0,0.08); }
.input-group .input:focus { box-shadow: 0 0 0 3px rgba(179,224,255,0.6); }
.input-group .input-icon { display: none; }
.input-group .input-prefix { position: absolute; left: 44px; top: 50%; transform: translateY(-50%); color: #6b7280; font-weight: 600; }
.input-group input#contact { padding-left: 84px; }
.help { color: rgba(255,255,255,0.85); display: block; margin-top: 6px; }
.status { margin-top: 8px; color: #fef3c7; }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.btn.outline { background: transparent; color: var(--color-white); border: 1px solid rgba(255,255,255,0.4); padding: 10px 14px; border-radius: 10px; }
.btn.outline:hover { background: rgba(255,255,255,0.12); }
.login-btn { background: linear-gradient(180deg, #1f2a37 0%, #0f172a 100%); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 22px rgba(0,0,0,0.35); font-weight: 700; letter-spacing: 0.4px; }
.login-btn:hover { filter: brightness(1.05); }
.login-footer { margin-top: 12px; color: rgba(255,255,255,0.75); font-size: 0.85rem; text-align: center; }

.card.preview-gate { position: relative; overflow: hidden; min-height: clamp(180px, 32vh, 260px); }
.card.preview-gate:hover { transform: none; box-shadow: var(--shadow-md); }
.profile-card { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.profile-avatar { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); color: var(--color-white); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; font-family: 'Bebas Neue', sans-serif; letter-spacing: 2px; box-shadow: var(--shadow-md); }
.profile-header { display: flex; flex-direction: column; gap: 6px; }
.profile-header .name { font-size: 1.4rem; font-weight: 700; color: #2c3e50; }
.profile-header .contact, .profile-header .address { color: #4b5563; }
/* Profile card readability on dark preview gate */
.card.preview-gate .profile-header .name { color: var(--color-white); }
.card.preview-gate .profile-header .contact,
.card.preview-gate .profile-header .address { color: rgba(255,255,255,0.85); }
.profile-details { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.profile-details .item { background: #f9fafb; border-radius: 12px; padding: 12px; }
.profile-details .item h4 { margin: 0 0 6px 0; font-size: 0.95rem; font-weight: 700; color: #374151; }
/* Keep text inside light info tiles legible */
.profile-details .item p { color: #4b5563; }
/* Input prefix styling for +63 in registration modal */
.input-group {
  position: relative;
}
.input-group .input-prefix {
  position: absolute;
  left: 44px; /* after icon */
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 0.95rem;
  pointer-events: none;
}
.input-group input#contact {
  padding-left: 84px; /* accommodate icon + prefix */
}

/* Profile avatar image fit */
.profile-card .profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@media (max-width: 768px) {
  .input-group .input-prefix {
    left: 40px;
    font-size: 0.9rem;
  }
  .input-group input#contact {
    padding-left: 80px;
  }
}
/* Preview Mode card styles */
.preview-card { background: linear-gradient(135deg, rgba(45,62,80,0.92) 0%, rgba(26,37,47,0.96) 100%); color: var(--color-white); border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; box-shadow: 0 14px 28px rgba(0,0,0,0.25); padding: 1.25rem; display: grid; gap: 12px; }
.preview-bar { display: flex; justify-content: flex-end; }
.preview-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.12); color: var(--color-white); border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 6px 10px; font-weight: 700; letter-spacing: 0.4px; }
.preview-content { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; }
.preview-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); }
.preview-icon i { font-size: 1.6rem; color: var(--color-accent); }
.preview-title { margin: 0; font-size: 1.2rem; line-height: 1.35; font-weight: 800; letter-spacing: 0.3px; }
.preview-sub { margin: 6px 0 0; color: rgba(255,255,255,0.85); }
.preview-actions { display: flex; align-items: center; justify-content: flex-end; }

/* Receive Alert button states (usable inside preview card too) */
.btn-alert { transition: all 0.2s ease; }
.btn-alert:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-alert:focus-visible { outline: 3px solid rgba(179,224,255,0.7); outline-offset: 2px; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .preview-content { grid-template-columns: 48px 1fr; }
  .preview-actions { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .preview-card { padding: 1rem; }
  .preview-title { font-size: 1.05rem; }
  .preview-content { grid-template-columns: 1fr; }
  .preview-icon { width: 48px; height: 48px; }
  .preview-actions { justify-content: flex-start; }
}
/* Contact details enhancements */
.contact-details { display: grid; gap: 12px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; }
.contact-item .icon { width: 38px; height: 38px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #eef2ff; color: #2563eb; }
.contact-link { color: #1f2937; font-weight: 600; text-decoration: none; }
.contact-link:hover { color: #111827; text-decoration: underline; }
.contact-link:focus-visible { outline: 3px solid rgba(37,99,235,0.35); outline-offset: 2px; border-radius: 6px; }
.text-muted { color: #6b7280; }

/* Card-scoped overrides to ensure tiles and links look correct on mobile */
.card .contact-details { gap: 12px; }
.card .contact-item { background: #f8fafc; border-color: #e5e7eb; border-radius: 10px; }
.card .contact-item .icon { background: #eef2ff; color: #2563eb; }
.card .contact-link,
.card .contact-link:visited { color: #1f2937; text-decoration: none; font-weight: 600; }
.card .contact-link:hover { color: #111827; text-decoration: underline; }
.card .contact-item small { color: #6b7280; }
@media (max-width: 480px) {
  .card .contact-details { gap: 10px; }
  .card .contact-item { padding: 10px 12px; }
}

/* Dividers and soft section background */
.divider { border: 0; height: 1px; background: linear-gradient(to right, rgba(0,0,0,0), #e5e7eb, rgba(0,0,0,0)); margin: 16px 0; }
.section-soft { background: linear-gradient(180deg, rgba(37,99,235,0.04), rgba(37,99,235,0)); border-radius: 12px; padding: 12px; }

/* About image and gallery */
.about-image { width: 100%; height: auto; border-radius: 12px; object-fit: cover; }
.about-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.gallery-img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; }

/* Team grid */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.team-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: transform .2s ease, box-shadow .2s ease; }
.team-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.team-photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.team-info { padding: 12px; }
.team-name { font-weight: 700; color: #111827; }
.team-role { color: #2563eb; font-weight: 600; margin-top: 4px; }
.team-bio { color: #4b5563; margin-top: 8px; font-size: 0.95rem; line-height: 1.45; }

/* Responsiveness tweaks */
@media (max-width: 640px) {
  .gallery-img { height: 120px; }
  .contact-item { padding: 10px 12px; }
}