:root {
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1f1f1f;
    --text-main: #e0e0e0;
    --accent-color: #00ff41; /* Green Neon */
    --accent-dim: #008f11;
    --error-color: #ff3333;
    --warning-color: #ffcc00;
    --border-color: #333;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* HEADER */
header {
    background: var(--bg-card);
    padding: 1rem;
    border-bottom: 2px solid var(--accent-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.matrix-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: var(--accent-color);
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--accent-dim);
}

.status-indicator {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    background: #333;
    color: #888;
}

.status-indicator.online {
    background: rgba(0, 255, 65, 0.2);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

/* NAV */
nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 255, 65, 0.05);
}

/* MAIN */
main {
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: flex;
}

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

/* DASHBOARD */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 6px;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-family: 'Share Tech Mono', monospace;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
}

.text-warning { color: var(--warning-color); }
.date-value { font-size: 1.2rem; margin-top: 0.5rem; }

.action-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
}

.action-btn:hover {
    background: var(--border-color);
    border-color: var(--accent-color);
}

/* LOGS */
.toolbar {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.log-console {
    background: #000;
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-color);
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.log-line { margin-bottom: 2px; border-bottom: 1px solid #111; }
.log-line.error { color: var(--error-color); }
.log-line.warn { color: var(--warning-color); }
.log-line.ok { color: var(--accent-color); text-shadow: 0 0 5px rgba(0,255,65,0.5); }

/* TABLES */
.table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #111;
    position: sticky;
    top: 0;
    font-family: 'Share Tech Mono', monospace;
    color: #888;
}

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

.small-btn {
    padding: 0.3rem 0.8rem;
    background: #333;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.small-btn:hover { background: #555; }

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--accent-dim);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 8px;
    padding: 1.5rem;
}

.close-btn {
    align-self: flex-end;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.modal-body {
    overflow-y: auto;
    margin-top: 1rem;
}

.json-viewer {
    background: #000;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}
