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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #3b82f6;
    text-decoration: none;
}

a:hover {
    color: #2563eb;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar .logo {
    font-size: 22px;
    font-weight: 800;
    color: #3b82f6;
    text-align: center;
    padding: 24px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #64748b;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar nav a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.sidebar nav a.active {
    background: #eff6ff;
    color: #3b82f6;
    border-left: 3px solid #3b82f6;
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.user-info {
    color: #64748b;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.stat-icon {
    font-size: 32px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-icon.stores { background: rgba(59, 130, 246, 0.1); }
.stat-icon.active { background: rgba(16, 185, 129, 0.1); }
.stat-icon.sent { background: rgba(59, 130, 246, 0.1); }
.stat-icon.failed { background: rgba(239, 68, 68, 0.1); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1e293b;
}

.stat-info p {
    color: #64748b;
    font-size: 13px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: block;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.action-btn:hover {
    background: #ffffff;
    border-color: #3b82f6;
    color: #3b82f6;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.empty-state {
    color: #94a3b8;
    text-align: center;
    padding: 60px 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1e293b;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 12px 24px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn.danger {
    background: #ef4444;
}

.btn.danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-small.danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.api-form {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.template-list {
    margin-bottom: 30px;
}

.template-list h2 {
    margin-bottom: 15px;
}

.template-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.template-card {
    background: #ffffff;
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s;
}

.template-card:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
    text-decoration: none;
}

.template-card.active {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #3b82f6;
}

.template-card.new {
    border: 1px dashed #cbd5e1;
    color: #94a3b8;
}

.template-card.new:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.tpl-name {
    font-weight: 500;
}

.tpl-type {
    font-size: 12px;
    color: #94a3b8;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar .logo {
        font-size: 18px;
        padding: 10px;
    }

    .sidebar nav a {
        padding: 15px;
        text-align: center;
    }

    .sidebar nav a span {
        display: none;
    }

    .main-content {
        margin-left: 60px;
        padding: 15px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
