/* ============================================================
   Bot-Hosting Platform – Horizons Media
   Dark Industrial Design
   ============================================================ */

:root {
    --bg-darkest: #08090c;
    --bg-dark: #0e1017;
    --bg-card: #141620;
    --bg-card-hover: #1a1d2e;
    --bg-input: #0e1017;
    --border: #1e2235;
    --border-hover: #2d3350;
    --text-primary: #e8eaf0;
    --text-secondary: #8b90a5;
    --text-muted: #555a72;
    --accent: #6c5ce7;
    --accent-hover: #7f71eb;
    --accent-glow: rgba(108, 92, 231, 0.15);
    --accent-subtle: rgba(108, 92, 231, 0.08);
    --green: #00d68f;
    --green-bg: rgba(0, 214, 143, 0.08);
    --green-border: rgba(0, 214, 143, 0.2);
    --red: #ff4757;
    --red-bg: rgba(255, 71, 87, 0.08);
    --red-border: rgba(255, 71, 87, 0.2);
    --yellow: #ffc048;
    --yellow-bg: rgba(255, 192, 72, 0.08);
    --yellow-border: rgba(255, 192, 72, 0.2);
    --blue: #4da6ff;
    --blue-bg: rgba(77, 166, 255, 0.08);
    --blue-border: rgba(77, 166, 255, 0.2);
    --radius: 10px;
    --radius-lg: 16px;
    --sidebar-width: 250px;
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-display);
    background: var(--bg-darkest);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    transition: all var(--transition);
    cursor: pointer;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    opacity: 0.7;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 10px;
}

.nav-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 4px 14px 8px;
    font-weight: 600;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn:hover {
    background: var(--red-bg) !important;
    color: var(--red) !important;
}

/* ============================================================
   CONTENT
   ============================================================ */

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
}

.content-full {
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--transition);
}

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

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ============================================================
   STATS GRID
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.03em;
}

.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.blue { color: var(--blue); }
.stat-value.yellow { color: var(--yellow); }

/* ============================================================
   STATUS BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.badge-running {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}

.badge-stopped {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}

.badge-error {
    background: var(--yellow-bg);
    color: var(--yellow);
    border: 1px solid var(--yellow-border);
}

.badge-admin {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.badge-blocked {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-running .badge-dot { animation: pulse 2s infinite; }

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

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
}

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

th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 24px var(--accent-glow);
}

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

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-green {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}

.btn-green:hover {
    background: rgba(0, 214, 143, 0.15);
}

.btn-red {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}

.btn-red:hover {
    background: rgba(255, 71, 87, 0.15);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================================
   FORMS
   ============================================================ */

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

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-display);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-file-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.form-file-zone:hover, .form-file-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.form-file-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.form-file-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.form-file-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-file-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid;
}

.alert-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green-border);
}

.alert-error {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}

.alert-warning {
    background: var(--yellow-bg);
    color: var(--yellow);
    border-color: var(--yellow-border);
}

.alert-info {
    background: var(--blue-bg);
    color: var(--blue);
    border-color: var(--blue-border);
}

/* ============================================================
   AUTH PAGES (LOGIN/REGISTER)
   ============================================================ */

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand-icon {
    width: 52px;
    height: 52px;
    background: var(--accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
    box-shadow: 0 0 30px var(--accent-glow);
}

.auth-brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

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

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

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

/* ============================================================
   LOGS VIEWER
   ============================================================ */

.log-viewer {
    background: var(--bg-darkest);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-secondary);
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================================
   CONFIRM MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 440px;
    width: 90%;
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.modal p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal .btn-group {
    justify-content: flex-end;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

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

    .content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-toggle {
        display: flex !important;
    }
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
}

/* ============================================================
   UTILITIES
   ============================================================ */

.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
