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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #1a202c;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #718096;
}

.header-user button {
    padding: 6px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat {
    flex: 1;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: white;
}

.stat.critical {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.stat.high {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.stat.medium {
    background: linear-gradient(135deg, #ecc94b 0%, #d69e2e 100%);
}

.stat.low {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
}

/* Filters */
.filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #2d3748;
    min-width: 150px;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.btn-refresh {
    margin-left: auto;
    padding: 8px 16px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: #3182ce;
}

/* Table */
.findings-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

table {
    width: 100%;
    min-width: 1000px;
    table-layout: fixed;
    border-collapse: collapse;
}

thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    user-select: none;
}

/* Resizable column handle */
th .resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 1;
}

th .resize-handle:hover {
    background: #cbd5e0;
}

tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s;
}

tbody tr:hover {
    background: #f7fafc;
}

td {
    padding: 12px 16px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.CRITICAL {
    background: #feb2b2;
    color: #742a2a;
}

.badge.HIGH {
    background: #fbd38d;
    color: #7c2d12;
}

.badge.MEDIUM {
    background: #faf089;
    color: #744210;
}

.badge.LOW {
    background: #9ae6b4;
    color: #22543d;
}

.badge.NEW {
    background: #bee3f8;
    color: #2c5282;
}

.badge.IN_PROGRESS {
    background: #d6bcfa;
    color: #44337a;
}

.badge.RESOLVED {
    background: #9ae6b4;
    color: #22543d;
}

.badge.FALSE_POSITIVE {
    background: #e2e8f0;
    color: #4a5568;
}

.resource-arn {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: #4a5568;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assigned-to {
    font-size: 13px;
    color: #4a5568;
}

.date {
    font-size: 13px;
    color: #718096;
}

/* Actions */
.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-view {
    padding: 6px 12px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-view:hover {
    background: #3182ce;
}

.btn-delete {
    padding: 6px 8px;
    background: transparent;
    color: #e53e3e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: #fff5f5;
    color: #c53030;
}

.btn-delete svg {
    width: 16px;
    height: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideDown 0.3s;
}

.modal-content.modal-small {
    max-width: 450px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-size: 20px;
    color: #1a202c;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #2d3748;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.finding-detail {
    margin-bottom: 20px;
}

.finding-detail label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.finding-detail p {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.6;
}

.finding-detail code {
    display: block;
    padding: 8px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #2d3748;
    overflow-x: auto;
}

.finding-detail input[type="email"],
.finding-detail input[type="text"],
.finding-detail select,
.finding-detail textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
}

.finding-detail input:focus,
.finding-detail select:focus,
.finding-detail textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.warning-text {
    color: #e53e3e;
    font-weight: 500;
    margin-top: 8px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #718096;
}

.empty-state p {
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

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

.pagination-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #4299e1;
    color: #4299e1;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
    padding: 0 10px;
}
