/* ============================================
   EdgeChain Holdings — Client Portal Styles
   ============================================ */

/* --- Portal Layout --- */
.portal-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: 240px; background: var(--primary-dark); color: var(--white);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column; z-index: 50;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo img { height: 28px; filter: brightness(0) invert(1); }
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.6); transition: all 0.2s; text-decoration: none;
}
.sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.sidebar-nav a.active { color: var(--white); background: rgba(255,255,255,0.1); border-left: 3px solid var(--accent); }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 16px; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 20px; }
.sidebar-footer { padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.1); }

/* --- Portal Main Content --- */
.portal-main {
  flex: 1; margin-left: 240px; background: var(--gray-50);
  min-height: 100vh;
}
.portal-header {
  background: var(--white); padding: 20px 32px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.portal-header h1 { font-size: 24px; }
.portal-header .user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--gray-600); }
.portal-header .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.portal-content { padding: 32px; }

/* --- Portal Stats Row --- */
.portal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.portal-stat-card {
  background: var(--white); border-radius: var(--card-radius);
  padding: 24px; border: 1px solid var(--gray-100);
}
.portal-stat-card .stat-label { font-size: 13px; color: var(--gray-600); font-weight: 500; margin-bottom: 8px; }
.portal-stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.portal-stat-card .stat-change { font-size: 13px; margin-top: 4px; font-weight: 500; }
.portal-stat-card .stat-change.positive { color: var(--success); }
.portal-stat-card .stat-change.negative { color: var(--danger); }

/* --- Portal Card --- */
.portal-card {
  background: var(--white); border-radius: var(--card-radius);
  border: 1px solid var(--gray-100); margin-bottom: 24px;
}
.portal-card-header {
  padding: 20px 24px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.portal-card-header h3 { font-size: 16px; }
.portal-card-body { padding: 24px; }

/* --- Portal Table --- */
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table th {
  text-align: left; padding: 10px 16px; font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gray-600); border-bottom: 1px solid var(--gray-100);
}
.portal-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100); }
.portal-table tr:last-child td { border-bottom: none; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--primary);
}
.login-card {
  background: var(--white); border-radius: 8px; padding: 48px;
  width: 400px; max-width: 90%;
}
.login-card .login-logo { text-align: center; margin-bottom: 32px; }
.login-card .login-logo img { height: 36px; margin: 0 auto; }
.login-card h2 { text-align: center; font-size: 22px; margin-bottom: 8px; }
.login-card .login-subtitle { text-align: center; font-size: 14px; color: var(--gray-600); margin-bottom: 32px; }
.login-card .btn { width: 100%; margin-top: 8px; }
.login-card .login-footer { text-align: center; margin-top: 20px; font-size: 13px; }
.login-card .login-footer a { color: var(--accent); }

/* --- Status Badge --- */
.status-badge {
  display: inline-block; padding: 4px 10px; font-size: 11px;
  font-weight: 600; border-radius: 20px; text-transform: uppercase;
}
.status-completed { background: rgba(22,163,74,0.1); color: var(--success); }
.status-active { background: rgba(27,42,107,0.1); color: var(--primary); }
.status-credited { background: rgba(201,168,76,0.15); color: #9a7c2e; }
.status-pending { background: var(--gray-100); color: var(--gray-600); }

/* --- Document Row --- */
.doc-icon { color: var(--danger); font-size: 18px; }

/* --- Filter Controls --- */
.portal-filters {
  display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; align-items: center;
}
.portal-filters select {
  padding: 8px 32px 8px 12px; font-size: 13px;
  border: 1px solid var(--gray-100); border-radius: var(--card-radius);
  background: var(--white); font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555E7A' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.portal-filters input[type="date"] {
  padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--gray-100); border-radius: var(--card-radius);
  font-family: inherit;
}

/* --- Chart Layouts --- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.chart-full { grid-column: 1 / -1; }

/* --- Mobile Sidebar --- */
.sidebar-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 60;
  background: var(--primary); color: var(--white); border: none;
  width: 40px; height: 40px; border-radius: var(--card-radius);
  font-size: 18px; cursor: pointer;
}

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

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .portal-main { margin-left: 0; }
  .portal-header { padding: 20px 16px; padding-left: 60px; }
  .portal-content { padding: 16px; }
  .portal-stats { grid-template-columns: 1fr; }
  .portal-stat-card .stat-value { font-size: 22px; }
}
