:root {
    --primary: #1e3a8a;
    --primary-hover: #1e40af;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--gray-900);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 24px;
}

.brand-icon {
    background: #2563eb;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
}

.brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 11px;
    color: #94a3b8;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-item:hover, .nav-item.active {
    background: #1e293b;
    color: white;
}

.nav-item.active {
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.15);
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    background: white;
    padding: 16px 32px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.tag-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.content-container {
    padding: 32px;
    max-width: 1280px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

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

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.15s;
}

.form-control:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

tr:hover {
    background: var(--gray-50);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 11px;
    display: inline-block;
}

.badge-pass {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warn {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-fail {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Stat Box */
.stat-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 16px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    margin-top: 4px;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-danger {
    background: var(--danger-bg);
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.alert-success {
    background: var(--success-bg);
    border-left: 4px solid var(--success);
    color: #166534;
}

.alert-warning {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal Overlay & Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 540px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.2s ease-out;
}

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

.btn-outline {
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

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

/* Property Highlight in Matrix */
tr.row-selected-property {
    background-color: #eff6ff !important;
    border-left: 4px solid #2563eb;
    font-weight: 600;
}

tr.row-selected-property td {
    color: #1e3a8a;
}

/* Property Context Pill */
.property-context-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.card-spotlight {
    background: #f8fafc;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
    border-radius: var(--radius);
    padding: 18px 20px;
}

.table-filter-btn {
    font-size: 12px;
    padding: 4px 10px;
    font-weight: 600;
}


