* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Ubuntu', sans-serif;
}

body {
  background-color: #f5f0eb;
  color: #1a1a1a;
  line-height: 1.5;
}

a { text-decoration: none; }

/* ========================= */
/* AUTH PAGES                */
/* ========================= */

.portal-auth-bg {
  position: fixed;
  inset: 0;
  background: url("../../images/dzid.jpg") center/cover no-repeat;
  filter: blur(2px);
  z-index: -1;
}

.portal-auth-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 20px;
}

.portal-auth-card {
  width: 100%;
  max-width: 900px;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

/* LEFT PANEL */
.portal-auth-left {
  flex: 1;
  background: linear-gradient(160deg, #4B3619 0%, #2d1f0d 100%);
  color: #fff;
  padding: 50px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-auth-logo {
  width: 140px;
  margin-bottom: 20px;
}

.portal-auth-left h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}

.portal-auth-left p {
  font-size: 14px;
  color: #c9b99a;
  line-height: 1.6;
  margin-bottom: 32px;
}

.portal-auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #e8d8c0;
}

.feature-item i {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* RIGHT PANEL */
.portal-auth-right {
  flex: 1.3;
  padding: 40px 44px;
  overflow-y: auto;
  max-height: 90vh;
}

/* TABS */
.portal-auth-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.portal-auth-tabs a {
  color: #545454;
  font-weight: 600;
  font-size: 14px;
}

.portal-auth-tabs a.active {
  color: #4B3619;
  border-bottom: 2px solid #4B3619;
  padding-bottom: 4px;
}

/* FORM */
.portal-auth-form h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 13.5px;
  color: #545454;
  margin-bottom: 24px;
  line-height: 1.5;
}

.portal-form-group {
  margin-bottom: 16px;
}

.portal-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #545454;
}

.portal-form-group input,
.portal-form-group select,
.portal-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: 'Ubuntu', sans-serif;
  transition: border 0.2s;
  background: #fff;
}

.portal-form-group input:focus,
.portal-form-group select:focus {
  outline: none;
  border-color: #4B3619;
}

.portal-form-row {
  display: flex;
  gap: 16px;
  
}

.portal-form-row .portal-form-group {
  flex: 1;
}

.req { color: #c62828; }

/* SUBSCRIPTION TYPE CARDS */
.sub-type-selector {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.sub-type-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sub-type-card input[type="radio"] { display: none; }

.sub-type-card i {
  font-size: 24px;
  color: #999;
  margin-bottom: 4px;
}

.sub-type-card span {
  font-weight: 700;
  font-size: 14px;
  color: #333;
}

.sub-type-card small {
  font-size: 12px;
  color: #999;
}

.sub-type-card.active,
.sub-type-card:has(input:checked) {
  border-color: #4B3619;
  background: #fdf6f0;
}

.sub-type-card.active i,
.sub-type-card:has(input:checked) i {
  color: #4B3619;
}

/* CHECKBOX */
.portal-form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #555;
  margin: 16px 0;
  line-height: 1.5;
}

.portal-form-check input {
  margin-top: 2px;
  flex-shrink: 0;
}

/* BUTTONS */
.portal-btn-primary {
  width: 100%;
  padding: 12px;
  background: #4B3619;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.portal-btn-primary:hover { background: #3a2812; }

.portal-btn-secondary {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #4B3619;
  border: 2px solid #4B3619;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.portal-btn-secondary:hover {
  background: #4B3619;
  color: #fff;
}

.portal-login-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13.5px;
  color: #888;
}

.portal-login-link a {
  color: #4B3619;
  font-weight: 600;
}

/* ALERTS */
.portal-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13.5px;
}

.portal-alert i { font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.portal-alert p { margin: 2px 0; }
.portal-alert strong { display: block; margin-bottom: 4px; }

.portal-alert-error {
  background: #fdecea;
  border-left: 4px solid #e53935;
  color: #c62828;
}

.portal-alert-success {
  background: #e8f5e9;
  border-left: 4px solid #43a047;
  color: #2e7d32;
}

.portal-alert-warning {
  background: #fff8e1;
  border-left: 4px solid #f9a825;
  color: #e65100;
}

/* ========================= */
/* PORTAL DASHBOARD LAYOUT   */
/* ========================= */

.portal-layout {
  display: flex;
  min-height: 100vh;
  background: #f5f0eb;
}

/* SIDEBAR */
.portal-sidebar {
  width: 260px;
  background: #2d1f0d;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.portal-sidebar-brand {
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items:center;
}

.portal-sidebar-brand img {
  width: 105px;
  margin-bottom: 6px;
  display: block;
}

.portal-sidebar-brand h4 {
  font-size: 13px;
  color: #c9b99a;
  font-weight: 500;
}

.portal-sidebar-brand strong {
  font-size: 16px;
  color: #fff;
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.portal-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.portal-nav-section {
  padding: 10px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.668);
}

.portal-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: #d8d2c5;
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
}

.portal-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.portal-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-right: 3px solid #c9b99a;
}

.portal-nav a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.portal-nav-badge {
  margin-left: auto;
  background: #c62828;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.portal-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.portal-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c9b99a;
  font-size: 13.5px;
  transition: color 0.2s;
}

.portal-sidebar-footer a:hover { color: #fff; }

/* MAIN CONTENT */
.portal-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.portal-topbar {
  background: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ece8e0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-topbar-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.portal-topbar-left p {
  font-size: 13px;
  color: #3a3a3a;
  margin-top: 2px;
}

.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-date-badge {
  background: #f5f0eb;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: #4B3619;
  font-weight: 600;
}

/* CONTENT AREA */
.portal-content {
  padding: 28px 32px;
  flex: 1;
}

/* STAT CARDS */
.portal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.portal-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #ece8e0;
}

.portal-stat-card .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #3a3a3a;
  margin-bottom: 8px;
}

.portal-stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.portal-stat-card .stat-sub {
  font-size: 12px;
  color: #3a3a3a;
}

.portal-stat-card.highlight .stat-value { color: #4B3619; }
.portal-stat-card.danger .stat-value    { color: #c62828; }
.portal-stat-card.success .stat-value   { color: #2e7d32; }

/* CARDS */
.portal-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #ece8e0;
  margin-bottom: 20px;
}

.portal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.portal-card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

.portal-card-header p {
  font-size: 12px;
  color: #545454;
  margin-top: 2px;
}

/* PROGRESS BAR */
.portal-progress-bar {
  background: #ece8e0;
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0;
}

.portal-progress-fill {
  height: 100%;
  background: #4B3619;
  border-radius: 20px;
  transition: width 0.5s ease;
}

.portal-progress-fill.danger { background: #c62828; }
.portal-progress-fill.warning { background: #f9a825; }

/* MONTH GRID */
.month-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.month-pill {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  gap: 2px;
}

.month-pill .month-name { font-size: 10px; font-weight: 600; }
.month-pill .month-icon { font-size: 14px; }

.month-pill.paid     { background: #4B3619; color: #fff; }
.month-pill.pending  { background: #fff8e1; color: #e65100; border: 2px solid #f9a825; }
.month-pill.late     { background: #fdecea; color: #c62828; border: 2px solid #e53935; }
.month-pill.rejected { background: #fdecea; color: #c62828; border: 2px solid #e53935; }
.month-pill.upcoming { background: #f5f0eb; color: #aaa; border: 2px solid #ddd; }
.month-pill.due      { background: #fff3e0; color: #e65100; border: 2px solid #ffa726; }

/* LEGEND */
.month-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.paid     { background: #4B3619; }
.legend-dot.pending  { background: #f9a825; }
.legend-dot.late     { background: #e53935; }
.legend-dot.upcoming { background: #ddd; }
.legend-dot.due      { background: #ffa726; }

/* ALERT BANNER */
.portal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 14px;
}

.portal-banner.danger {
  background: #c62828;
  color: #fff;
}

.portal-banner.warning {
  background: #e65100;
  color: #fff;
}

.portal-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-banner a {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.portal-banner a:hover { background: rgba(255,255,255,0.3); }

/* TABLES */
.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.portal-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #545454;
  border-bottom: 1px solid #ece8e0;
}

.portal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f5f0eb;
  color: #333;
}

.portal-table tr:last-child td { border-bottom: none; }
.portal-table tr:hover td { background: #fdf8f3; }

/* STATUS BADGES */
.portal-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.portal-badge.paid     { background: #e8f5e9; color: #2e7d32; }
.portal-badge.pending  { background: #fff8e1; color: #e65100; }
.portal-badge.late     { background: #fdecea; color: #c62828; }
.portal-badge.rejected { background: #fdecea; color: #c62828; }
.portal-badge.upcoming { background: #f5f0eb; color: #545454; }
.portal-badge.active   { background: #e8f5e9; color: #2e7d32; }
.portal-badge.due      { background: #fff3e0; color: #e65100; }

/* SUMMARY TABLE */
.portal-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.portal-summary-table td {
  padding: 10px 4px;
  border-bottom: 1px solid #f5f0eb;
  vertical-align: middle;
}

.portal-summary-table td:first-child {
  color: #545454;
  width: 140px;
  font-size: 13px;
}

.portal-summary-table td:first-child i {
  width: 16px;
  color: #4B3619;
  margin-right: 6px;
}

.portal-summary-table td:last-child {
  font-weight: 600;
  color: #1a1a1a;
}

.portal-summary-table tr:last-child td {
  border-bottom: none;
}

/* PORTAL ROLE LABEL */
.portal-nav-role {
  font-size: 12px;
  color: #ddd7cb;
  display: block;
  font-weight: 600px;
  
}

/* ACTION BUTTON */
.portal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #4B3619;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}

.portal-action-btn:hover {
  background: #3a2812;
  color: #fff;
}

/* ========================= */
/* UPLOAD PAYMENT PAGE       */
/* ========================= */

.upload-step {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.upload-step-number {
  width: 32px;
  height: 32px;
  background: #4B3619;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.upload-step-content {
  flex: 1;
}

/* DROPZONE */
.upload-dropzone {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.upload-dropzone:hover {
  border-color: #4B3619;
  background: #fdf6f0;
}

.upload-dropzone-icon {
  font-size: 36px;
  color: #4B3619;
  margin-bottom: 12px;
  display: block;
}

/* FILE PREVIEW */
.file-preview-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f5f0eb;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #4B3619;
  font-weight: 600;
}

/* WHAT HAPPENS NEXT */
.what-next-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.what-next-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: #c9b99a;
  line-height: 1.5;
}

.what-next-num {
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* UPLOAD HISTORY */
.upload-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.upload-history-item {
  padding: 14px 0;
  border-bottom: 1px solid #f5f0eb;
}

.upload-history-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* MEMBER AVATAR */
.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #4B3619;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ========================= */
/* PORTAL MODAL              */
/* ========================= */

.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.portal-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}



/* ========================= */
/* RESPONSIVE — PORTAL       */
/* ========================= */

.portal-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 2000;
  width: 40px;
  height: 40px;
  background: #4B3619;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.portal-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.portal-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.portal-toggle.active span:nth-child(2) { opacity: 0; }
.portal-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.portal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1500;
}

.portal-overlay.active { display: block; }

@media (max-width: 1024px) {
  .portal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .portal-toggle { display: flex; }

  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
  }

  .portal-sidebar.open {
    transform: translateX(0);
  }

  .portal-main {
    margin-left: 0;
    width: 100%;
  }

  .portal-topbar {
    padding: 14px 16px 14px 68px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .portal-topbar-left h1 { font-size: 16px; }
  .portal-topbar-left p  { font-size: 12px; }
  .portal-date-badge     { display: none; }
  .portal-content        { padding: 16px; }

  .portal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .portal-stat-card        { padding: 14px; }
  .portal-stat-card .stat-value { font-size: 20px; }
  .portal-card             { padding: 16px; overflow-x: auto; }
  .portal-table            { min-width: 560px; }

  .month-grid  { gap: 5px; }
  .month-pill  { width: 42px; height: 42px; }

  .portal-auth-card {
    flex-direction: column;
    max-width: 100%;
    border-radius: 12px;
  }

  .portal-auth-left { padding: 24px 20px; }
  .portal-auth-left .portal-auth-features { display: none; }
  .portal-auth-right { padding: 24px 20px; max-height: none; }

  .sub-type-selector  { flex-direction: column; }
  .portal-form-row    { flex-direction: column; gap: 0; }

  .portal-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .portal-modal-box {
    padding: 20px 16px;
    margin: 0 12px;
    max-width: calc(100% - 24px);
  }

  .upload-dropzone { padding: 20px 12px; }
}

@media (max-width: 480px) {
  .portal-stats-grid { grid-template-columns: 1fr; }
  .portal-topbar-left h1 { font-size: 15px; }
  .portal-auth-left  { padding: 16px; }
  .portal-auth-right { padding: 16px; }
}
