/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0B1120;
    --primary-light: #1E293B;
    --accent: #3B82F6;
    --accent-glow: #60A5FA;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --surface: #FFFFFF;
    --surface-dark: #F8FAFC;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px -10px rgba(0,0,0,0.15);
    --gradient-1: linear-gradient(135deg, #4158D0, #C850C0);
    --gradient-2: linear-gradient(135deg, #0093E9, #80D0C7);
    --gradient-3: linear-gradient(135deg, #FAD961, #F76B1C);
    --gradient-4: linear-gradient(135deg, #FF3CAC, #784BA0);
}

html[data-theme="dark"],
html[data-theme-resolved="dark"] {
    --surface: #0B1120;
    --surface-dark: #0F172A;
    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --border: rgba(148,163,184,0.25);
    background: #0B1120;
}

html[data-theme="dark"] body,
html[data-theme-resolved="dark"] body {
    background: linear-gradient(145deg, #0B1120 0%, #111827 100%);
    color: var(--text-primary);
}

html[data-theme="dark"] .nexus-header,
html[data-theme-resolved="dark"] .nexus-header,
html[data-theme="dark"] .nexus-sidebar,
html[data-theme-resolved="dark"] .nexus-sidebar,
html[data-theme="dark"] .content-area,
html[data-theme-resolved="dark"] .content-area,
html[data-theme="dark"] .quick-actions,
html[data-theme-resolved="dark"] .quick-actions,
html[data-theme="dark"] .portal-card,
html[data-theme-resolved="dark"] .portal-card {
    background: #0F172A;
    border-color: rgba(148,163,184,0.2);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme-resolved="dark"] .dropdown-item,
html[data-theme="dark"] .user-dropdown,
html[data-theme-resolved="dark"] .user-dropdown {
    background: #0F172A;
    color: var(--text-primary);
    border-color: rgba(148,163,184,0.2);
}

html[data-theme="dark"] .nav-section-title,
html[data-theme-resolved="dark"] .nav-section-title,
html[data-theme="dark"] .nav-item span,
html[data-theme-resolved="dark"] .nav-item span,
html[data-theme="dark"] .stat-label,
html[data-theme-resolved="dark"] .stat-label,
html[data-theme="dark"] .section-title,
html[data-theme-resolved="dark"] .section-title,
html[data-theme="dark"] .hint,
html[data-theme-resolved="dark"] .hint,
html[data-theme="dark"] .profile-field,
html[data-theme-resolved="dark"] .profile-field,
html[data-theme="dark"] .field-label,
html[data-theme-resolved="dark"] .field-label,
html[data-theme="dark"] .field-value,
html[data-theme-resolved="dark"] .field-value,
html[data-theme="dark"] .profile-label,
html[data-theme-resolved="dark"] .profile-label,
html[data-theme="dark"] .profile-value,
html[data-theme-resolved="dark"] .profile-value,
html[data-theme="dark"] .storage-stats,
html[data-theme-resolved="dark"] .storage-stats,
html[data-theme="dark"] .storage-header,
html[data-theme-resolved="dark"] .storage-header,
html[data-theme="dark"] .activity-list,
html[data-theme-resolved="dark"] .activity-list,
html[data-theme="dark"] .empty-state,
html[data-theme-resolved="dark"] .empty-state,
html[data-theme="dark"] .card-content,
html[data-theme-resolved="dark"] .card-content {
    color: var(--text-primary);
}

html[data-theme="dark"] .nav-item,
html[data-theme-resolved="dark"] .nav-item {
    color: var(--text-secondary);
}

html[data-theme="dark"] .nav-item.active,
html[data-theme-resolved="dark"] .nav-item.active {
    background: rgba(59,130,246,0.15);
}

html[data-theme="dark"] .table th,
html[data-theme-resolved="dark"] .table th,
html[data-theme="dark"] .table td,
html[data-theme-resolved="dark"] .table td {
    color: var(--text-primary);
    border-color: rgba(148,163,184,0.2);
}

html[data-theme="dark"] input,
html[data-theme-resolved="dark"] input,
html[data-theme="dark"] select,
html[data-theme-resolved="dark"] select,
html[data-theme="dark"] .theme-select,
html[data-theme-resolved="dark"] .theme-select {
    background: #0B1120;
    color: var(--text-primary);
    border-color: rgba(148,163,184,0.25);
}

html[data-theme="dark"] .edit-btn,
html[data-theme-resolved="dark"] .edit-btn,
html[data-theme="dark"] .save-btn,
html[data-theme-resolved="dark"] .save-btn,
html[data-theme="dark"] .cancel-btn,
html[data-theme-resolved="dark"] .cancel-btn {
    color: #fff;
}

html[data-theme="dark"] .stat-card,
html[data-theme-resolved="dark"] .stat-card,
html[data-theme="dark"] .access-card,
html[data-theme-resolved="dark"] .access-card,
html[data-theme="dark"] .recent-activity,
html[data-theme-resolved="dark"] .recent-activity,
html[data-theme="dark"] .welcome-banner,
html[data-theme-resolved="dark"] .welcome-banner {
    background: linear-gradient(145deg, #0F172A, #0B1120);
    border-color: rgba(148,163,184,0.2);
}

html[data-theme="dark"] .stat-card:hover,
html[data-theme-resolved="dark"] .stat-card:hover,
html[data-theme="dark"] .access-card:hover,
html[data-theme-resolved="dark"] .access-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

html[data-theme="dark"] .welcome-banner::before,
html[data-theme-resolved="dark"] .welcome-banner::before {
    opacity: 0.25;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #F1F5F9 0%, #EFF6FF 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Modern Header */
.nexus-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-grid {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 53px;
    width: auto;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.7));
}

.brand-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-tagline {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.header-center {
    display: flex;
    justify-content: center;
}

.nexus-logo {
    height: 63px;
    width: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

.icon-btn {
    background: var(--surface-dark);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.icon-btn:hover {
    background: white;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface-dark);
    border: 1px solid var(--border);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-btn:hover {
    background: white;
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

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

.user-role {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.user-btn i:last-child {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-left: 0.5rem;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    margin-top: 0.75rem;
    display: none;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

.user-dropdown.show {
    display: block;
}

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

.dropdown-header {
    padding: 1.25rem;
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border-bottom: 1px solid var(--border);
}

.dropdown-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown-user i {
    font-size: 2.5rem;
    color: var(--accent);
}

.dropdown-user h4 {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropdown-user p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item i {
    width: 20px;
    color: var(--text-tertiary);
    font-size: 1rem;
}

.dropdown-item:hover {
    background: var(--surface-dark);
    padding-left: 1.5rem;
    color: var(--accent);
}

.dropdown-item:hover i {
    color: var(--accent);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Main Container */
.nexus-container {
    max-width: 1600px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 1.5rem;
}

/* Sidebar */
.nexus-sidebar {
    width: 300px;
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.5);
    height: fit-content;
    position: sticky;
    top: 90px;
    overflow: hidden;
    padding: 1.5rem 0;
}

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

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.nav-section-title i {
    font-size: 0.8rem;
    color: var(--accent);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 0.25rem;
    flex-wrap: nowrap;
}
.nav-item.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.is-disabled-btn,
.is-disabled-link {
    opacity: 0.6;
    cursor: not-allowed;
}

.is-disabled-btn:hover,
.is-disabled-link:hover {
    transform: none;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--surface-dark);
    color: var(--accent);
}

.nav-item.active {
    background: linear-gradient(145deg, #EEF2FF, #E0E7FF);
    color: var(--accent);
    font-weight: 500;
}

.nav-item.active .nav-icon i {
    color: var(--accent);
}

.nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon i {
    font-size: 1.1rem;
    color: var(--text-tertiary);
}

.nav-item span {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-count {
    background: var(--surface-dark);
    color: var(--text-secondary);
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 40px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.nav-home {
    background: linear-gradient(145deg, #4158D0, #C850C0);
    color: white !important;
    margin-bottom: 1rem;
}

.nav-home .nav-icon i {
    color: white;
}

.nav-home:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.nav-indicator {
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 4px;
    opacity: 0;
}

.nav-home.active .nav-indicator {
    opacity: 1;
}

.sidebar-footer {
    padding: 1.5rem 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}

.storage-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.storage-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.storage-bar {
    height: 6px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.storage-progress {
    height: 100%;
    background: var(--gradient-2);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.storage-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* Main Content */
.nexus-main {
    flex: 1;
    min-width: 0;
}

/* Quick Actions Bar */
.quick-actions {
    background: white;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255,255,255,0.5);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-dark);
    border: 1px solid var(--border);
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: white;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--success);
}

.connection-status i {
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Content Area */
.content-area {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.5);
    min-height: 600px;
}

/* Dashboard Home */
.dashboard-home {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.subscription-warning{
    display:flex;
    align-items:center;
    gap:0.75rem;
    padding:0.9rem 1rem;
    border-radius:14px;
    border:1px solid #fca5a5;
    background:#fff1f2;
    color:#991b1b;
    font-weight:600;
}
.subscription-warning.hidden{display:none;}
.onboarding-hint {
    margin-top: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.dash-active-plan {
    margin-top: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dbeafe;
    font-weight: 600;
    flex-wrap: wrap;
}
.dash-plan-label {
    color: #bfdbfe;
}
.dash-plan-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}
.subscription-warning-link{
    margin-left:auto;
    color:#991b1b;
    text-decoration:underline;
    font-weight:700;
}
.subscription-widget{
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border-radius:16px;
    padding:1rem 1.25rem;
    border:1px solid rgba(255,255,255,0.5);
}
.subscription-widget-title{
    display:flex;
    align-items:center;
    gap:0.5rem;
    font-weight:700;
    margin-bottom:0.6rem;
    color:var(--text-primary);
}
.subscription-widget-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:0.5rem 1rem;
    font-size:0.92rem;
    color:var(--text-primary);
}
.sw-k{color:var(--text-tertiary);}
@media (max-width: 980px){
    .subscription-widget-grid{grid-template-columns:1fr;}
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(145deg, #0B1120, #1E293B);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
}

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

.banner-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

.banner-content p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    max-width: 500px;
}

.banner-illustration {
    font-size: 4rem;
    color: rgba(255,255,255,0.2);
    position: relative;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.5);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-title i {
    color: var(--accent);
}

/* Quick Access Grid */
.access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.access-card {
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255,255,255,0.5);
}

.access-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.access-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.access-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.access-card p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.card-arrow {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.access-card:hover .card-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* Recent Activity */
.recent-activity {
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border-radius: 16px;
    padding: 1.5rem;
}

.activity-list {
    min-height: 100px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Portal Cards (for other pages) */
.portal-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header h2 i {
    margin-right: 0.5rem;
    color: var(--accent);
}

.card-content {
    padding: 1.5rem;
}

.system-status-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:1rem;
}
.system-status-item{
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border:1px solid rgba(255,255,255,0.5);
    border-radius:12px;
    padding:0.9rem 1rem;
    display:flex;
    flex-direction:column;
    gap:0.35rem;
}
.system-status-actions{
    margin-top:1rem;
    display:flex;
    gap:0.75rem;
    flex-wrap:wrap;
}
.system-status-actions .edit-btn{
    text-decoration:none;
}
@media (max-width: 900px){
    .system-status-grid{
        grid-template-columns:1fr;
    }
}

/* Profile layout */
.profile-card {
    background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.profile-header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-dark);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    overflow: hidden;
}
.profile-avatar-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.profile-avatar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.profile-avatar-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.profile-avatar-actions {
    margin-top: 0.35rem;
}
.profile-upload-btn {
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    font-size: 0.8rem;
    box-shadow: none;
}
.profile-upload-btn:hover {
    transform: none;
    box-shadow: 0 6px 14px rgba(65,88,208,0.18);
}
.profile-section {
    padding-top: 1.3rem;
}
.profile-section-title {
    margin: 0 0 1rem;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
}
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}
.profile-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 52px;
}
.profile-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
}
.profile-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.danger-zone {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: linear-gradient(145deg, #FFF8F8, #FFF1F2);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.danger-zone .delete-btn {
    align-self: flex-start;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    font-size: 0.82rem;
}
.profile-field {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.profile-field:last-child {
    border-bottom: none;
}
.admin-storage-panel {
    width: 100%;
    overflow-x: hidden;
}
#viewAdmin .card-content {
    overflow-x: auto;
}
.admin-storage-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.admin-storage-summary-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 0;
}
.admin-storage-controls {
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.admin-storage-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}
.admin-storage-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 0.5rem;
}
.admin-storage-table-wrap .table {
    min-width: 980px;
    border: none;
    border-radius: 0;
}
.admin-storage-table-wrap .table th,
.admin-storage-table-wrap .table td {
    white-space: nowrap;
}
.field-label {
    width: 150px;
    font-weight: 500;
    color: var(--text-secondary);
}
.field-value {
    flex: 1;
    color: var(--text-primary);
}

/* Buttons */
.edit-btn {
    background: linear-gradient(145deg, #4158D0, #C850C0);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(65,88,208,0.2);
}

.delete-btn {
    background: linear-gradient(145deg, #EF4444, #DC2626);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.save-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: var(--text-tertiary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Code Display */
.code-box {
    font-size: 3rem;
    font-family: monospace;
    letter-spacing: 1rem;
    background: linear-gradient(145deg, #0B1120, #1E293B);
    padding: 2rem;
    text-align: center;
    border-radius: 16px;
    margin: 2rem 0;
    color: white;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.gen-btn {
    background: linear-gradient(145deg, #4158D0, #C850C0);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn {
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 1rem 2.5rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
}

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

@media (max-width: 1024px) {
    .nexus-container {
        flex-direction: column;
    }
    
    .nexus-sidebar {
        width: 100%;
        position: static;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nexus-sidebar.collapsed {
        display: none;
    }
    
    .mobile-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .header-grid {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }
    
    .brand-text {
        display: none;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stats-grid,
    .access-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 1rem;
    }
    .profile-header {
        flex-direction: column;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .admin-storage-field {
        min-width: 100%;
    }
}

.dropdown-item.theme-row {
    cursor: default;
    background: transparent;
}
.dropdown-item.theme-row:hover {
    padding-left: 1.25rem;
    color: var(--text-primary);
    background: var(--surface-dark);
}
.theme-select {
    margin-left: auto;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-primary);
    font-size: 0.8rem;
}
/* Legacy compat utilities for old engine */
.hidden {
    display: none !important;
}
.compat-hidden {
    display: none !important;
}

.msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.msg.ok {
    color: var(--success);
}
.msg.err {
    color: var(--danger);
}

.hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0.75rem 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--surface-dark);
}
.pill.on {
    color: var(--success);
    border-color: rgba(16,185,129,0.4);
}
.pill.off {
    color: var(--danger);
    border-color: rgba(239,68,68,0.4);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.table th,
.table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.85rem;
}
.table th {
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--surface-dark);
}
.table tr:last-child td {
    border-bottom: none;
}

.status-online {
    color: #16a34a;
    font-weight: 600;
}
.status-offline {
    color: #ef4444;
    font-weight: 600;
}

.hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}
.form {
    display: grid;
    gap: 0.75rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}
.cancel-btn {
    background: var(--surface-dark);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cancel-btn:hover {
    background: white;
    border-color: var(--accent);
    color: var(--accent);
}
.form label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.form input {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-primary);
}
.form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: grid;
    place-items: center;
    z-index: 1200;
    padding: 1rem;
}
.modal-card {
    width: min(520px, 96vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

#page-subscriptions-payments {
    width: 100%;
    margin: 0;
    position: relative;
    left: auto;
    right: auto;
}

.hub-card-shell {
    width: 100%;
    margin-top: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#subscription-payment-root {
    width: 100%;
    min-height: calc(100vh - 24px);
    box-sizing: border-box;
    border-radius: 24px;
    overflow: hidden;
}

/* Billing panel should consume Hub content space without the default white card wrapper. */
body.billing-mode .content-area {
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border-top: 0;
    outline: 0;
}

body.billing-mode #page-subscriptions-payments {
    width: 100%;
    max-width: none;
    margin: -2px 0 0;
    padding: 0;
    padding-top: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    border-top: 0;
    outline: 0;
}

body.billing-mode #page-subscriptions-payments .hub-card-shell {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    outline: 0;
}

body.billing-mode #page-subscriptions-payments .hub-card-shell::before,
body.billing-mode #page-subscriptions-payments .hub-card-shell::after,
body.billing-mode #page-subscriptions-payments::before,
body.billing-mode #page-subscriptions-payments::after {
    content: none !important;
    display: none !important;
}

body.billing-mode #subscription-payment-root {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    padding-top: 0;
    min-height: calc(100vh - 24px);
    box-sizing: border-box;
    border-radius: 24px;
    overflow: hidden;
    border-top: 0;
    outline: 0;
}

body.billing-mode #subscription-payment-root .max-w-5xl {
    max-width: none;
}

body.billing-mode #subscription-payment-root > .bg-mesh + .glass-panel {
    border-top: 0;
}
