* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --police-blue: #245d86;
    --police-blue-deep: #183b58;
    --police-blue-light: #eaf3fa;
    --text: #263747;
    --muted: #64748b;
    --line: #e2e8f0;
    --red: #b9383e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #10273d 0%, #34566f 48%, #172c41 100%) fixed;
    min-height: 100vh;
    color: #333;
}

.shell { min-height: 100vh; }
.header {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}
.back-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-2px); }
.header h1 { font-size: 1.8rem; font-weight: 300; }
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}
.main-content, .sidebar {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.search-section { margin-bottom: 2rem; }
.search-bar { position: relative; display: block; margin-bottom: 1rem; }
.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.search-input:focus {
    outline: none;
    border-color: var(--police-blue);
    box-shadow: 0 0 0 3px rgba(36, 93, 134, 0.12);
}
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #64748b; }
.category-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}
.tab-btn.active { background: var(--police-blue); color: white; }
.tab-btn:hover { transform: translateY(-2px); }
.violations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.violation-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}
.violation-card:hover { border-color: var(--police-blue); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.violation-card.selected { border-color: var(--police-blue); background: #f3f8fc; }
.violation-title { font-weight: 600; color: #1e293b; margin-bottom: 0.5rem; }
.violation-amount { color: var(--police-blue); font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.violation-details { font-size: 0.9rem; color: #64748b; }
.jail-badge, .confiscation-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}
.jail-badge { background: #fee2e2; color: #dc2626; }
.confiscation-badge { background: #e8f0f6; color: #315d7d; }
.note-badge { display: block; margin-top: 0.45rem; color: #64748b; font-size: 0.8rem; }
.variant-selector { margin-top: 1rem; display: none; }
.variant-selector.show { display: block; }
.variant-select { width: 100%; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; background: white; }
.sidebar { height: fit-content; position: sticky; top: 2rem; }
.sidebar h2 { color: #1e293b; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.selected-violations { margin-bottom: 2rem; max-height: 52vh; overflow-y: auto; }
.selected-item {
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
}
.selected-item-info { flex: 1; min-width: 0; }
.selected-item-title { font-weight: 600; color: #1e293b; font-size: 0.9rem; }
.selected-item-amount { color: var(--police-blue); font-weight: 700; }
.selected-item-note { margin-top: 0.25rem; color: #64748b; font-size: 0.78rem; }
.remove-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.remove-btn:hover { background: #fecaca; transform: scale(1.1); }
.total-section { border-top: 2px solid #e2e8f0; padding-top: 1.5rem; }
.total-amount { font-size: 2rem; font-weight: bold; color: #1e293b; margin-bottom: 0.5rem; }
.jail-status { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; padding: 0.75rem; border-radius: 8px; font-weight: 500; }
.jail-status.no-jail { background: #e8f1f7; color: #315d7d; }
.jail-status.has-jail { background: #fee2e2; color: #dc2626; }
.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3); }
.clear-button { width: 100%; margin-top: 0.7rem; padding: 0.45rem; border: 0; background: transparent; color: #718096; cursor: pointer; font-size: 0.85rem; }
.clear-button:disabled { opacity: 0.45; cursor: default; }
.calculation-note { margin-top: 0.5rem; color: #64748b; font-size: 0.8rem; text-align: center; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #64748b; }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { margin-bottom: 0.4rem; }
.manual-form { margin-top: 1rem; border-top: 1px solid #e2e8f0; padding-top: 1.4rem; }
.manual-heading { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; color: var(--police-blue); }
.manual-heading > i { font-size: 1.3rem; }
.manual-heading h2 { color: #1e293b; font-size: 1rem; }
.manual-heading p { margin-top: 0.2rem; color: #64748b; font-size: 0.8rem; }
.manual-fields { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; align-items: end; gap: 0.7rem; }
.manual-fields label { display: grid; gap: 0.35rem; color: #64748b; font-size: 0.8rem; }
.manual-fields input { width: 100%; min-height: 40px; padding: 0.5rem 0.7rem; border: 1px solid #d1d5db; border-radius: 6px; }
.manual-add { min-height: 40px; border: 0; border-radius: 6px; background: var(--police-blue); color: white; padding: 0.5rem 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 0.6rem; }
.manual-add:hover { background: var(--police-blue-deep); }
.disclaimer { margin-top: 1rem; color: #718096; font-size: 0.75rem; }
.site-footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.85rem 2rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #d2dbe3;
    font-size: 0.75rem;
}
.site-footer nav { display: flex; gap: 1.2rem; }
.site-footer a { color: #e4edf4; text-decoration: underline; text-decoration-color: #93aabc; text-underline-offset: 3px; }
.site-footer a:hover { color: white; text-decoration-color: white; }
.legal-shell { display: flex; flex-direction: column; }
.legal-header { justify-content: space-between; gap: 1rem; }
.legal-header h1 { text-align: center; }
.legal-back { display: inline-flex; align-items: center; gap: 0.55rem; color: white; font-size: 0.85rem; }
.legal-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-content {
    width: min(900px, calc(100% - 2rem));
    margin: 2rem auto;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    border-radius: 12px;
    background: white;
    color: #334155;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.legal-content h2 { margin: 1.7rem 0 0.65rem; color: #1e293b; font-size: 1.2rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { margin: 1.25rem 0 0.45rem; color: #293d4e; font-size: 1rem; }
.legal-content h4 { margin: 1rem 0 0.35rem; color: #394e60; font-size: 0.92rem; }
.legal-content p, .legal-content address { margin: 0 0 0.8rem; font-size: 0.9rem; line-height: 1.7; }
.legal-content address { font-style: normal; }
.legal-content ul { margin: 0.6rem 0 1rem; padding-left: 1.4rem; }
.legal-content li { margin: 0.45rem 0; padding-left: 0.2rem; font-size: 0.88rem; line-height: 1.65; }
.legal-content a { color: var(--police-blue); text-decoration: underline; text-underline-offset: 2px; }
.legal-content a:hover { color: var(--police-blue-deep); }
.legal-content .legal-uppercase { text-transform: uppercase; font-size: 0.77rem; line-height: 1.75; }
.legal-content .legal-source { margin-top: 1.5rem; color: #718096; font-size: 0.8rem; }
.legal-shell .site-footer { width: 100%; margin-top: auto; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 18, 29, 0.82); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.rights-dialog { width: min(100%, 590px); max-height: min(90vh, 850px); overflow-y: auto; border: 1px solid #45627a; border-radius: 8px; background: #172b3d; padding: 26px 29px 23px; color: #f3f6f8; box-shadow: 0 22px 90px #0008; animation: modal-in 0.22s ease-out both; }
.modal-kicker { display: flex; align-items: center; gap: 9px; color: #9ecbed; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.shield-icon { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #9ecbed; font-size: 15px; }
.rights-dialog h2 { margin: 14px 0 6px; color: white; font-size: 1.5rem; }
.rights-intro { margin: 0 0 15px; color: #d0dce5; font-size: 0.85rem; line-height: 1.55; }
.rights-list { border-top: 1px solid #ffffff24; }
.rights-list details { border-bottom: 1px solid #ffffff24; }
.rights-list summary { position: relative; padding: 10px 24px 10px 0; cursor: pointer; font-size: 0.8rem; font-weight: 700; list-style: none; }
.rights-list summary::-webkit-details-marker { display: none; }
.rights-list summary::after { content: "+"; position: absolute; right: 3px; color: #a4d0ef; font-size: 15px; }
.rights-list details[open] summary::after { content: "−"; }
.rights-list details p { margin: -1px 18px 11px 0; color: #bdcbd6; font-size: 0.75rem; line-height: 1.55; }
.rights-list details p strong { color: white; }
.confirm-check { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 13px; color: #d0dce5; font-size: 0.75rem; cursor: pointer; }
.confirm-check input { flex: 0 0 auto; accent-color: #81b8df; width: 15px; height: 15px; margin: 0; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; border: 0; border-radius: 5px; padding: 0 14px; background: #a9d3f0; color: #10283b; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.primary-button:disabled { background: #536b7d; color: #b0bbc4; cursor: not-allowed; }
.modal-note { margin: 12px 0 0; color: #9babb8; font-size: 0.7rem; }
body.modal-open { overflow: hidden; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1024px) {
    .container { grid-template-columns: 1fr; gap: 1rem; }
    .violations-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .selected-violations { max-height: none; }
}
@media (max-width: 600px) {
    .header { padding: 0.8rem 1rem; }
    .header h1 { font-size: 1.2rem; }
    .back-btn { padding: 0.65rem 0.75rem; font-size: 0.75rem; }
    .container { margin: 1rem auto; padding: 0 0.75rem; }
    .main-content, .sidebar { padding: 1rem; border-radius: 10px; }
    .tab-btn { padding: 0.65rem 0.85rem; font-size: 0.8rem; }
    .manual-fields { grid-template-columns: minmax(0, 1fr) 105px; }
    .manual-add { grid-column: 1 / -1; justify-content: space-between; }
    .site-footer { align-items: flex-start; flex-direction: column; gap: 0.55rem; padding: 0.9rem 1rem 1.2rem; }
    .site-footer nav { gap: 1rem; }
    .legal-header { padding: 0.8rem 0.85rem; }
    .legal-header h1 { font-size: 1rem; }
    .legal-back { font-size: 0.7rem; }
    .legal-content { width: calc(100% - 1.5rem); margin: 1rem auto; padding: 1.15rem; border-radius: 9px; }
    .legal-content p, .legal-content address { font-size: 0.84rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
