/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #0A0F1E;
    --bg-glass: #1E293B;
    --border-color: rgba(99, 102, 241, 0.2);
    --border-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-accent: #10B981;
    --accent-primary: #6366F1;
    --accent-hover: #818CF8;
    --accent-dark: #4F46E5;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --success: #10B981;
    --terminal-bg: #0A0F1E;
    --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* ===== Card Effect ===== */
.glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.glass-hover:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ===== Auth Page ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 50%, #1a1040 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 420px;
}

.auth-card {
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

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

.auth-logo {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.auth-tab.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    outline: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dark));
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

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

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-hover);
    text-decoration: none;
    cursor: pointer;
}

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

.oauth-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.oauth-title {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.oauth-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.oauth-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.3s;
}

.oauth-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s;
}

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

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

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

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

/* ===== Main Layout ===== */
.main-layout {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.main-layout.active {
    display: flex;
}

/* Top Nav */
.top-nav {
    height: 52px;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    z-index: 100;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-server-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-server-selector:hover {
    border-color: var(--accent-primary);
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.user-menu:hover {
    background: rgba(99, 102, 241, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    display: none;
    z-index: 200;
    animation: fadeIn 0.2s;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

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

/* Content Area */
.content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Server Sidebar */
.server-sidebar {
    width: 240px;
    background: rgba(15, 23, 42, 0.8);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--border-color);
    color: var(--accent-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.sidebar-add-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent-primary);
}

.server-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.server-group {
    margin-bottom: 16px;
}

.server-group-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.server-group-count {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-hover);
}

.server-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px;
    position: relative;
}

.server-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.server-item.active {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.server-item-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 4px;
}

.server-item:hover .server-item-actions {
    display: flex;
}

.server-item-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.server-item-action-btn:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.3);
}

.server-item-action-btn.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--text-secondary);
}

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

.server-item-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-item-host {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Terminal Area */
.terminal-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--terminal-bg);
    min-width: 0;
}

.terminal-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    height: 36px;
}

.terminal-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
    transition: all 0.2s;
    min-width: 0;
}

.terminal-tab:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-primary);
}

.terminal-tab.active {
    background: var(--terminal-bg);
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
}

.terminal-tab-close {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.terminal-tab-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.terminal-container {
    flex: 1;
    padding: 4px;
    position: relative;
}

#terminal {
    width: 100%;
    height: 100%;
}

/* Command Panel */
.command-panel {
    width: 300px;
    background: rgba(15, 23, 42, 0.8);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.command-panel.collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}

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

.panel-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.panel-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.panel-search {
    padding: 12px 16px;
}

.panel-search input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.panel-search input:focus {
    border-color: var(--accent-primary);
}

.panel-filter {
    padding: 0 16px 12px;
    display: flex;
    gap: 8px;
}

.panel-filter select {
    flex: 1;
    padding: 6px 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.command-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.command-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    animation: slideIn 0.3s ease;
}

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

.command-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--border-color);
}

.command-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--success);
    word-break: break-all;
    line-height: 1.5;
}

.command-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.command-server-tag {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-hover);
    font-size: 10px;
}

.command-actions {
    display: none;
    gap: 4px;
}

.command-item:hover .command-actions {
    display: flex;
}

.command-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.command-action-btn:hover {
    color: var(--text-primary);
}

.command-action-btn.delete:hover {
    color: var(--danger);
}

.command-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.command-panel-footer button {
    width: 100%;
}

/* Status Bar */
.status-bar {
    height: 28px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    animation: modalIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Danger Confirm Dialog */
.danger-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 2px solid var(--danger);
    border-radius: 16px;
    padding: 24px;
    z-index: 400;
    width: 450px;
    display: none;
    animation: modalIn 0.3s ease;
}

.danger-dialog.show {
    display: block;
}

.danger-dialog-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

.danger-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--danger);
    text-align: center;
    margin-bottom: 8px;
}

.danger-dialog-message {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.5;
}

.danger-dialog-command {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    word-break: break-all;
}

.danger-dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .command-panel {
        position: fixed;
        right: 0;
        top: 52px;
        bottom: 28px;
        z-index: 50;
        box-shadow: -5px 0 30px rgba(0,0,0,0.5);
    }

    .command-panel.collapsed {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .server-sidebar {
        position: fixed;
        left: 0;
        top: 52px;
        bottom: 28px;
        z-index: 50;
        transform: translateX(-100%);
    }

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

    .auth-container {
        width: 90%;
    }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 14px;
}

/* Toggle Sidebar Button */
.toggle-sidebar-btn {
    display: none;
}

@media (max-width: 768px) {
    .toggle-sidebar-btn {
        display: flex;
    }
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Custom Toast ===== */
.app-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    text-align: center;
}
.app-toast.show {
    transform: translateX(-50%) translateY(0);
}
.app-toast-info {
    background: var(--accent-primary);
    color: white;
}
.app-toast-success {
    background: var(--success);
    color: white;
}
.app-toast-error {
    background: var(--danger);
    color: white;
}
.app-toast-warning {
    background: var(--warning);
    color: #1E293B;
}

/* ===== Custom Confirm Dialog ===== */
.app-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.app-confirm-overlay.show {
    display: flex;
}
.app-confirm-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    min-width: 360px;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.app-confirm-message {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}
.app-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== 管理后台面板 ===== */
#admin-panel-overlay.show {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.admin-panel {
    width: 100%;
    max-width: 960px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.admin-header h2 {
    font-size: 20px;
    margin: 0;
    white-space: nowrap;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 3px;
    flex: 1;
}

.admin-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.admin-tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

#admin-close-btn {
    font-size: 18px;
    padding: 4px 10px;
}

.admin-tab-content {
    animation: fadeIn 0.2s ease;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.admin-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.15s;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.admin-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.admin-stat-value.accent-green {
    color: var(--success);
}

.admin-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.admin-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
}

.admin-table tbody tr:hover {
    background: var(--bg-hover);
}

.admin-row-inactive {
    opacity: 0.5;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-sm {
    padding: 1px 6px;
    font-size: 10px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}



/* ===== 登录页隐私说明 & 页脚 ===== */
.auth-intro {
    margin-top: 20px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.auth-intro p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.6;
}

.auth-intro p:last-child {
    margin-bottom: 0;
}

.auth-version {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 14px;
    opacity: 0.6;
}

.auth-footer-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px;
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.status-feedback,
.status-icp {
    font-size: 11px !important;
    opacity: 0.6;
    margin-left: 12px;
}

/* ===== 登录页左侧特性介绍 ===== */
.auth-page {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 48px;
    padding: 40px 20px;
}

.auth-features {
    flex: 0 0 460px;
    padding: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.auth-features-title {
    font-size: 22px;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    font-weight: 700;
}

.auth-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}

.auth-features-list h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    font-weight: 600;
}

.auth-features-list p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===== 全局底部状态栏 ===== */
.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.page-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.page-footer a:hover {
    color: var(--accent-primary);
}

.page-footer .footer-divider {
    opacity: 0.4;
}
