/* Bengali Membership Management System — Official Style Sheet */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-dark: #073829;
  --primary: #0d543c;
  --primary-light: #127958;
  --primary-subtle: #e8f5f0;
  --accent-gold: #c59b27;
  --accent-red: #d9383a;
  --accent-blue: #1b75bb;
  --accent-teal: #0d7b5f;
  --text-dark: #16362b;
  --text-muted: #597368;
  --border-color: #d1ded8;
  --bg-light: #edf3f0;
  --card-bg: #ffffff;
  --sidebar-w: 240px;
  --header-h: 76px;
}

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

body {
  font-family: 'Noto Sans Bengali', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ====================================================
   TOPBAR / HEADER
==================================================== */
.topbar {
  height: var(--header-h);
  background: linear-gradient(135deg, #073829 0%, #0d543c 55%, #08402f 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  z-index: 50;
  overflow: hidden;
}

.topbar-bg-pattern {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 500px;
  background-image: url('header_pattern.svg');
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
  pointer-events: none;
  opacity: 0.25;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  display: block;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
  color: #c4ecd9;
  font-size: 13.5px;
  font-weight: 400;
  margin-top: 2px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.lang-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
  border: none;
  background: transparent;
  color: #e2f4ed;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.user-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px 5px 6px;
  border-radius: 24px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.user-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.user-name-label {
  font-size: 14.5px;
  font-weight: 600;
}

/* ====================================================
   APP SHELL & SIDEBAR
==================================================== */
.app-shell {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  width: var(--sidebar-w);
  background-color: #093325;
  background-image: linear-gradient(180deg, #093325 0%, #06261b 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  gap: 6px;
  flex-shrink: 0;
  border-right: 1px solid #052016;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 8px;
  color: #cbe3d9;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link svg, .nav-link i {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-link.active {
  background-color: #0e7351;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 4px;
  font-size: 13px;
  color: #88aba0;
  line-height: 1.6;
  text-align: center;
}

/* ====================================================
   MAIN CONTENT CONTAINER
==================================================== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  overflow-x: hidden;
}

/* Alerts */
.app-alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.app-alert.success {
  background: #e7f7ee;
  color: #0b633b;
  border: 1px solid #b7e8cd;
}

.app-alert.error {
  background: #fdf0f0;
  color: #aa2426;
  border: 1px solid #f7c3c5;
}

/* ====================================================
   CARD / PANEL SYSTEM
==================================================== */
.system-card {
  background: var(--card-bg);
  border-radius: 10px;
  border: 1px solid #dce8e3;
  box-shadow: 0 2px 10px rgba(13, 84, 60, 0.05);
  margin-bottom: 22px;
  overflow: hidden;
}

.card-header-banner {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7f0ec;
  background: #fafcfb;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary-subtle);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.card-title-text {
  font-size: 18.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
}

.card-body-wrapper {
  padding: 20px;
}

/* ====================================================
   REGISTRATION + LIVE CARD LAYOUT
==================================================== */
.registration-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}

/* 3-Column Form Grid */
.member-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 16px;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-group label {
  font-size: 14px;
  font-weight: 600;
  color: #274b3d;
}

.form-field-group label em {
  color: var(--accent-red);
  font-style: normal;
  margin-left: 2px;
}

.form-control-input,
.form-control-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14.5px;
  border: 1px solid #cad9d2;
  border-radius: 6px;
  background: #ffffff;
  color: #1a3329;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control-input:focus,
.form-control-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(18, 121, 88, 0.15);
}

.form-control-input[readonly] {
  background-color: #f3f7f5;
  color: #617b70;
  cursor: not-allowed;
}

/* Photo Upload Box */
.photo-dropzone-box {
  border: 1.5px dashed #9fbfb3;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fafdfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  min-height: 48px;
}

.photo-dropzone-box:hover {
  border-color: var(--primary);
  background: #f0f7f4;
}

.photo-dropzone-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.photo-dropzone-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #3b6152;
}

.photo-dropzone-content svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

/* Form Action Buttons */
.form-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.btn-submit-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit-save:hover {
  background: #09402e;
}

.btn-form-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #436155;
  border: 1px solid #cad8d1;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-form-reset:hover {
  background: #f0f5f3;
  color: var(--primary-dark);
}

/* ====================================================
   LIVE MEMBER CARD PREVIEW
==================================================== */
.live-card-container {
  background: #f3f8f5;
  border: 1px solid #dce8e2;
  border-radius: 10px;
  padding: 20px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.live-card-watermark {
  position: absolute;
  right: -25px;
  bottom: -25px;
  width: 170px;
  height: 170px;
  background-image: url('mandala.svg');
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.15;
  pointer-events: none;
}

.card-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.card-avatar-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(13, 84, 60, 0.15);
  background: #dbeef3;
}

.card-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  position: relative;
  z-index: 2;
}

.card-details-table tr {
  line-height: 1.85;
}

.card-details-table td.field-title {
  color: #4b6b5e;
  font-weight: 500;
  width: 105px;
  white-space: nowrap;
  font-size: 13.5px;
}

.card-details-table td.field-colon {
  width: 16px;
  text-align: center;
  color: #7a9489;
}

.card-details-table td.field-value {
  color: #17382d;
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
}

/* ====================================================
   MEMBER LIST DIRECTORY & FILTERS
==================================================== */
.filter-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 130px;
}

.filter-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: #3b5f51;
}

.filter-search-group {
  flex: 2;
  min-width: 220px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-search-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-search-submit:hover {
  background: #09402e;
}

/* Full 17-Column Data Table */
.data-table-scroll-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #dce8e2;
  background: #ffffff;
}

.members-master-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}

.members-master-table thead {
  background-color: #0c4f39;
  color: #ffffff;
}

.members-master-table th {
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.members-master-table th:last-child {
  border-right: none;
}

.members-master-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eaf0ed;
  border-right: 1px solid #f2f7f4;
  color: #243e33;
  font-size: 14px;
}

.members-master-table tr:hover {
  background-color: #f4faf7;
}

.table-row-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid #cad8d1;
  background: #e8f2ee;
}

.table-code-badge {
  font-weight: 700;
  color: var(--primary);
  background: #eaf5f0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
}

/* Action Button Pills */
.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action-icon {
  width: 32px;
  height: 30px;
  border-radius: 6px;
  border: none;
  display: grid;
  place-items: center;
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.15s;
  font-size: 14px;
}

.btn-action-icon:hover {
  opacity: 0.85;
}

.btn-action-icon svg {
  pointer-events: none;
}

.btn-action-icon.view {
  background: var(--accent-teal);
}

.btn-action-icon.edit {
  background: var(--accent-blue);
}

.btn-action-icon.delete {
  background: var(--accent-red);
}

.btn-action-icon.card {
  background: var(--accent-gold);
}

/* Status Badge */
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.status-pill.active {
  background: #e2f7ed;
  color: #0b7345;
}

.status-pill.inactive {
  background: #fdf0f0;
  color: #c02d2f;
}

/* ====================================================
   DASHBOARD STATS CARDS
==================================================== */
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric-stat-card {
  background: #ffffff;
  border: 1px solid #dce8e2;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.metric-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.metric-stat-icon.green {
  background: #e6f6ee;
  color: #0e7351;
}

.metric-stat-icon.blue {
  background: #e7f2fa;
  color: #1b75bb;
}

.metric-stat-icon.amber {
  background: #fdf5e6;
  color: #c59b27;
}

.metric-stat-icon.red {
  background: #fdf0f0;
  color: #d9383a;
}

.metric-stat-info small {
  display: block;
  color: #637d73;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 4px;
}

.metric-stat-info strong {
  font-size: 26px;
  color: #0a4330;
  font-weight: 700;
  line-height: 1;
}

/* ====================================================
   PRINTABLE ID CARD / CERTIFICATE STYLES
==================================================== */
.id-card-frame {
  width: 380px;
  height: 240px;
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid #0d543c;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  margin: 30px auto;
  padding: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.id-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #0d543c;
  padding-bottom: 8px;
}

.id-card-header img {
  width: 38px;
  height: 38px;
}

.id-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #0d543c;
  line-height: 1.2;
}

.id-card-body {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  flex: 1;
}

.id-card-photo {
  width: 72px;
  height: 84px;
  border-radius: 6px;
  border: 1px solid #9dc2b5;
  object-fit: cover;
}

.id-card-info-table {
  font-size: 11px;
  line-height: 1.5;
}

/* ====================================================
   LOGIN SCREEN
==================================================== */
.login-screen-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, #cdeee1 0%, #e8f5f0 40%, #d8eae3 100%);
  padding: 24px;
}

.login-auth-box {
  width: min(100%, 420px);
  background: #ffffff;
  border-radius: 16px;
  padding: 36px 32px;
  border: 1px solid #d4e4dd;
  box-shadow: 0 20px 60px rgba(6, 56, 39, 0.15);
  text-align: center;
}

.login-seal-img {
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
  display: block;
}

.login-auth-box h1 {
  font-size: 20px;
  color: #0d543c;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-auth-box p {
  color: #617d73;
  font-size: 12.5px;
  margin-bottom: 24px;
}

/* ====================================================
   RESPONSIVE BREAKPOINTS
==================================================== */
@media (max-width: 1100px) {
  .registration-container {
    grid-template-columns: 1fr;
  }
  .live-card-container {
    max-width: 440px;
    margin: 0 auto;
  }
  .dashboard-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .sidebar {
    width: 64px;
    padding: 12px 6px;
  }
  .nav-link span, .sidebar-footer {
    display: none;
  }
  .nav-link {
    justify-content: center;
    padding: 12px 0;
  }
  .brand-subtitle {
    display: none;
  }
  .brand-title {
    font-size: 15px;
  }
  .member-form-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-metrics-grid {
    grid-template-columns: 1fr;
  }
  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ====================================================
   PAGINATION STYLES & CONSTRAINTS
==================================================== */
nav[role="navigation"] {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  padding: 8px 0 !important;
  font-size: 13px !important;
  width: 100% !important;
}

nav[role="navigation"] svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

nav[role="navigation"] > div:first-child {
  display: none !important;
}

nav[role="navigation"] > div:last-child {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

nav[role="navigation"] a,
nav[role="navigation"] span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 26px !important;
  height: 26px !important;
  padding: 0 7px !important;
  border-radius: 5px !important;
  border: 1px solid #c8dcd2 !important;
  background: #ffffff !important;
  color: var(--text-dark) !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

nav[role="navigation"] a:hover {
  background: #e9f4ef !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] span[aria-current="page"] {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
}

@media print {
  .topbar, .sidebar, .filter-toolbar, .table-actions-cell, .form-actions-toolbar, .pagination-box {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  .main-content {
    padding: 0;
  }
  .system-card {
    box-shadow: none;
    border: none;
  }
}
