:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glass: rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    padding: 2rem 1rem;
    overflow-y: auto;
    z-index: 100;
}

.sidebar h1 {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--primary);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--background);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem 4rem;
    max-width: 1200px;
}

.header {
    margin-bottom: 3rem;
    backdrop-filter: blur(8px);
    background: var(--glass);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    position: sticky;
    top: 2rem;
    z-index: 50;
    box-shadow: var(--shadow);
}

.search-bar {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar:focus {
    border-color: var(--primary);
}

/* Criteria Cards */
.section-title {
    font-size: 1.5rem;
    margin: 3rem 0 1.5rem;
    color: var(--text);
    border-bottom: 2px solid var(--primary-light);
    display: inline-block;
}

.criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border-color: var(--primary-light);
}

.card .id {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.essencial {
    background: #fee2e2;
    color: #ef4444;
}

.badge.obrigatoria {
    background: #e0f2fe;
    color: #0ea5e9;
}

.mandatory-status {
    background: #fef2f2 !important;
    border: 2px solid #ef4444 !important;
}

.legal-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 1rem 0;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-light);
}

.flags-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
}

.flag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.flag i {
    font-size: 0.8rem;
}

.flag.yes {
    background: #ecfdf5;
    color: #059669;
    border-color: #10b981;
}

.flag.no {
    background: #f1f5f9;
    color: #94a3b8;
    opacity: 0.7;
}

.filter-item {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    color: var(--text-muted);
}

.filter-item.active {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.matrix-type {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.link-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.save-btn {
    align-self: flex-end;
    padding: 0.35rem 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.save-btn:hover {
    background: #1d4ed8;
}

.save-btn i {
    margin-right: 0.25rem;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
    }

    .sidebar h1 span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        padding: 2rem;
    }

    .nav-item span {
        display: none;
    }
}