/* Portal Layout & Component Styles */

/* ============================================
   Skip to Content (Accessibility)
   ============================================ */

.portal-header__skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1001;
  padding: 0.5rem 1rem;
  background: #111827;
  color: #ffffff;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}

.portal-header__skip:focus {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  overflow: visible;
}

/* ============================================
   Portal Header
   ============================================ */

.portal-header {
  background: #ffffff;
  border-bottom: 1px solid #E5E7EB;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
}

.portal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.portal-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.portal-header__logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #09152B;
}

.portal-header__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portal-header__user {
  font-size: 0.875rem;
  color: #4B5563;
}

.portal-header__logout {
  font-size: 0.875rem;
  color: #6B7280;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.portal-header__logout:hover {
  background: #F3F4F6;
  color: #111827;
}

/* ============================================
   Portal Layout (Sidebar + Content)
   ============================================ */

.portal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px - 48px);
}

.portal-sidebar {
  background: #F9FAFB;
  border-right: 1px solid #E5E7EB;
  padding: 1.5rem 0;
}

.portal-content {
  padding: 2rem;
  max-width: 1080px;
}

@media (max-width: 767px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    border-right: none;
    border-bottom: 1px solid #E5E7EB;
    padding: 0.75rem 0;
  }

  .portal-content {
    padding: 1rem;
  }
}

/* ============================================
   Portal Footer
   ============================================ */

.portal-footer {
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  padding: 0.75rem 1.5rem;
  height: 48px;
  display: flex;
  align-items: center;
}

.portal-footer__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.portal-footer__copyright {
  font-size: 0.75rem;
  color: #9CA3AF;
}

.portal-footer__link {
  font-size: 0.75rem;
  color: #6B7280;
  text-decoration: none;
}

.portal-footer__link:hover {
  color: #111827;
}

/* ============================================
   Portal Card
   ============================================ */

.portal-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
}

.portal-card--subtle {
  background: #F9FAFB;
}

.portal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.portal-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.portal-card__subtitle {
  font-size: 0.875rem;
  color: #6B7280;
  margin: 0.25rem 0 0;
}

/* ============================================
   Status Badges
   ============================================ */

.portal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.portal-badge--success {
  background: #D1FAE5;
  color: #065F46;
}

.portal-badge--warning {
  background: #FEF3C7;
  color: #92400E;
}

.portal-badge--error {
  background: #FEE2E2;
  color: #991B1B;
}

.portal-badge--info {
  background: #DBEAFE;
  color: #1E40AF;
}

.portal-badge--neutral {
  background: #F3F4F6;
  color: #4B5563;
}

/* ============================================
   Portal Table
   ============================================ */

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.portal-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #374151;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
}

.portal-table td {
  padding: 0.75rem 1rem;
  color: #4B5563;
  border-bottom: 1px solid #F3F4F6;
}

.portal-table tr:nth-child(even) td {
  background: #FAFAFA;
}

.portal-table tr:hover td {
  background: #F3F4F6;
}

/* ============================================
   Progress Bar
   ============================================ */

.portal-progress {
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.portal-progress__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.portal-progress__fill--blue {
  background: #3B82F6;
}

.portal-progress__fill--green {
  background: #10B981;
}

.portal-progress__fill--yellow {
  background: #F59E0B;
}

.portal-progress__fill--red {
  background: #EF4444;
}

/* ============================================
   Alert Banners
   ============================================ */

.portal-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portal-alert--warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.portal-alert--error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.portal-alert--info {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.portal-alert--success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

/* ============================================
   Quick Actions Grid
   ============================================ */

.portal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.portal-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-action:hover {
  border-color: #3B82F6;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.portal-action__icon {
  font-size: 1.5rem;
}

.portal-action__label {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================
   Portal Button
   ============================================ */

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.portal-btn--primary {
  background: #3B82F6;
  color: #ffffff;
}

.portal-btn--primary:hover {
  background: #2563EB;
}

.portal-btn--secondary {
  background: #ffffff;
  color: #374151;
  border: 1px solid #D1D5DB;
}

.portal-btn--secondary:hover {
  background: #F3F4F6;
}

.portal-btn--danger {
  background: #FEE2E2;
  color: #991B1B;
}

.portal-btn--danger:hover {
  background: #FECACA;
}

.portal-btn--small {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}

/* ============================================
   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: 1000;
}

.portal-modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.portal-modal__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem;
}

.portal-modal__body {
  font-size: 0.875rem;
  color: #4B5563;
  margin-bottom: 1.5rem;
}

.portal-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============================================
   Form Elements
   ============================================ */

.portal-form-group {
  margin-bottom: 1rem;
}

.portal-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.portal-input,
.portal-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #111827;
  background: #ffffff;
  transition: border-color 0.15s;
}

.portal-input:focus,
.portal-select:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============================================
   Utility: Empty State
   ============================================ */

.portal-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #9CA3AF;
}

.portal-empty__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.portal-empty__text {
  font-size: 0.875rem;
}
