/* ==========================================================================
   POONKURICHI TRUST - PORTAL & DASHBOARD STYLESHEET
   Admin CMS, Major Donor Portal, CSR Portal, and Printable Receipts
   ========================================================================== */

/* Portal Body & Layout */
body.portal-body {
  background-color: #F4F7F4;
  color: #24312B;
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.portal-sidebar {
  width: 270px;
  background-color: #123B2A;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,0.15);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #C8A96B, #967638);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0A2419;
  font-size: 1.15rem;
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-tag {
  font-size: 0.7rem;
  color: #C8A96B;
  font-weight: 600;
}

.sidebar-nav {
  padding: 1rem 0;
  list-style: none;
  flex-grow: 1;
}

.sidebar-heading {
  font-size: 0.6875rem;
  font-weight: 800;
  color: #C8A96B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.25rem 0.35rem;
  opacity: 0.9;
}

.sidebar-item {
  margin-bottom: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  color: #D1DFD8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.sidebar-link:hover, .sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-left-color: #C8A96B;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: #C8A96B;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #0A2419;
}

.user-badge-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-initials {
  width: 36px;
  height: 36px;
  background-color: #1B5E43;
  color: #C8A96B;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-info-text {
  flex-grow: 1;
  overflow: hidden;
}

.user-display-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FFFFFF;
}

.user-role-label {
  font-size: 0.7rem;
  color: #C8A96B;
}

/* Main Content Area */
.portal-main {
  margin-left: 270px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top App Bar */
.portal-topbar {
  background-color: #FFFFFF;
  height: 65px;
  border-bottom: 1px solid #E2E8DF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #123B2A;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-portal-outline {
  background: transparent;
  border: 1px solid #BBD2C5;
  color: #1B5E43;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: 0.15s;
}

.btn-portal-outline:hover {
  background-color: #F1F5EF;
  border-color: #1B5E43;
}

.btn-portal-primary {
  background: #1B5E43;
  color: #FFFFFF;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: 0.15s;
}

.btn-portal-primary:hover {
  background: #123B2A;
}

/* Dashboard Body View */
.portal-content {
  padding: 2rem;
  flex-grow: 1;
}

/* KPI Metric Cards */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid #E2E8DF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-meta-title {
  font-size: 0.8125rem;
  color: #68776D;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.kpi-value-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: #123B2A;
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: #8E9E94;
  margin-top: 0.35rem;
}

.kpi-icon-emblem {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.kpi-icon-green { background: #E8F5E9; color: #1B5E20; }
.kpi-icon-gold  { background: #FFF8E1; color: #B59353; }
.kpi-icon-blue  { background: #E1F5FE; color: #0288D1; }
.kpi-icon-purple{ background: #F3E5F5; color: #7B1FA2; }

/* 10-Dimensions Financial Grid (Section 16) */
.financial-dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fin-dim-box {
  background: #F8FAF6;
  border: 1px solid #E2E8DF;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.fin-dim-label {
  font-size: 0.75rem;
  color: #68776D;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.fin-dim-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #123B2A;
  font-family: monospace;
}

/* Card Containers */
.portal-card {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid #E2E8DF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 2rem;
  overflow: hidden;
}

.portal-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #E2E8DF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #123B2A;
}

.portal-card-body {
  padding: 1.5rem;
}

/* Status Badges */
.badge-status {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-active, .badge-approved, .badge-successful { background: #E8F5E9; color: #1B5E20; }
.badge-pending { background: #FFF8E1; color: #F57F17; }
.badge-declined, .badge-failed { background: #FFEBEE; color: #C62828; }
.badge-ongoing { background: #E0F2F1; color: #00695C; }
.badge-completed { background: #E8EAF6; color: #283593; }

/* Tabs */
.portal-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #E2E8DF;
  margin-bottom: 1.5rem;
}

.portal-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #68776D;
  cursor: pointer;
  transition: 0.15s;
}

.portal-tab-btn:hover {
  color: #1B5E43;
}

.portal-tab-btn.active {
  color: #1B5E43;
  border-bottom-color: #1B5E43;
}

/* Login Page UI */
.login-split-page {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-brand-panel {
  flex: 1;
  background: linear-gradient(145deg, #123B2A 0%, #0A2419 100%);
  color: #FFFFFF;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 3px solid #C8A96B;
}

.login-form-panel {
  flex: 1.2;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-box-container {
  width: 100%;
  max-width: 440px;
}

.role-selector-pills {
  display: flex;
  gap: 0.4rem;
  background: #F1F5EF;
  padding: 0.35rem;
  border-radius: 8px;
  margin-bottom: 1.75rem;
}

.role-pill-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.5rem 0.25rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #68776D;
  cursor: pointer;
  text-align: center;
  transition: 0.15s;
}

.role-pill-btn.active {
  background: #FFFFFF;
  color: #123B2A;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.demo-credentials-box {
  background: #FFFBF2;
  border: 1px dashed #DFC79A;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #614B20;
}

.demo-credentials-box code {
  background: #F2E4C4;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
}

/* Printable Official Receipt Styles */
@media print {
  body {
    background: #FFFFFF !important;
  }
  .no-print {
    display: none !important;
  }
  .receipt-paper {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

.receipt-paper {
  background: #FFFFFF;
  max-width: 780px;
  margin: 2rem auto;
  padding: 2.5rem;
  border-radius: 12px;
  border: 2px solid #123B2A;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  position: relative;
}

.receipt-header-table {
  width: 100%;
  border-bottom: 2px solid #C8A96B;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.receipt-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 5rem;
  font-weight: 900;
  color: rgba(18, 59, 42, 0.04);
  pointer-events: none;
  white-space: nowrap;
}

.receipt-seal-box {
  border: 2px dashed #1B5E43;
  padding: 0.75rem;
  text-align: center;
  border-radius: 8px;
  width: 180px;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: #123B2A;
}

/* Responsive */
@media (max-width: 900px) {
  .portal-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .portal-sidebar.open {
    transform: translateX(0);
  }
  .portal-main {
    margin-left: 0;
  }
  .login-split-page {
    flex-direction: column;
  }
  .login-brand-panel {
    padding: 2rem;
  }
  .login-form-panel {
    padding: 2rem;
  }
}
