@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
}

a { color: inherit; text-decoration: none; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, 0.5); }

/* ============ VIEWS ============ */
.view { display: none; min-height: 100vh; animation: fadeIn 0.3s ease; }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ LOGIN ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1040 50%, #0a0a1a 100%);
}

.login-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 50px 44px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
}

.login-card .logo-icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 20px rgba(168,85,247,0.3));
}

.login-card h1 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    margin-bottom: 32px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============ NAVBAR ============ */
.navbar {
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.navbar .logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo span { color: #a855f7; }
.navbar .logo .logo-emoji { font-size: 22px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-links a.active { color: #a855f7; background: rgba(168,85,247,0.1); }

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.08);
    margin: 0 8px;
}

/* ============ CONTAINER ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
}

.container-sm { max-width: 640px; }
.container-md { max-width: 720px; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 28px;
    letter-spacing: -0.3px;
}

/* ============ FORM ============ */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.25s;
}

.form-input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: rgba(168,85,247,0.5);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
    background: rgba(255,255,255,0.08);
}

select option { background: #1a1a2e; color: #fff; }

.form-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

textarea {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-family: 'Inter', monospace;
    font-size: 13px;
    outline: none;
    resize: vertical;
    min-height: 120px;
    transition: all 0.25s;
}

textarea:focus {
    border-color: rgba(168,85,247,0.5);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}

/* ============ BUTTONS ============ */
.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 11px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, #7c5cfc, #a855f7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124,92,252,0.25);
}
.btn-primary:hover { box-shadow: 0 8px 25px rgba(124,92,252,0.4); }

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16,185,129,0.2);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-warning {
    background: rgba(234,179,8,0.2);
    color: #fde047;
    border: 1px solid rgba(234,179,8,0.2);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

.btn-group { display: flex; gap: 10px; margin-top: 28px; }
.btn-group .btn-primary { flex: 1; justify-content: center; }

/* ============ CARDS ============ */
.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 18px;
    transition: border-color 0.3s;
}

.card:hover { border-color: rgba(255,255,255,0.1); }

.card h2 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.card .desc {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 18px;
}

/* ============ STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.25s;
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168,85,247,0.2);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.stat-card .number {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #7c5cfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}

/* ============ TOOLBAR ============ */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 160px;
}

/* ============ TABLE ============ */
.table-wrapper {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
    background: rgba(255,255,255,0.04);
    padding: 13px 16px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

.actions { display: flex; gap: 6px; }

/* ============ BADGES ============ */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-arma { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-capacete { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-traje { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.badge-pet { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-item { background: rgba(234,179,8,0.15); color: #fde047; }
.badge-mochila { background: rgba(236,72,153,0.15); color: #f9a8d4; }
.badge-carro { background: rgba(14,165,233,0.15); color: #7dd3fc; }
.badge-cosmetico { background: rgba(249,115,22,0.15); color: #fdba74; }
.badge-especial { background: rgba(234,179,8,0.2); color: #fde047; }

/* ============ ALERTS ============ */
.alert {
    padding: 13px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.15);
}

.alert-success {
    background: rgba(34,197,94,0.1);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.15);
}

.alert-info {
    background: rgba(59,130,246,0.1);
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.15);
}

.alert-warning {
    background: rgba(234,179,8,0.1);
    color: #fde047;
    border: 1px solid rgba(234,179,8,0.15);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.3);
}

.empty-state .icon { font-size: 48px; margin-bottom: 14px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ============ BOT STATUS ============ */
.bots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}

.bot-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
}

.bot-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bot-card .bot-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 16px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.status-online {
    background: rgba(34,197,94,0.15);
    color: #86efac;
}

.status-online::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

.status-offline {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
}

.status-offline::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}

.status-connecting {
    background: rgba(234,179,8,0.15);
    color: #fde047;
}

.status-connecting::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #eab308;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.qr-container {
    margin: 16px auto;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    display: inline-block;
}

.qr-container img { display: block; border-radius: 4px; }

/* ============ TOGGLE ============ */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px 20px;
}

.toggle-title { font-size: 14px; color: #fff; font-weight: 600; }
.toggle-desc { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 2px; }

.toggle-status {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.toggle-on { background: rgba(34,197,94,0.15); color: #86efac; }
.toggle-off { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ============ IMPORT SECTION ============ */
.import-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.import-section input[type="file"] {
    padding: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    flex: 1;
}

.divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 22px 0;
}

/* ============ TEST SECTION ============ */
.test-result {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    color: #86efac;
    min-height: 60px;
}

/* ============ LOADING ============ */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .bots-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .navbar { padding: 0 16px; }
    .container { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
