/* =============================================
   E-KOINONIA — COMPLETE CSS
   styles.css + themes.css merged
   Pink → Orange gradient theme
   Mobile-first
============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =============================================
   CSS VARIABLES (themes)
============================================= */

:root {
  --pink:       #b0196b;
  --orange:     #f08b1d;
  --gradient:   linear-gradient(135deg, #b0196b 0%, #f08b1d 100%);

  --bg:         #f4f1f8;
  --card:       #ffffff;
  --border:     #ede8f2;
  --input-bg:   #faf8fc;

  --text:       #1a1535;
  --muted:      #6b6488;
  --light:      #b0a8c8;

  --shadow-sm:  0 2px 10px rgba(176,25,107,.07);
  --shadow-md:  0 8px 28px rgba(176,25,107,.11);
  --shadow-lg:  0 20px 50px rgba(176,25,107,.15);
  --glow:       0 8px 24px rgba(176,25,107,.30);

  --r-sm:  12px;
  --r-md:  18px;
  --r-lg:  24px;
  --r-xl:  32px;

  --sidebar: 265px;
  --ease:    .22s cubic-bezier(.4,0,.2,1);
}

/* =============================================
   RESET
============================================= */

*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   SCROLLBAR
============================================= */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gradient);
  border-radius: 20px;
}

/* =============================================
   LAYOUT
============================================= */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
============================================= */

.sidebar {
  width: var(--sidebar);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 14px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--ease);
}

.sidebar-logo {
  text-align: center;
  padding: 8px 0 28px;
}

.logo-icon {
  width: 62px;
  height: 62px;
  background: var(--gradient);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  margin: 0 auto 14px;
  box-shadow: var(--glow);
}

.sidebar-logo h2 {
  font-size: 19px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.sidebar-logo p {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 15px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--ease);
  text-align: left;
  font-family: inherit;
}

.menu-item i {
  font-size: 17px;
  width: 20px;
  flex-shrink: 0;
}

.menu-item:hover {
  background: #fdf0f7;
  color: var(--pink);
  transform: translateX(3px);
}

.menu-item.active {
  background: var(--gradient);
  color: white;
  box-shadow: var(--glow);
}

.logout-btn {
  width: 100%;
  border: none;
  background: #fff0f7;
  color: var(--pink);
  padding: 12px 15px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: all var(--ease);
}

.logout-btn:hover {
  background: var(--gradient);
  color: white;
  box-shadow: var(--glow);
}

/* =============================================
   MAIN CONTENT
============================================= */

.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  min-height: 100vh;
}

/* =============================================
   TOPBAR
============================================= */

.topbar {
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}

.topbar-left h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.topbar-left p {
  font-size: 13.5px;
  color: var(--muted);
}

/* =============================================
   STAT CARDS
============================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--ease);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.clickable-card { cursor: pointer; }

.stat-card .s-icon {
  width: 46px;
  height: 46px;
  background: var(--gradient);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: white;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-card h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

.stat-card h2 {
  font-size: 30px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   SECTION CARDS
============================================= */

.table-section {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

/* =============================================
   FORM ELEMENTS
============================================= */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 16px;
}

.member-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  margin-bottom: 13px;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(176,25,107,.09);
  background: white;
}

input::placeholder, textarea::placeholder { color: var(--light); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6488' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* =============================================
   BUTTONS
============================================= */

.add-btn, .save-btn, .action-btn, .login-btn {
  border: none;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-btn:hover, .save-btn:hover,
.action-btn:hover, .login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.cancel-btn {
  border: none;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: #f2eef8;
  color: var(--muted);
  transition: all var(--ease);
}

.cancel-btn:hover { background: #e8e2f2; }

.delete-btn {
  border: none;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: #ffeef6;
  color: var(--pink);
  transition: all var(--ease);
}

.delete-btn:hover { background: var(--pink); color: white; }

.modal-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* =============================================
   TABLES
============================================= */

.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 580px; }

thead tr {
  background: linear-gradient(135deg, #fdf0f7 0%, #fff7ed 100%);
}

table th {
  padding: 13px 15px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--border);
}

table td {
  padding: 13px 15px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr:hover { background: #fdf8ff; }
tbody tr:last-child td { border-bottom: none; }

/* =============================================
   BADGES
============================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-active   { background: #ecfdf5; color: #065f46; }
.badge-inactive { background: #fef2f2; color: #991b1b; }
.badge-pending  { background: #fffbeb; color: #92400e; }

/* =============================================
   MODALS
============================================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(26,21,53,.52);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 460px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .25s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.9) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 22px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   LOGIN PAGE
============================================= */

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #fdf2f8 0%, #fff7ed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176,25,107,.10) 0%, transparent 70%);
  top: -150px; left: -150px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: fixed;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,139,29,.09) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  pointer-events: none;
}

.login-container {
  width: 420px;
  max-width: 100%;
  background: white;
  border-radius: var(--r-xl);
  padding: 44px 38px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(176,25,107,.07);
  position: relative;
  z-index: 1;
  animation: fadeUp .4s var(--ease);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo { text-align: center; margin-bottom: 30px; }

.logo-circle {
  width: 78px; height: 78px;
  background: var(--gradient);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  margin: 0 auto 15px;
  box-shadow: var(--glow);
}

.login-logo h1 {
  font-size: 27px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.login-logo p { font-size: 13px; color: var(--muted); }

.portal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  background: #f2eef8;
  padding: 5px;
  border-radius: var(--r-md);
}

.portal-tab {
  flex: 1;
  border: none;
  padding: 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all var(--ease);
}

.portal-tab.active {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  border-radius: var(--r-md);
  margin-top: 4px;
}

.member-link {
  color: var(--pink);
  font-weight: 600;
  text-decoration: none;
  font-size: 13.5px;
}

.member-link:hover { text-decoration: underline; }

/* =============================================
   DIAMOND ICON CARDS (screenshot style)
============================================= */

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.feature-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--ease);
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.diamond-wrap {
  width: 64px; height: 64px;
  background: var(--gradient);
  border-radius: 16px;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: var(--glow);
}

.diamond-wrap i {
  transform: rotate(-45deg);
  font-size: 22px;
  color: white;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-card .divider {
  width: 36px; height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  margin: 0 auto 12px;
}

.feature-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

/* =============================================
   ATTENDANCE
============================================= */

.attendance-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--ease);
  user-select: none;
}

.present {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 10px rgba(16,185,129,.28);
}

.absent {
  background: #fef2f2;
  color: #ef4444;
  border: 1.5px solid #fecaca;
}

.attendance-cell:hover { opacity: .8; transform: scale(.94); }

table.attendance-sheet th,
table.attendance-sheet td { text-align: center; }

table.attendance-sheet th:first-child,
table.attendance-sheet td:first-child {
  text-align: left;
  min-width: 150px;
}

/* =============================================
   PROFILE GRID & CARDS
============================================= */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.profile-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.profile-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 15px;
  padding-bottom: 11px;
  border-bottom: 1.5px solid var(--border);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-card p {
  font-size: 14px;
  margin-bottom: 9px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.profile-card p b {
  color: var(--muted);
  font-weight: 600;
  min-width: 90px;
  flex-shrink: 0;
}

/* =============================================
   FOLDER CARDS
============================================= */

.folder-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  background: var(--gradient);
  color: white;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}

.folder-card:hover { transform: translateY(-3px); box-shadow: var(--glow); }
.folder-card i { font-size: 18px; }

/* =============================================
   CHART CARDS
============================================= */

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.chart-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.chart-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.chart-card canvas { width: 100% !important; height: 200px !important; }

/* =============================================
   PAGE SECTIONS
============================================= */

.page-section { display: none; }

/* =============================================
   MOBILE HAMBURGER
============================================= */

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,21,53,.4);
  z-index: 99;
}

/* =============================================
   TOAST NOTIFICATION
============================================= */

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  padding: 13px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  color: white;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.toast.show  { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--gradient); }
.toast.error   { background: linear-gradient(135deg, #dc2626, #f87171); }

/* =============================================
   EMPTY STATE
============================================= */

.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}

.empty-state i {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
  opacity: .25;
}

.empty-state p { font-size: 14px; }

/* =============================================
   RESPONSIVE — TABLETS (≤ 992px)
============================================= */

@media (max-width: 992px) {

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    transition: left .28s cubic-bezier(.4,0,.2,1);
  }

  .sidebar.mobile-open { left: 0; }

  .sidebar-overlay.visible { display: block; }

  .main-content { width: 100%; padding: 20px 16px; }

  .hamburger { display: flex; align-items: center; justify-content: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .chart-grid { grid-template-columns: 1fr; }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 768px)
============================================= */

@media (max-width: 768px) {

  .main-content { padding: 16px 14px; }

  .topbar-left h1 { font-size: 22px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .stat-card { padding: 18px; }

  .stat-card h2 { font-size: 26px; }

  .table-section { padding: 18px 16px; }

  .modal-content { padding: 24px 20px; border-radius: 24px; }

  .modal-buttons { flex-direction: column; }

  .modal-buttons .add-btn,
  .modal-buttons .save-btn,
  .modal-buttons .cancel-btn { width: 100%; justify-content: center; }

  .feature-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .profile-grid { grid-template-columns: 1fr; }

  .login-container { padding: 32px 24px; border-radius: 28px; }
}

/* =============================================
   RESPONSIVE — SMALL MOBILE (≤ 480px)
============================================= */

@media (max-width: 480px) {

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .stat-card { padding: 16px; }
  .stat-card h2 { font-size: 22px; }
  .stat-card h3 { font-size: 11px; }
  .stat-card .s-icon { width: 38px; height: 38px; font-size: 16px; }

  .section-header h2 { font-size: 16px; }

  .portal-tabs { flex-direction: column; }

  .feature-cards { grid-template-columns: 1fr; }

  .folder-container { flex-direction: column; }
  .folder-card { width: 100%; justify-content: center; }

  .topbar-left h1 { font-size: 20px; }

  .toast { left: 14px; right: 14px; bottom: 16px; max-width: unset; }
}