/* OfficeDesk - IT Management Dashboard */
/* Dark Theme CSS */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-hover: #222238;
    --accent: #00d4ff;
    --accent-dim: #0099bb;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555570;
    --success: #00e676;
    --warning: #ffab00;
    --danger: #ff5252;
    --border: #2a2a40;
    --sidebar-width: 240px;
    --radius: 12px;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── LOGIN PAGE ── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at 30% 40%, #0d1b2a 0%, var(--bg-primary) 70%);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.8em;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.9em;
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0099bb);
    color: #000;
    width: 100%;
    justify-content: center;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,212,255,0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-sm { padding: 8px 16px; font-size: 0.85em; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #000; }
.btn-warning { background: var(--warning); color: #000; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.error-msg {
    background: rgba(255,82,82,0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9em;
    display: none;
}

.error-msg.show { display: block; }

/* ── LAYOUT ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.sidebar-logo h2 {
    font-size: 1.1em;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo .version {
    font-size: 0.75em;
    color: var(--text-muted);
}

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.9em;
    transition: all 0.15s;
}

.sidebar-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav a.active { background: rgba(0,212,255,0.1); color: var(--accent); }
.sidebar-nav a .icon { font-size: 1.2em; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-footer a:hover { color: var(--danger); }

/* ── MAIN CONTENT ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
}

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

.page-header h1 {
    font-size: 1.6em;
    font-weight: 600;
}

.page-header .actions { display: flex; gap: 8px; }

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent-dim); }

.stat-card .stat-icon {
    font-size: 1.8em;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* ── CARDS / PANELS ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.2);
}

tr:hover td { background: var(--bg-hover); }

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge-online { background: rgba(0,230,118,0.15); color: var(--success); }
.badge-offline { background: rgba(255,82,82,0.15); color: var(--danger); }
.badge-busy { background: rgba(255,171,0,0.15); color: var(--warning); }
.badge-dns { background: rgba(0,212,255,0.15); color: var(--accent); }
.badge-http { background: rgba(0,230,118,0.15); color: var(--success); }
.badge-https { background: rgba(168,85,247,0.15); color: #a855f7; }

/* ── CAPTURE FEED ── */
.feed { max-height: 500px; overflow-y: auto; }

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88em;
    transition: background 0.15s;
}

.feed-item:hover { background: var(--bg-hover); }
.feed-item .feed-time { color: var(--text-muted); min-width: 75px; font-family: monospace; font-size: 0.85em; }
.feed-item .feed-type { min-width: 60px; }
.feed-item .feed-data { flex: 1; word-break: break-all; color: var(--text-secondary); }
.feed-item .feed-src { color: var(--accent); font-family: monospace; min-width: 120px; }

/* ── FILE BROWSER ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-muted); }

.file-icon { font-size: 1.2em; width: 28px; text-align: center; }

/* ── LOADING ── */
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

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

.loading-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--text-secondary);
    gap: 12px;
}

/* ── FILTERS BAR ── */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filters-bar input, .filters-bar select {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.88em;
    outline: none;
}

.filters-bar input:focus, .filters-bar select:focus {
    border-color: var(--accent);
}

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

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 { margin-bottom: 16px; }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3em; margin-bottom: 12px; }
.empty-state p { max-width: 300px; margin: 0 auto; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }
    .sidebar-nav a span { display: none; }
    .sidebar-logo h2 { display: none; }
    .sidebar-footer span { display: none; }
    .main-content { margin-left: 60px; padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
