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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d0d0d;
    color: #fff;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #333;
}

.header h1 {
    font-size: 20px;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.controls select {
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
}

.controls button {
    padding: 8px 16px;
    background: #4ade80;
    border: none;
    color: #000;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.controls button:hover {
    background: #22c55e;
}

.controls input[type="text"] {
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    width: 180px;
}

.controls input[type="text"]::placeholder {
    color: #666;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
}

.checkbox-label input {
    cursor: pointer;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    padding: 0 0 16px 0;
    border-bottom: none;
}

.modal-table-container {
    width: 100%;
}

.modal-table-container .custom-table-wrapper {
    height: 350px;
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 1px solid #222;
}

.tab {
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
}

.tab.active {
    background: #333;
    color: #fff;
    border-color: #4ade80;
}

.stats {
    padding: 12px 24px;
    font-size: 13px;
    color: #888;
    background: #111;
}

.table-container {
    padding: 16px 24px;
}

/* AG Grid Theme Overrides */
.ag-theme-alpine-dark {
    --ag-background-color: #0d0d0d;
    --ag-header-background-color: #1a1a1a;
    --ag-odd-row-background-color: #111;
    --ag-row-hover-color: #1a1a1a;
    --ag-border-color: #333;
    --ag-header-foreground-color: #888;
    --ag-foreground-color: #fff;
}

/* Custom Table Styles */
.custom-table-wrapper {
    max-height: 500px;
    overflow: auto;
    border: 1px solid #333;
    border-radius: 4px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.custom-table th {
    position: sticky;
    top: 0;
    background: #1a1a1a;
    color: #888;
    font-weight: 500;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #333;
}

.custom-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #222;
}

.custom-table tr:nth-child(odd) {
    background: #111;
}

.custom-table tr:hover {
    background: #1a1a1a;
}

.custom-table input[type="text"],
.custom-table input[type="number"] {
    width: 100%;
    padding: 4px 8px;
    background: #252525;
    border: 1px solid #333;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
}

.custom-table input:focus {
    outline: none;
    border-color: #4ade80;
}

.custom-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.custom-table .delete-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
}

.custom-table .delete-btn:hover {
    color: #f87171;
}

/* Column widths */
.custom-table th:nth-child(1),
.custom-table td:nth-child(1) {
    min-width: 200px;
}

.custom-table th:nth-child(2),
.custom-table td:nth-child(2),
.custom-table th:nth-child(3),
.custom-table td:nth-child(3),
.custom-table th:nth-child(4),
.custom-table td:nth-child(4) {
    width: 80px;
    text-align: right;
}

.custom-table th:nth-child(5),
.custom-table td:nth-child(5) {
    width: 70px;
    text-align: center;
}

.custom-table th:nth-child(6),
.custom-table td:nth-child(6) {
    width: 40px;
    text-align: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .tabs {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .tab {
        padding: 6px 12px;
        font-size: 12px;
    }

    .table-container {
        padding: 8px;
    }

    /* Mobile AG Grid */
    .ag-theme-alpine-dark {
        --ag-font-size: 10px;
        --ag-row-height: 28px;
        --ag-header-height: 28px;
    }

    /* Mobile Custom Table */
    .custom-table {
        font-size: 10px;
    }

    .custom-table th,
    .custom-table td {
        padding: 6px 8px;
    }

    .custom-table th:nth-child(1),
    .custom-table td:nth-child(1) {
        min-width: 100px;
    }

    .custom-table th:nth-child(2),
    .custom-table td:nth-child(2),
    .custom-table th:nth-child(3),
    .custom-table td:nth-child(3),
    .custom-table th:nth-child(4),
    .custom-table td:nth-child(4) {
        width: 45px;
    }

    .custom-table th:nth-child(5),
    .custom-table td:nth-child(5) {
        width: 35px;
    }

    .custom-table input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }
}
