/* ============================================================
   INTERLINK COLLABORATIONS — CLIENT PORTAL STYLES
   Uses design tokens from interlink.css (Warm Futurism)
   ============================================================ */

/* ========================
   AUTH GATE — hard hide until authenticated
   ======================== */
.hidden {
    display: none !important;
}

/* ========================
   PORTAL LAYOUT
   ======================== */
.portal-wrapper {
    display: flex;
    min-height: calc(100vh - 72px);
    background: var(--bg-light);
}

/* ========================
   AUTH SCREEN
   ======================== */
.portal-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #1a1a3e 100%);
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    animation: authFadeIn 0.6s ease;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card .auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.auth-card .auth-logo span {
    font-weight: 400;
    opacity: 0.8;
}

.auth-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.auth-card .auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-card .auth-divider::before,
.auth-card .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-google:active {
    transform: translateY(0);
}

.btn-google .google-icon {
    width: 20px;
    height: 20px;
}

.auth-footer {
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.auth-footer a {
    color: var(--accent);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ========================
   SIDEBAR
   ======================== */
.portal-sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-item.active {
    color: white;
    background: rgba(249, 115, 22, 0.1);
    border-left-color: var(--accent);
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
}

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

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-primary);
    color: rgba(255, 255, 255, 0.6);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    color: white;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Mobile sidebar toggle */
.portal-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 60;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
    transition: all 0.3s ease;
}

.portal-mobile-toggle:hover {
    transform: scale(1.1);
}

/* ========================
   MAIN CONTENT AREA
   ======================== */
.portal-main {
    flex: 1;
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.portal-page {
    display: none;
    animation: portalPageIn 0.35s ease;
}

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

@keyframes portalPageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================
   PAGE HEADERS
   ======================== */
.portal-page-header {
    margin-bottom: 2rem;
}

.portal-page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.portal-page-header p {
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ========================
   DASHBOARD STATS
   ======================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card-icon.icon-tickets {
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent);
}

.stat-card-icon.icon-messages {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-card-icon.icon-resolved {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* ========================
   ORGANIZATION CARD
   ======================== */
.org-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.org-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.org-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.org-card-header h3 i {
    color: var(--accent);
}

.btn-edit-org {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--accent);
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-org:hover {
    background: rgba(249, 115, 22, 0.15);
}

.org-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.org-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.org-field-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.org-field-value {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 500;
}

.org-field-value.empty {
    color: var(--text-light);
    font-style: italic;
}

/* Org edit form */
.org-edit-form {
    display: none;
}

.org-edit-form.active {
    display: block;
}

.org-view {
    display: block;
}

.org-view.hidden {
    display: none;
}

/* ========================
   PORTAL FORMS
   ======================== */
.portal-form-group {
    margin-bottom: 1.25rem;
}

.portal-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.portal-form-group label .required {
    color: #ef4444;
}

.portal-input,
.portal-select,
.portal-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.portal-input:focus,
.portal-select:focus,
.portal-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.portal-textarea {
    resize: vertical;
    min-height: 100px;
}

.portal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-portal-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--accent);
    color: white;
}

.btn-portal-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

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

.btn-portal-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-main);
}

.btn-portal-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========================
   TICKETS LIST
   ======================== */
.tickets-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ticket-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ticket-filter-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border: 1px solid var(--border);
    border-radius: 50px;
    background: white;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticket-filter-btn:hover,
.ticket-filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(249, 115, 22, 0.05);
}

.ticket-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ticket-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ticket-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.ticket-item-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.ticket-status-badge {
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticket-status-badge.status-open {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.ticket-status-badge.status-in-progress {
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent);
}

.ticket-status-badge.status-resolved {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.ticket-status-badge.status-closed {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.ticket-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-light);
}

.ticket-item-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ticket-item-desc {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.priority-badge.priority-low { color: #22c55e; }
.priority-badge.priority-medium { color: #f59e0b; }
.priority-badge.priority-high { color: #f97316; }
.priority-badge.priority-urgent { color: #ef4444; }

/* ========================
   NEW TICKET MODAL
   ======================== */
.portal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.portal-modal-overlay.active {
    display: flex;
}

.portal-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.portal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.portal-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.portal-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.portal-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.portal-modal-body {
    padding: 1.5rem;
}

.portal-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* ========================
   MESSAGES
   ======================== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.message-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.message-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.message-item.unread {
    border-left: 3px solid var(--accent);
    background: rgba(249, 115, 22, 0.02);
}

.message-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.message-sender {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-sender-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.message-sender-badge {
    padding: 0.12rem 0.5rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.message-sender-badge.badge-staff {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.message-sender-badge.badge-you {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.message-sender-badge.badge-contact {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.message-subject {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.message-preview {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Message action buttons */
.message-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.msg-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-light);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.msg-action-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
    border-color: var(--primary);
}

.msg-action-btn.msg-mark-read:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.06);
}

.msg-action-btn.msg-delete:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

/* Inline replies within message list */
.message-inline-replies {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.message-replies-divider {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.message-replies-divider i {
    font-size: 0.72rem;
}

.message-inline-reply {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.message-inline-reply:last-child {
    margin-bottom: 0;
}

.message-inline-reply.unread-reply {
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, 0.07);
}

/* Message detail view */
.message-detail {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.message-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.message-detail-subject {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.message-detail-body {
    font-size: 0.92rem;
    color: var(--text-main);
    line-height: 1.7;
    white-space: pre-wrap;
}

.message-detail-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-light);
    display: flex;
    gap: 1.5rem;
}

/* Portal Replies Thread */
.message-replies-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.message-replies-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-replies-heading i {
    color: var(--accent);
}

.message-reply-item {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.message-reply-item:last-child {
    margin-bottom: 0;
}

.message-reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.message-reply-sender {
    font-size: 0.82rem;
    font-weight: 600;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.message-reply-sender i {
    font-size: 0.75rem;
}

.message-reply-time {
    font-size: 0.73rem;
    color: var(--text-light);
}

.message-reply-body {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================
   SUBSCRIPTIONS
   ======================== */
.subscription-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    max-width: 500px;
}

.subscription-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--accent);
}

.subscription-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.subscription-card p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-stripe {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #635bff, #7c3aed);
    color: white;
}

.btn-stripe:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 91, 255, 0.35);
}

.btn-stripe:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================
   EMPTY STATES
   ======================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ========================
   LOADING & ALERTS
   ======================== */
.portal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.portal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.portal-alert.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.portal-alert.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.portal-alert.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Back button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--text-light);
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.btn-back:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ========================
   RESPONSIVE — MOBILE
   ======================== */
@media (max-width: 768px) {
    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 200;
    }

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

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

    .portal-sidebar-overlay.open {
        display: block;
    }

    .portal-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .portal-main {
        padding: 1.5rem 1rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .org-card-grid {
        grid-template-columns: 1fr;
    }

    .portal-form-row {
        grid-template-columns: 1fr;
    }

    .tickets-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-modal {
        max-height: 90vh;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .portal-page-header h1 {
        font-size: 1.4rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card-value {
        font-size: 1.4rem;
    }
}
