* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-header .version {
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    padding: 2px 10px;
    border-radius: 12px;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    gap: 12px;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.connection-status .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.connection-status .dot.online {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.connection-status .dot.offline {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.page-header p {
    color: #6b7280;
    margin-top: 4px;
}

/* Status Cards */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.status-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

.status-card.full-width {
    grid-column: 1 / -1;
}

.status-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.status-card-header .status-icon {
    font-size: 24px;
}

.status-card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.status-item:last-child {
    border-bottom: none;
}

.status-item .label {
    color: #6b7280;
    font-size: 14px;
}

.status-item .value {
    font-weight: 500;
    font-size: 14px;
}

.status-item .value.online {
    color: #059669;
}

.status-item .value.offline {
    color: #dc2626;
}

/* Endpoints Grid */
.endpoints-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 13px;
}

.endpoint-item .method {
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.endpoint-item .method.get {
    background: #dbeafe;
    color: #2563eb;
}

.endpoint-item .method.post {
    background: #d1fae5;
    color: #059669;
}

.endpoint-item .path {
    font-family: monospace;
    color: #1a1a2e;
}

.endpoint-item .desc {
    color: #6b7280;
    font-size: 12px;
    margin-left: auto;
}

/* Filters Section */
.filters-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.filters-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #6366f1;
    color: #fff;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-group label {
    font-size: 13px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: #6366f1;
}

/* Tabs */
.tabs-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 16px;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #1a1a2e;
}

.tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.tab-content-wrapper {
    padding: 16px 24px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Results */
.results-container {
    max-height: 600px;
    overflow-y: auto;
}

.pedido-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #6366f1;
    transition: all 0.2s;
}

.pedido-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pedido-card .pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.pedido-card .pedido-header .pedido-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pedido-card .pedido-header .pedido-info span {
    font-size: 13px;
    color: #4b5563;
}

.pedido-card .pedido-header .pedido-info strong {
    color: #1a1a2e;
}

.pedido-card .pedido-header .posicao-badge {
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.posicao-badge.B { background: #dbeafe; color: #2563eb; }
.posicao-badge.P { background: #d1fae5; color: #059669; }
.posicao-badge.L { background: #fef3c7; color: #d97706; }
.posicao-badge.M { background: #fce4ec; color: #dc2626; }

.pedido-card .produtos-list {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.pedido-card .produtos-list .produto-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    gap: 8px;
    flex-wrap: wrap;
}

.pedido-card .produtos-list .produto-item .produto-desc {
    flex: 1;
    min-width: 150px;
}

.pedido-card .produtos-list .produto-item .produto-qtd {
    color: #6b7280;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 72px;
    }
    .sidebar-header h1, .sidebar-header .version, .nav-text, .sidebar-footer span:last-child {
        display: none;
    }
    .sidebar-header {
        justify-content: center;
        padding: 16px;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .nav-icon {
        font-size: 24px;
    }
    .main-content {
        margin-left: 72px;
        padding: 16px;
    }
    .status-grid {
        grid-template-columns: 1fr;
    }
    .endpoints-grid {
        grid-template-columns: 1fr;
    }
    .filters-grid {
        grid-template-columns: 1fr;
    }
    .tabs-header {
        padding: 0 8px;
    }
    .tab-btn {
        padding: 10px 14px;
        font-size: 12px;
    }
    .pedido-card .pedido-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .filters-header {
        flex-wrap: wrap;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a7ae;
}