/* ==========================================================================
   CMD AYM Admin Portal — Official ALPS v3 Ming Design Language
   Matches gcyouthministries.org & CMD AYM public website seamlessly
   ========================================================================== */

:root {
  --portal-bg: #f4f7f8;
  --portal-surface: #ffffff;
  --portal-border: #dde4e7;
}

body {
  font-family: var(--font-sans);
  background-color: var(--portal-bg);
  color: var(--alps-gray-900);
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Admin Shell Layout (Full-Width Workspace — Mobile-First, No Sabbath Column)
   -------------------------------------------------------------------------- */
.p-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--portal-bg);
}

.p-sidebar {
  background: var(--alps-ming-darkest);
  color: var(--alps-white);
  width: 268px;
  max-width: 86vw;
  height: 100vh;
  height: 100dvh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.p-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   ALPS Admin Sidebar Navigation
   -------------------------------------------------------------------------- */
.p-nav-group-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--alps-ming-tint);
  padding: 0.9rem 0.9rem 0.35rem;
  opacity: 0.85;
}

.alps-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.95rem;
  border-radius: 4px;
  border-left: 3px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.84);
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.alps-nav-link i {
  width: 16px;
  text-align: center;
  color: var(--alps-ming-tint);
  transition: color 0.18s ease;
}

.alps-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--alps-white);
}

.alps-nav-link.is-active {
  background: var(--alps-ming);
  border-left-color: var(--alps-gold);
  color: var(--alps-white);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.alps-nav-link.is-active i {
  color: var(--alps-white);
}

/* --------------------------------------------------------------------------
   ALPS Admin Cards, Banners, Buttons, Filters & Tables
   -------------------------------------------------------------------------- */
.alps-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 50, 62, 0.04);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.alps-card--interactive:hover {
  box-shadow: 0 10px 24px rgba(0, 50, 62, 0.09);
  transform: translateY(-2px);
}

.alps-card--accent {
  border-top: 3px solid var(--alps-ming);
}

/* Editorial ALPS Hero Strip inside Dashboard/Views */
.p-banner {
  background: linear-gradient(108deg, var(--alps-ming-darkest) 0%, var(--alps-ming-darker) 58%, var(--alps-ming) 100%);
  color: var(--alps-white);
  border-radius: 5px;
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.p-banner__watermark {
  position: absolute;
  right: 1.25rem;
  bottom: -14px;
  width: 118px;
  height: 118px;
  opacity: 0.12;
  pointer-events: none;
  object-fit: contain;
}

.p-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--alps-gray-200);
}

.p-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--alps-ming);
  margin-bottom: 0.2rem;
}

.p-heading {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--alps-ming-darkest);
  line-height: 1.2;
}

/* Signature ALPS Outlined & Filled Pill Buttons */
.alps-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--alps-ming);
  color: var(--alps-white);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.62rem 1.25rem;
  border-radius: 9999px;
  border: 1.5px solid var(--alps-ming);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.alps-btn-primary:hover {
  background: var(--alps-ming-dark);
  border-color: var(--alps-ming-dark);
  transform: translateY(-1px);
}

.alps-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.alps-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--alps-white);
  color: var(--alps-ming);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.56rem 1.1rem;
  border-radius: 9999px;
  border: 1.5px solid var(--alps-ming);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.alps-btn-outline:hover {
  background: var(--alps-ming);
  color: var(--alps-white);
}

.alps-btn-charcoal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #2f3437;
  color: var(--alps-white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.58rem 1.15rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.alps-btn-charcoal:hover {
  background: var(--alps-ming);
}

.alps-filter-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.42rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--alps-gray-300);
  background: var(--alps-white);
  color: var(--alps-gray-700);
  cursor: pointer;
  transition: all 0.16s ease;
}

.alps-filter-pill:hover,
.alps-filter-pill.is-active {
  background: var(--alps-ming);
  border-color: var(--alps-ming);
  color: var(--alps-white);
}

/* Inputs & Tables (Mobile-First Touch & iOS Zoom Prevention) */
.alps-input {
  width: 100%;
  min-height: 44px;
  padding: 0.66rem 0.88rem;
  border: 1px solid #c9d4d8;
  border-radius: 4px;
  background: var(--alps-white);
  color: var(--alps-gray-900);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

@media (min-width: 768px) {
  .alps-input {
    min-height: auto;
    font-size: 0.875rem;
  }
}

.alps-input:focus {
  border-color: var(--alps-ming);
  box-shadow: 0 0 0 3px rgba(0, 127, 152, 0.16);
}

/* Prevent tall modal forms from clipping on small mobile screens */
[id$="Modal"] > .alps-card,
[id$="-modal"] > .alps-card {
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.alps-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.alps-table thead th {
  background: var(--alps-ming-darkest);
  color: var(--alps-white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 0.75rem;
  white-space: nowrap;
}

.alps-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--alps-gray-200);
  font-size: 0.84rem;
  color: var(--alps-gray-700);
}

@media (min-width: 640px) {
  .alps-table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    padding: 0.85rem 1rem;
  }
  .alps-table tbody td {
    padding: 0.88rem 1rem;
    font-size: 0.865rem;
  }
}

.alps-table tbody tr:last-child td {
  border-bottom: none;
}

.alps-table tbody tr:hover {
  background: var(--alps-ming-pale);
}

/* Mobile Portal Bottom Quick-Bar (<768px only) */
.p-mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--portal-border);
  box-shadow: 0 -4px 18px rgba(0, 34, 44, 0.08);
  padding: 0.3rem 0.25rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
}

.p-mobile-tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-height: 48px;
  padding: 0.2rem 0.1rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--alps-gray-600);
  background: none;
  border: none;
  border-top: 2px solid transparent;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.p-mobile-tabbar__item i {
  font-size: 1rem;
  line-height: 1;
}

.p-mobile-tabbar__item.is-active,
.p-mobile-tabbar__item:hover {
  color: var(--alps-ming);
  border-top-color: var(--alps-ming);
}

@media (max-width: 767px) {
  .p-banner {
    padding: 1.2rem 1rem;
  }
  .p-heading {
    font-size: 1.22rem;
  }
  .p-footer {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 768px) {
  .p-mobile-tabbar {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--alps-ming-tint);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--alps-ming);
}

/* Print optimization for ZMW Financial & Operational Reports */
@media print {
  .p-sidebar,
  .p-topbar,
  .p-footer,
  .p-mobile-tabbar,
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff !important;
  }
}
