@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #a1a1b5;
    --text-muted: #71718a;
    --accent-blue: #4c7fff;
    --accent-blue-glow: rgba(76, 127, 255, 0.3);
    --accent-green: #22c55e;
    --accent-green-glow: rgba(34, 197, 94, 0.3);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.3);
    --accent-yellow: #eab308;
    --accent-purple: #a855f7;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.4;
}

body::before {
    content: '';
    position: fixed; top: -20%; left: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(76, 127, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none; z-index: 0;
}

body::after {
    content: '';
    position: fixed; bottom: -20%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none; z-index: 0;
}

a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-purple); }

/* Navbar */
.navbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 64px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.navbar-brand .logo { font-size: 24px; }
.navbar-links { display: flex; gap: 8px; }
.navbar-links a { padding: 8px 16px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition); }
.navbar-links a:hover, .navbar-links a.active { background: var(--bg-glass); color: var(--text-primary); }
.navbar-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.navbar-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-green-glow); } 50% { opacity: 0.7; box-shadow: 0 0 0 6px transparent; } }

.navbar-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0 20px;
    flex: 1;
    justify-content: center;
}

@media (max-width: 1000px) {
    .navbar-stats { display: none; }
}


/* Container */
.container { max-width: 1400px; margin: 0 auto; padding: 16px 24px; position: relative; z-index: 1; }
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.page-header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* Compact Stats Bar */
.stats-bar-compact { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; justify-content: center; align-items: center; }
.stat-pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 30px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-glass); background: var(--bg-card); transition: all var(--transition); }
.stat-pill:hover { background: var(--bg-card-hover); border-color: var(--border-active); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.stat-pill .icon { margin-right: 6px; font-size: 14px; }
.stat-pill .label { color: var(--text-secondary); margin-right: 4px; }
.stat-pill strong { font-weight: 700; font-size: 13px; }

.stat-pill.blue { background: rgba(76, 127, 255, 0.08); border-color: rgba(76, 127, 255, 0.2); }
.stat-pill.green { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.2); }
.stat-pill.red { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); }
.stat-pill.yellow { background: rgba(234, 179, 8, 0.08); border-color: rgba(234, 179, 8, 0.2); }
.stat-pill.purple { background: rgba(168, 85, 247, 0.08); border-color: rgba(168, 85, 247, 0.2); }
.stat-pill.red-dark { background: rgba(220, 38, 38, 0.12); border-color: rgba(220, 38, 38, 0.3); color: #fca5a5; }

/* Section Divider */
.section-divider { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border-glass), transparent); margin: 12px 0; }

/* Mailbox Section */
.mailbox-panel { padding: 0 16px; }
.mailbox-header h3 { color: #eab308; font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; text-shadow: 0 0 10px rgba(234, 179, 8, 0.3); }
.mailbox-ban-alert { margin-bottom: 20px; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.mailbox-flex-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.mailbox-card { background: rgba(234, 179, 8, 0.05); border: 1px solid rgba(234, 179, 8, 0.2); border-radius: var(--radius-md); padding: 14px 18px; display: flex; flex-direction: column; min-width: 200px; flex: 1; max-width: 300px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); position: relative; overflow: hidden; }
.mailbox-card.active { background: rgba(34, 197, 94, 0.05); border-color: rgba(34, 197, 94, 0.3); }
.mailbox-card.banned { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.3); }
.mailbox-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: #eab308; }
.mailbox-card.active::before { background: #22c55e; }
.mailbox-card.banned::before { background: #ef4444; }
.mailbox-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mailbox-card-server { font-size: 11px; font-weight: 800; color: #eab308; letter-spacing: 0.5px; }
.mailbox-card.active .mailbox-card-server { color: #22c55e; }
.mailbox-card.banned .mailbox-card-server { color: #ef4444; }
.mailbox-card-pc { font-size: 10px; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px; }
.mailbox-card-nick { font-size: 16px; font-weight: 700; color: white; margin-bottom: 4px; }
.mailbox-card-ban-text { font-size: 11px; color: #ef4444; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* PC Cards Grid */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.pc-card {
    background: var(--bg-card); border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg); padding: 24px;
    transition: all var(--transition); cursor: pointer;
    position: relative; overflow: hidden;
}
.pc-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); opacity: 0; transition: opacity var(--transition); }
.pc-card:hover { background: var(--bg-card-hover); border-color: var(--border-active); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pc-card:hover::before { opacity: 1; }
.pc-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.pc-card-name { display: flex; align-items: center; gap: 12px; }
.pc-card-name .pc-icon { font-size: 28px; }
.pc-card-name h3 { font-size: 16px; font-weight: 600; }
.pc-card-name .pc-ip { font-size: 12px; color: var(--text-muted); font-family: monospace; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-online { background: rgba(34, 197, 94, 0.12); color: var(--accent-green); border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-offline { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(234, 179, 8, 0.12); color: var(--accent-yellow); border: 1px solid rgba(234, 179, 8, 0.2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-online .dot { background: var(--accent-green); animation: pulse-dot 2s infinite; }
.badge-offline .dot { background: var(--accent-red); }
.badge-warning .dot { background: var(--accent-yellow); animation: pulse-dot 1.5s infinite; }

/* Metrics */
.metrics { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.metric { display: flex; align-items: center; gap: 12px; }
.metric-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); width: 40px; flex-shrink: 0; }
.metric-bar { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 3px; overflow: hidden; }
.metric-fill { height: 100%; border-radius: 3px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.metric-fill.blue { background: linear-gradient(90deg, var(--accent-blue), #7c9fff); }
.metric-fill.purple { background: linear-gradient(90deg, var(--accent-purple), #c084fc); }
.metric-fill.green { background: linear-gradient(90deg, var(--accent-green), #4ade80); }
.metric-fill.warning { background: linear-gradient(90deg, var(--accent-yellow), #fbbf24) !important; }
.metric-fill.danger { background: linear-gradient(90deg, var(--accent-red), #f87171) !important; }
.metric-value { font-size: 11px; font-weight: 600; color: var(--text-primary); width: 36px; text-align: right; flex-shrink: 0; }

/* Process */
.process-section { border-top: 1px solid var(--border-glass); padding-top: 14px; margin-top: 4px; }
.process-section h4 { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.process-list { display: flex; flex-wrap: wrap; gap: 6px; }
.process-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 500; font-family: monospace; }
.process-tag.running { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); border: 1px solid rgba(34, 197, 94, 0.15); }
.process-tag.stopped { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.15); }
.pc-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-glass); }
.pc-card-footer .last-seen { font-size: 10px; color: var(--text-muted); }
.pc-card-footer .version {
    font-size: 10px;
    font-family: monospace;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(76, 127, 255, 0.10);
    border: 1px solid rgba(76, 127, 255, 0.20);
    padding: 1px 6px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Detail Page */
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.detail-header .back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 14px; }
.detail-header .back-link:hover { color: var(--text-primary); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-card { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 24px; }
.detail-card.full-width { grid-column: 1 / -1; }
.detail-card h3 { font-size: 14px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.info-row:last-child { border-bottom: none; }
.info-row .label { font-size: 13px; color: var(--text-secondary); }
.info-row .value { font-size: 13px; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all var(--transition); font-family: inherit; }
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #3d6fe6; box-shadow: 0 0 20px var(--accent-blue-glow); transform: translateY(-1px); }
.btn-success { background: var(--accent-green); color: #fff; }
.btn-success:hover { background: #16a34a; box-shadow: 0 0 20px var(--accent-green-glow); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 0 20px var(--accent-red-glow); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-glass); }
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); border-color: var(--border-active); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-card { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 24px; }
.settings-card.full-width { grid-column: 1 / -1; }
.settings-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; font-family: inherit; transition: all var(--transition); outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-glow); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group .help-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.tag-input-wrapper { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); min-height: 42px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: rgba(76, 127, 255, 0.12); border: 1px solid rgba(76, 127, 255, 0.2); border-radius: 6px; font-size: 12px; color: var(--accent-blue); font-weight: 500; }
.tag .remove { cursor: pointer; opacity: 0.6; font-size: 14px; line-height: 1; }
.tag .remove:hover { opacity: 1; }
.tag-input { border: none !important; background: transparent !important; padding: 4px !important; font-size: 13px !important; flex: 1; min-width: 120px; box-shadow: none !important; outline: none !important; }

/* Toast */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; min-width: 300px; max-width: 450px; animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards; backdrop-filter: blur(10px); }
.toast-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.25); color: var(--accent-green); }
.toast-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.25); color: var(--accent-red); }
.toast-info { background: rgba(76, 127, 255, 0.15); border: 1px solid rgba(76, 127, 255, 0.25); color: var(--accent-blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(50%); } }

/* Empty State */
.empty-state { text-align: center; padding: 80px 20px; grid-column: 1 / -1; }
.empty-state .icon { font-size: 64px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 14px; max-width: 400px; margin: 0 auto; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* Action Buttons */
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border-glass); border-radius: var(--radius-xl); padding: 32px; min-width: 400px; max-width: 90vw; transform: scale(0.9); transition: transform var(--transition); }
.modal-overlay.active .modal { transform: scale(1); }
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .navbar { padding: 0 16px; }
    .pc-grid { grid-template-columns: 1fr; }
    .detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
