/* client/public/css/style.css - Premium Modern Dark Theme */
:root {
    --bg-main: #070913;
    --bg-surface: #0a0e1c;
    --bg-card: #0d1224;
    --bg-card-hover: #131933;
    --bg-elevated: #182040;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-highlight: rgba(99, 102, 241, 0.35);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.28);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.12);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #818cf8;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* =============================================================================
   Header Navigation
============================================================================= */
.app-header {
    background: rgba(10, 14, 28, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    max-width: 100%;
}

.header-container {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex-shrink: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.brand-title span {
    color: #94a3b8;
    font-weight: 400;
}

.portal-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.18rem 0.5rem;
    border-radius: 9999px;
    margin-left: 0.25rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.badge-client-portal {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-admin-portal {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    min-width: 0;
}

.nav-item {
    font-size: 0.83rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.15s ease;
    padding: 0.35rem 0.55rem;
    border-radius: 7px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

.nav-item-super {
    color: #c084fc !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Switch pills in header - Modern Sleek Styling */
.btn-portal-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-admin-switch {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-admin-switch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.btn-client-switch {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.btn-client-switch:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.55);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    max-width: 200px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.user-chip-link:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    text-decoration: none;
    color: #fff;
    transform: translateY(-1px);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f1f5f9;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.38rem;
    border-radius: 10px;
    white-space: nowrap;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.32rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-logout:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* =============================================================================
   Main Content Layout
============================================================================= */
.main-content {
    flex: 1 0 auto;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3.5rem;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: hidden;
}

/* Flash alerts */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fde68a;
}

/* =============================================================================
   Dashboard Hero & Metrics
============================================================================= */
.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.grid-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.25); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.25); }

.metric-data {
    flex: 1;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-top: 0.15rem;
}

.metric-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
    font-weight: 500;
}

/* =============================================================================
   Cards
============================================================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card-header {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.015);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.card-body {
    padding: 1.35rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* =============================================================================
   Tables
============================================================================= */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    margin-bottom: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th {
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    color: #e2e8f0;
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Empty State Container */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
}

.empty-state-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 1.25rem;
    line-height: 1.5;
}

/* =============================================================================
   Badges & Pills
============================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-success, .badge-active, .badge-completed, .badge-approved {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-warning, .badge-pending, .badge-in_progress, .badge-waiting_user {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-closed, .badge-secondary, .badge-muted {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-danger, .badge-expired, .badge-suspended, .badge-banned, .badge-cancelled, .badge-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-info, .badge-trial, .badge-open {
    background: rgba(6, 182, 212, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-purple, .badge-enterprise, .badge-superadmin {
    background: rgba(168, 85, 247, 0.14);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-standard, .badge-admin, .badge-user {
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.key-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    color: #38bdf8;
    font-weight: 600;
    letter-spacing: 0.03em;
    user-select: all;
    white-space: nowrap;
}

.order-badge-link {
    font-weight: 700;
    color: #818cf8;
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
}

.order-badge-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.hardware-id-locked {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    white-space: nowrap;
}

.hardware-id-unlocked {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
    white-space: nowrap;
}

.gateway-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

/* =============================================================================
   Buttons & Micro-interactions
============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.52rem 1.15rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.25;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
}

.btn-sm {
    padding: 0.34rem 0.75rem;
    font-size: 0.81rem;
    border-radius: 7px;
    gap: 0.35rem;
}

.btn-xs {
    padding: 0.2rem 0.52rem;
    font-size: 0.74rem;
    border-radius: 5px;
    gap: 0.25rem;
}

/* Dedicated Copy Button */
.btn-copy {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #a5b4fc;
    font-weight: 600;
    transition: all 0.18s ease;
}

.btn-copy:hover {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(99, 102, 241, 0.55);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-copy.copied {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

/* =============================================================================
   Forms & Controls
============================================================================= */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.45rem;
}

.form-control {
    width: 100%;
    background: rgba(10, 14, 26, 0.7);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

/* =============================================================================
   Pricing Grid
============================================================================= */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.pricing-badge-popular {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
}

.plan-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 1rem 0;
}

.plan-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-dim);
}

.plan-features {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.plan-features li {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

/* =============================================================================
   Footer
============================================================================= */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(10, 14, 26, 0.6);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* =============================================================================
   Mobile & Tablet Navigation (Three Lines / Hamburger Drawer)
   ============================================================================= */
.btn-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4.5px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-hamburger:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.btn-hamburger:active {
    transform: scale(0.95);
}

.hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    transform-origin: center;
}

/* Transform to 'X' icon when active */
.btn-hamburger.active .hamburger-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.btn-hamburger.active .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.btn-hamburger.active .hamburger-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile Nav Drawer */
.mobile-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 86vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.65);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.mobile-nav.open {
    transform: translateX(0);
    pointer-events: auto;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.mobile-user-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.btn-mobile-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-mobile-close:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.mobile-nav-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.65rem;
    padding-left: 0.4rem;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.mobile-nav-link svg {
    color: var(--text-dim);
    transition: color 0.18s ease;
    flex-shrink: 0;
}

.mobile-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.mobile-nav-link:hover svg {
    color: #818cf8;
}

.mobile-nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
    font-weight: 600;
}

.mobile-nav-link.active svg {
    color: #818cf8;
}

.mobile-nav-bottom {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

body.mobile-nav-locked {
    overflow: hidden !important;
}

/* =============================================================================
   Responsive Adjustments (Zero Side-Scroll Guarantee)
============================================================================= */
@media (max-width: 1360px) {
    .portal-badge {
        display: none !important;
    }
    .header-left {
        gap: 0.75rem;
    }
    .user-chip .user-name {
        max-width: 80px;
    }
}

@media (max-width: 1200px) {
    .user-chip .user-name {
        display: none !important;
    }
    .user-chip {
        padding: 0.18rem 0.4rem;
    }
    .btn-logout span {
        display: none !important;
    }
    .btn-logout {
        padding: 0.32rem 0.45rem;
    }
    .btn-portal-switch span {
        font-size: 0.78rem;
    }
    .nav-links {
        gap: 0.1rem;
    }
    .nav-item {
        padding: 0.32rem 0.45rem;
        font-size: 0.8rem;
    }
}

/* Mobile & Tablet / Pad Breakpoint: Switch horizontal options to 3-Line Hamburger */
@media (max-width: 1024px) {
    .nav-links {
        display: none !important;
    }
    .btn-hamburger {
        display: flex !important;
    }
    .header-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.65rem 1rem;
    }
    .header-left {
        flex: 1;
        justify-content: flex-start;
    }
    .header-right {
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .portal-badge {
        display: none !important;
    }
    .btn-portal-switch span {
        display: none !important;
    }
    .btn-portal-switch {
        padding: 0.35rem 0.5rem;
    }
    .user-chip .user-name {
        display: none !important;
    }
    .btn-logout {
        display: none !important;
    }
}
