/* =========================================
   Orbital Solutions - Client Portal Styles
   Space-themed design matching orbsol.net
   ========================================= */

:root {
    --portal-bg: #0a0e17;
    --portal-surface: rgba(15, 23, 42, 0.85);
    --portal-surface-hover: rgba(30, 41, 59, 0.9);
    --portal-border: rgba(139, 92, 246, 0.2);
    --portal-border-hover: rgba(139, 92, 246, 0.4);
    --portal-primary: #8b5cf6;
    --portal-primary-hover: #7c3aed;
    --portal-secondary: #6366f1;
    --portal-accent: #06b6d4;
    --portal-success: #10b981;
    --portal-warning: #f59e0b;
    --portal-danger: #ef4444;
    --portal-text: #f8fafc;
    --portal-text-muted: #94a3b8;
    --portal-gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
}

/* Base Portal Styles */
.portal-body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--portal-bg);
    color: var(--portal-text);
    min-height: 100vh;
}

/* Auth Page Styles */
.portal-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.portal-auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
}

.portal-auth-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
}

.portal-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.portal-auth-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
}

.portal-auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, #e879f9, #c084fc, #a855f7, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portal-auth-header p {
    color: var(--portal-text-muted);
}

.portal-auth-form .form-group {
    margin-bottom: 1.25rem;
}

.portal-auth-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--portal-text-muted);
}

.portal-input {
    background: rgba(15, 23, 42, 0.6);
    border: none;
    border-radius: 8px;
    color: var(--portal-text);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    position: relative;
}

/* Gradient border wrapper for inputs */
.portal-form-group {
    position: relative;
}

.portal-form-group .portal-input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid transparent;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)),
        linear-gradient(to bottom, rgba(232, 121, 249, 0.5), rgba(192, 132, 252, 0.5), rgba(139, 92, 246, 0.5));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.portal-input:focus {
    outline: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)),
        linear-gradient(to bottom, #e879f9, #c084fc, #8b5cf6);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25), 0 0 20px rgba(168, 85, 247, 0.15);
}

.portal-input::placeholder {
    color: var(--portal-text-muted);
}

/* Password Requirements Gradient Alert */
.password-requirements {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid transparent;
    background-image:
        linear-gradient(to bottom, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.12), rgba(168, 85, 247, 0.12)),
        linear-gradient(to bottom, rgba(239, 68, 68, 0.6), rgba(249, 115, 22, 0.6), rgba(168, 85, 247, 0.6));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.portal-form-check {
    margin: 1.25rem 0;
}

.portal-form-check .form-check-input {
    background: var(--portal-surface);
    border-color: var(--portal-border);
}

.portal-form-check .form-check-input:checked {
    background-color: var(--portal-primary);
    border-color: var(--portal-primary);
}

.btn-portal-primary {
    width: 100%;
    background: var(--portal-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-portal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-portal-secondary {
    background: transparent;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    color: var(--portal-text);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-portal-secondary:hover {
    background: var(--portal-surface-hover);
    border-color: var(--portal-border-hover);
    color: var(--portal-text);
}

.portal-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--portal-border);
}

.portal-auth-footer a {
    color: var(--portal-primary);
    text-decoration: none;
}

.portal-auth-footer a:hover {
    text-decoration: underline;
}

.portal-auth-message {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--portal-text-muted);
}

/* Orbit Decoration */
.portal-orbit-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    pointer-events: none;
    z-index: -1;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    animation: orbit-rotate 30s linear infinite;
}

.orbit-1 {
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
}

.orbit-2 {
    top: 20%;
    left: 20%;
    right: 20%;
    bottom: 20%;
    animation-duration: 25s;
    animation-direction: reverse;
}

.orbit-3 {
    top: 30%;
    left: 30%;
    right: 30%;
    bottom: 30%;
    animation-duration: 20s;
}

@keyframes orbit-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Portal Navigation */
.portal-nav {
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.portal-nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.portal-logo img {
    width: 40px;
    height: 40px;
}

.portal-logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-nav-links {
    display: flex;
    gap: 0.5rem;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--portal-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.portal-nav-link:hover,
.portal-nav-link.active {
    background: var(--portal-surface-hover);
    color: var(--portal-text);
}

.portal-nav-link.active {
    color: var(--portal-primary);
}

.nav-icon {
    font-size: 1.125rem;
}

.portal-nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.btn-portal-logout {
    background: transparent;
    border: 1px solid var(--portal-border);
    border-radius: 6px;
    color: var(--portal-text-muted);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-portal-logout:hover {
    background: var(--portal-surface-hover);
    border-color: var(--portal-danger);
    color: var(--portal-danger);
}

/* Portal Main Content */
.portal-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 180px);
}

.portal-alert {
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Portal Page Structure */
.portal-page {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.portal-header {
    margin-bottom: 2rem;
}

.portal-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.portal-subtitle {
    color: var(--portal-text-muted);
    font-size: 1rem;
}

.header-back {
    margin-bottom: 1rem;
}

.back-link {
    color: var(--portal-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--portal-primary);
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Portal Cards */
.portal-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.portal-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-card .card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.card-link {
    color: var(--portal-primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.card-link:hover {
    text-decoration: underline;
}

.portal-card-empty {
    text-align: center;
    padding: 3rem;
}

.empty-state {
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 4rem;
    color: var(--portal-text-muted);
    margin-bottom: 1rem;
}

.empty-state h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--portal-text-muted);
    margin-bottom: 1.5rem;
}

.portal-empty-message {
    color: var(--portal-text-muted);
    text-align: center;
    padding: 2rem;
}

/* Stats Grid */
.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.portal-stat-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.stat-icon-balance {
    background: rgba(139, 92, 246, 0.2);
    color: var(--portal-primary);
}

.stat-icon-paid {
    background: rgba(16, 185, 129, 0.2);
    color: var(--portal-success);
}

.stat-icon-invoices {
    background: rgba(6, 182, 212, 0.2);
    color: var(--portal-accent);
}

.stat-icon-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: var(--portal-danger);
}

.stat-card-warning {
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-content {
    flex-grow: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.stat-action {
    color: var(--portal-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-action:hover {
    text-decoration: underline;
}

/* Portal Grid */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Portal List */
.portal-list {
    display: flex;
    flex-direction: column;
}

.portal-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--portal-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.portal-list-item:last-child {
    border-bottom: none;
}

.portal-list-item:hover {
    background: var(--portal-surface-hover);
}

a.portal-list-item:hover {
    color: inherit;
}

.list-item-content {
    flex-grow: 1;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.list-item-amount {
    font-weight: 600;
}

/* Badges */
.portal-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-lg {
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
}

.badge-draft {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.badge-sent,
.badge-pending {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.badge-viewed {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.badge-partiallypaid {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-paid,
.badge-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-cancelled,
.badge-failed {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.badge-refunded {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.badge-method {
    background: rgba(139, 92, 246, 0.2);
    color: var(--portal-primary);
}

.badge-coming-soon {
    background: rgba(6, 182, 212, 0.2);
    color: var(--portal-accent);
}

/* Portal Table */
.portal-table-responsive {
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--portal-text-muted);
    border-bottom: 1px solid var(--portal-border);
}

.portal-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-table tbody tr:hover {
    background: var(--portal-surface-hover);
}

.portal-table tbody tr.row-overdue {
    background: rgba(239, 68, 68, 0.05);
}

.portal-table .text-end {
    text-align: right;
}

.invoice-link {
    color: var(--portal-primary);
    text-decoration: none;
    font-weight: 500;
}

.invoice-link:hover {
    text-decoration: underline;
}

.amount-cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.actions-cell {
    white-space: nowrap;
}

.btn-portal-sm {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 6px;
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-portal-sm:hover {
    background: var(--portal-surface-hover);
    color: var(--portal-text);
}

.btn-portal-sm.btn-pay {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: white;
}

.btn-portal-sm.btn-pay:hover {
    background: var(--portal-primary-hover);
}

/* Filters */
.portal-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--portal-border);
    color: var(--portal-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--portal-surface-hover);
    color: var(--portal-text);
}

.filter-btn.active {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: white;
}

/* Invoice Detail */
.invoice-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }
}

.invoice-main-card {
    padding: 2rem;
}

.invoice-header {
    margin-bottom: 2rem;
}

.invoice-dates {
    display: flex;
    gap: 2rem;
}

.invoice-date {
    display: flex;
    flex-direction: column;
}

.date-label {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    text-transform: uppercase;
}

.date-value {
    font-size: 1rem;
    font-weight: 500;
}

.date-overdue .date-value {
    color: var(--portal-danger);
}

.invoice-items {
    margin-bottom: 2rem;
}

.invoice-items h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.invoice-table {
    margin-bottom: 0;
}

.invoice-table .item-service {
    font-weight: 500;
}

.invoice-table .item-detail {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.invoice-totals {
    border-top: 2px solid var(--portal-border);
    padding-top: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.total-row.discount {
    color: var(--portal-success);
}

.total-row.total-final {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--portal-border);
}

.total-row.paid {
    color: var(--portal-success);
}

.total-row.balance-due {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--portal-primary);
}

.invoice-terms {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--portal-border);
}

.invoice-terms h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.invoice-terms p {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
    white-space: pre-line;
}

/* Invoice Sidebar */
.invoice-sidebar .portal-card {
    margin-bottom: 1rem;
}

.action-card {
    text-align: center;
}

.balance-display {
    margin-bottom: 1.5rem;
}

.balance-label {
    display: block;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    margin-bottom: 0.5rem;
}

.balance-value {
    font-size: 2rem;
    font-weight: 700;
}

.btn-pay-main {
    width: 100%;
    font-size: 1.125rem;
    padding: 1rem;
}

.pay-icon {
    margin-right: 0.5rem;
}

.secure-text {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.contact-text {
    color: var(--portal-text-muted);
    margin-bottom: 1rem;
}

.paid-card {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.paid-checkmark {
    font-size: 3rem;
    color: var(--portal-success);
    margin-bottom: 0.5rem;
}

.paid-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--portal-success);
}

.paid-date {
    color: var(--portal-text-muted);
    margin-top: 0.5rem;
}

.invoice-sidebar h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.payment-history {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--portal-surface-hover);
    border-radius: 8px;
}

.payment-info {
    display: flex;
    flex-direction: column;
}

.payment-date {
    font-size: 0.875rem;
}

.payment-method {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.payment-amount {
    font-weight: 600;
    color: var(--portal-success);
}

/* Payment Success */
.portal-success-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.success-card {
    text-align: center;
    max-width: 500px;
}

.success-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.success-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: var(--portal-success);
    z-index: 1;
}

.success-orbit {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    animation: success-pulse 2s ease infinite;
}

@keyframes success-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

.success-card h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--portal-success);
}

.success-message {
    color: var(--portal-text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.success-details {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.detail-label {
    color: var(--portal-text-muted);
}

.detail-value {
    font-weight: 600;
}

.confirmation-text {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Account Page */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

.portal-form .form-group {
    margin-bottom: 1.25rem;
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.security-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--portal-surface-hover);
    border-radius: 8px;
}

.security-item h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.security-item p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
}

.quick-links {
    display: flex;
    flex-direction: column;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--portal-border);
    transition: background 0.2s ease;
}

.quick-link:last-child {
    border-bottom: none;
}

.quick-link:hover {
    background: var(--portal-surface-hover);
    color: inherit;
}

.link-icon {
    font-size: 1.25rem;
    color: var(--portal-primary);
}

.link-text {
    flex-grow: 1;
}

.link-arrow {
    color: var(--portal-text-muted);
}

.change-password-card {
    max-width: 500px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--portal-border);
}

.summary-card .summary-row:last-child {
    border-bottom: none;
}

.summary-value {
    font-weight: 600;
}

/* Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.site-card {
    display: block;
    background: var(--portal-surface-hover);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.site-card:hover {
    border-color: var(--portal-primary);
    transform: translateY(-2px);
    color: inherit;
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.site-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.site-url {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.site-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.site-status.status-running {
    background: rgba(16, 185, 129, 0.2);
    color: var(--portal-success);
}

.site-status.status-stopped {
    background: rgba(239, 68, 68, 0.2);
    color: var(--portal-danger);
}

.site-status.status-unknown {
    background: rgba(148, 163, 184, 0.2);
    color: var(--portal-text-muted);
}

.site-stats {
    display: flex;
    gap: 1.5rem;
}

.site-stat {
    display: flex;
    flex-direction: column;
}

.site-stat .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--portal-text);
}

.site-stat .stat-label {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

/* Analytics Page */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.analytics-period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--portal-border);
    color: var(--portal-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    background: var(--portal-surface-hover);
    color: var(--portal-text);
}

.period-btn.active {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: white;
}

.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .analytics-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.analytics-stat-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.analytics-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.analytics-stat-card .stat-label {
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.analytics-stat-card.stat-realtime .stat-value {
    color: var(--portal-success);
}

.analytics-stat-card.stat-realtime {
    border-color: rgba(16, 185, 129, 0.3);
}

/* Chart Container */
.chart-container {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Simple Bar Chart (CSS-only fallback) */
.simple-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding-top: 1rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--portal-primary), var(--portal-accent));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: all 0.3s ease;
}

.chart-bar:hover {
    opacity: 0.8;
}

/* Top Pages Table */
.top-pages-table {
    width: 100%;
}

.top-pages-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--portal-text-muted);
    border-bottom: 1px solid var(--portal-border);
}

.top-pages-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--portal-border);
}

.top-pages-table .page-path {
    font-family: monospace;
    font-size: 0.875rem;
}

.top-pages-table .text-end {
    text-align: right;
}

.top-pages-table tbody tr:hover {
    background: var(--portal-surface-hover);
}

/* Satellites Placeholder */
.satellites-placeholder {
    text-align: center;
    padding: 3rem;
}

.satellite-orbit {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    border: 2px dashed rgba(139, 92, 246, 0.2);
    border-radius: 50%;
}

.satellite {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--portal-primary);
    border-radius: 50%;
    animation: satellite-orbit 10s linear infinite;
}

.satellite-1 {
    top: 10%;
    left: 50%;
}

.satellite-2 {
    animation-delay: -3.3s;
}

.satellite-3 {
    animation-delay: -6.6s;
}

@keyframes satellite-orbit {
    from {
        transform: rotate(0deg) translateX(100px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(100px) rotate(-360deg);
    }
}

.satellites-placeholder p {
    color: var(--portal-text-muted);
}

.satellites-placeholder .text-muted {
    font-size: 0.875rem;
}

/* Portal Footer */
.portal-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--portal-border);
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

.portal-footer a {
    color: var(--portal-primary);
    text-decoration: none;
}

.portal-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-nav-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .portal-nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .portal-main {
        padding: 1rem;
    }

    .portal-header h1 {
        font-size: 1.5rem;
    }

    .portal-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .invoice-dates {
        flex-direction: column;
        gap: 1rem;
    }

    .success-actions {
        flex-direction: column;
    }
}

/* =========================================
   Projects Section Styles
   ========================================= */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.3);
    text-decoration: none;
    color: inherit;
}

.project-item-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #fff;
}

.project-item-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.project-status {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-status.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.project-status.status-inprogress {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.project-status.status-onhold {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.project-status.status-completed {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.project-status.status-archived {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.project-links {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.projects-placeholder {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.projects-placeholder p {
    margin: 0.25rem 0;
}
