:root {
    --bg: #f8f9fa;
    --white: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-small: #9ca3af;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 32px;
}

.nav-brand {
    font-size: 1.2rem;
    color: var(--text);
    text-decoration: none;
}

.nav-brand strong { font-weight: 800; }

.nav-links {
    display: flex;
    gap: 4px;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Nav user dropdown */
.nav-user-dropdown {
    position: relative;
    margin-left: auto;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background 0.15s;
    font-family: inherit;
    font-size: 0.85rem;
}

.nav-user-btn:hover { background: var(--bg); }

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.nav-username {
    color: var(--text);
    font-weight: 500;
}

.nav-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.nav-user-dropdown.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 180px;
    z-index: 200;
    padding: 4px 0;
}

.nav-user-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.nav-dropdown-item:hover { background: var(--bg); }

.nav-dropdown-logout { color: var(--text-muted); }
.nav-dropdown-logout:hover { background: #fef2f2; color: var(--danger); }

.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.login-brand {
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-brand strong { font-weight: 800; }

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* Landing page */
.landing {
    font-family: var(--font);
    color: var(--text);
}

/* ── Landing page ── */
.landing-hero {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 40%, #2563eb 100%);
    color: white;
    padding: 96px 24px 72px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, rgba(59,130,246,0.15) 0%, transparent 50%),
                radial-gradient(circle at 30% 70%, rgba(37,99,235,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.landing-hero-inner {
    max-width: 660px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.landing-brand {
    font-size: 2.8rem;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.landing-brand strong { font-weight: 800; }

.landing-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.landing-desc {
    font-size: 1.05rem;
    opacity: 0.85;
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.btn-google-landing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 36px;
    border: none;
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.btn-google-landing:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}

.landing-trust {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.landing-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    opacity: 0.65;
    letter-spacing: 0.01em;
}

.landing-trust-item + .landing-trust-item::before {
    content: '\00b7';
    margin-right: 3px;
    font-size: 1.1rem;
    opacity: 0.5;
}

/* Sources */
.landing-sources {
    padding: 64px 24px;
    background: var(--white);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.landing-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.landing-section-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.landing-sources-pills {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.landing-pill {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    transition: all 0.15s ease;
}

.landing-pill:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

/* Features */
.landing-features {
    padding: 80px 24px;
    background: var(--bg);
    text-align: center;
}

.landing-features .landing-section-title {
    margin-bottom: 48px;
}

.landing-features-grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.landing-feature {
    text-align: left;
    padding: 32px 28px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    transition: all 0.2s ease;
}

.landing-feature:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 32px rgba(37,99,235,0.08);
    transform: translateY(-2px);
}

.landing-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.landing-feature h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.landing-feature p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Steps timeline */
.landing-steps {
    padding: 80px 24px;
    background: var(--white);
    text-align: center;
}

.landing-steps .landing-section-title {
    margin-bottom: 48px;
}

.landing-steps-timeline {
    max-width: 540px;
    margin: 0 auto;
    text-align: left;
}

.landing-step {
    display: flex;
    gap: 20px;
}

.landing-step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.landing-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.landing-step-line {
    width: 2px;
    flex: 1;
    background: #bfdbfe;
    margin: 4px 0;
}

.landing-step-content {
    padding-bottom: 32px;
    padding-top: 6px;
}

.landing-step:last-child .landing-step-content {
    padding-bottom: 0;
}

.landing-step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.landing-step-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* FAQ */
.landing-faq {
    padding: 80px 24px;
    background: var(--bg);
    text-align: center;
}

.landing-faq .landing-section-title {
    margin-bottom: 40px;
}

.landing-faq-list {
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
}

.landing-faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    margin-bottom: 12px;
    transition: border-color 0.15s ease;
}

.landing-faq-item:hover {
    border-color: #bfdbfe;
}

.landing-faq-item[open] {
    border-color: #93c5fd;
}

.landing-faq-item summary {
    padding: 18px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-faq-item summary::-webkit-details-marker {
    display: none;
}

.landing-faq-item summary::after {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
}

.landing-faq-item[open] summary::after {
    transform: rotate(180deg);
}

.landing-faq-item p {
    padding: 0 24px 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* CTA */
.landing-cta {
    padding: 80px 24px;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    text-align: center;
}

.landing-cta-inner {
    max-width: 540px;
    margin: 0 auto;
}

.landing-cta h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.landing-cta-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 32px;
}

.btn-google-dark {
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.btn-google-dark:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

.landing-cta-note {
    margin-top: 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
}

/* Footer */
.landing-footer {
    padding: 32px 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-small);
    border-top: 1px solid var(--border);
    background: var(--white);
}

@media (max-width: 600px) {
    .landing-hero { padding: 64px 20px 56px; }
    .landing-brand { font-size: 2.2rem; }
    .landing-title { font-size: 1.4rem; }
    .landing-desc { font-size: 0.98rem; }
    .landing-trust { gap: 16px; }
    .landing-trust-item { font-size: 0.78rem; }
    .landing-sources { padding: 48px 20px; }
    .landing-features { padding: 56px 20px; }
    .landing-features-grid { grid-template-columns: 1fr; gap: 16px; }
    .landing-section-title { font-size: 1.25rem; }
    .landing-steps { padding: 56px 20px; }
    .landing-steps-timeline { max-width: 100%; }
    .landing-faq { padding: 56px 20px; }
    .landing-cta { padding: 56px 20px; }
    .landing-cta h2 { font-size: 1.3rem; }
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.login-footer {
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-small);
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.page-header .page-title { margin-bottom: 0; }

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

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

.alert-warning a { color: var(--primary); }
.alert-warning code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px; font-size: 0.8rem; }

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.check-error-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: #991b1b;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table-fixed { table-layout: fixed; }
.data-table-fixed .col-date { width: 90px; }
.data-table-fixed .col-acta { width: 150px; }
.data-table-fixed .col-lugar { width: 20%; }
.data-table-fixed .col-desc { width: auto; }
.data-table-fixed .col-vto { width: 90px; }
.data-table-fixed .col-monto { width: 105px; }

.data-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.data-table tbody tr:hover { background: #f9fafb; }

.table-wrapper { overflow-x: auto; }

.text-right { text-align: right; }
.text-nowrap { white-space: nowrap; }

/* Table toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-select {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text);
    background: var(--white);
    margin-bottom: 12px;
    transition: border-color 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Paid infraction styling */
tr.infraction-paid { opacity: 0.5; }
tr.infraction-paid td { text-decoration: line-through; color: var(--text-muted); }
tr.infraction-paid td .badge { text-decoration: none; }
tr.infraction-paid td .badge-label { text-decoration: none; }
tr.infraction-paid td a { text-decoration: line-through; }
.infraction-card.infraction-paid { opacity: 0.5; }
.infraction-card.infraction-paid .infraction-card-amount { text-decoration: line-through; }
.infraction-card.infraction-paid .infraction-card-desc { text-decoration: line-through; }

/* Table footnote */
.table-footnote {
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-small);
    border-top: 1px solid var(--border);
    margin: 0;
}

/* Source badges */
.badge-source-caba { background: #dbeafe; color: #1e40af; font-size: 0.7rem; }
.badge-source-pba { background: #fef3c7; color: #92400e; font-size: 0.7rem; }

/* Mobile infraction cards */
.infraction-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--white);
    overflow: hidden;
}

.infraction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.infraction-card-header > div { display: flex; align-items: center; gap: 8px; }

.infraction-card-amount {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.infraction-card-body { padding: 10px 12px; }

.infraction-card-desc {
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.4;
}

.infraction-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Desktop/mobile visibility */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* Links */
.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link-primary:hover { text-decoration: underline; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-status { background: var(--success-bg); color: var(--success); }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-neutral { background: #f3f4f6; color: var(--text-muted); }
.badge-label { color: var(--text-muted); font-weight: 400; }
.status-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.badge-type { background: #dbeafe; color: var(--primary); border: 1px solid #bfdbfe; }
.badge-type-dni { background: #f3e8ff; color: #7c3aed; border: 1px solid #e9d5ff; }

/* Text Helpers */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.8rem; }
.text-success { color: var(--success); font-size: 0.85rem; }
.text-danger { color: var(--danger); font-size: 0.85rem; }

/* Empty State */
.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

.empty-state a { color: var(--primary); }

.empty-state-large {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-large p { margin-bottom: 16px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-weight: 500;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }

.btn-outline {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 4px 8px;
}
.btn-ghost:hover { color: var(--danger); }

.btn-icon { font-size: 1rem; line-height: 1; }
.btn-block { width: 100%; }

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

@media (max-width: 900px) { .patentes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .patentes-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .nav-container { gap: 12px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
    .nav-links { order: 3; width: 100%; justify-content: flex-start; height: auto; padding-bottom: 4px; }
    .nav-link { padding: 4px 12px; font-size: 0.8rem; border-bottom: none; }
    .nav-link.active { background: #eef2ff; border-radius: var(--radius); }
    .nav-user-btn { font-size: 0.8rem; gap: 6px; }
    .nav-user-btn .nav-username { display: none; }
    .container { padding: 16px 12px; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .page-title { font-size: 1.2rem; }
    .section-card { padding: 16px 12px; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .stat-card { padding: 14px; }
    .table-toolbar { flex-direction: column; align-items: flex-start; }
    .table-controls { width: 100%; }
    .stat-value { font-size: 1.2rem; }
    .modal { width: 95%; max-width: none; margin: 16px; }
    .btn-danger { font-size: 0.8rem; padding: 6px 14px; }
}

/* Patente Card */
.patente-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.patente-card-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.patente-domain {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.status-ok { background: var(--success-bg); color: var(--success); }
.status-warn { background: #fef2f2; color: var(--danger); }
.status-checking { background: #eff6ff; }
.status-pending { background: #eff6ff; color: var(--primary); font-size: 1.1rem; }
.status-checking .spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: #bfdbfe;
    border-top-color: var(--primary);
}

.checking-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    color: #1e40af;
    line-height: 1.5;
}
.checking-info-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
}
.checking-info-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.checking-info-text {
    color: #3b82f6;
    font-size: 0.8rem;
}

.patente-card-body {
    padding: 0 16px 16px;
    flex: 1;
    background: #f9fafb;
    margin: 0 8px;
    border-radius: 6px;
    padding: 12px;
}

.jurisdiction-status { margin-bottom: 4px; font-size: 0.85rem; }

.patente-card-footer {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 600; }

.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; }

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Loading animation for check buttons */
.btn-loading {
    position: relative;
    color: var(--primary) !important;
}
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    font-size: 0.875rem;
    line-height: 1.5;
    animation: toastIn 0.3s ease;
}

.toast a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.toast a:hover { text-decoration: underline; }

.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-error { border-left: 4px solid var(--danger); }

.toast-exit {
    animation: toastOut 0.4s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(16px); }
}

@media (max-width: 600px) {
    .toast-container { left: 16px; right: 16px; max-width: none; }
}

/* Detail Page */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.back-link {
    font-size: 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1;
    margin-top: 4px;
}

.back-link:hover { color: var(--text); }

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.detail-subtitle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.detail-header-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Card link (clickable cards in patentes grid) */
.patente-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.patente-card-link:hover .patente-domain {
    color: var(--primary);
}

.last-check-info {
    margin-top: 8px;
}

/* Card checking state */
.card-checking {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.checking-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* Subscribe form */
.subscribe-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

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

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

@media (max-width: 600px) {
    .detail-header { flex-direction: column; }
    .detail-header-right { align-self: flex-end; }
    .subscribe-form { flex-direction: column; }
    .subscribe-form .btn { width: 100%; }
    .nav-user-btn .nav-username { display: none; }
}

/* Profile / Account page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.section-card-danger {
    border-color: #fecaca;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

@media (max-width: 600px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-info { flex-direction: column; text-align: center; }
    .section-card-danger { margin-bottom: 80px; }
}
