/* app.css */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-gray: #F3F4F6;
    --border: #E5E7EB;
    --text-main: #111827;
    --text-sub: #6B7280;
    --white: #ffffff;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-gray);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 10;
    transition: transform 0.3s;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
}

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

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

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block !important;
    }
}

/* Sidebar */
.brand {
    padding: 20px;
    font-weight: bold;
    font-size: 18px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.nav-menu {
    padding: 10px 0;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover,
.nav-item.active {
    background: #EEF2FF;
    color: var(--primary);
}

.nav-group-title {
    padding: 15px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    letter-spacing: 0.5px;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    padding: 5px;
    font-size: 20px;
}

/* Components */
.card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--white);
    border-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #F9FAFB;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.form-hint {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 12px 16px;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-sub);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

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

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
}

.status-success {
    background: #D1FAE5;
    color: #065F46;
}

.status-failed {
    background: #FEE2E2;
    color: #991B1B;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

/* Utilities */
.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 1rem;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.font-bold {
    font-weight: bold;
}

.text-2xl {
    font-size: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 640px) {

    .grid-2,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}