* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #F3F4F6;
    color: #1F2937;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #F3F4F6;
    color: #1F2937;
}

.nav-item.active {
    background: #EEF2FF;
    color: #4F46E5;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #FECACA;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h1 {
    font-size: 24px;
    font-weight: 700;
}

.merchant-name {
    padding: 8px 16px;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 14px;
    color: #6B7280;
}

.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.green { background: #DCFCE7; color: #16A34A; }
.stat-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-icon.purple { background: #F3E8FF; color: #9333EA; }
.stat-icon.yellow { background: #FEF3C7; color: #D97706; }

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.table tbody td {
    padding: 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #F9FAFB;
}

.text-center {
    text-align: center !important;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending { background: #FEF3C7; color: #D97706; }
.status-badge.paid { background: #DCFCE7; color: #16A34A; }
.status-badge.expired { background: #FEE2E2; color: #DC2626; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
}

.text-muted {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9CA3AF;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4F46E5;
    color: white;
}

.btn-primary:hover {
    background: #4338CA;
}

.btn-copy, .btn-show {
    padding: 8px 16px;
    background: #F3F4F6;
    color: #6B7280;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy:hover, .btn-show:hover {
    background: #E5E7EB;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
