:root {
    --bg-base: #09090b;
    --panel-bg: rgba(24, 24, 27, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #eab308; /* Premium Yellow */
    --accent-glow: rgba(234, 179, 8, 0.4);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
    --success: #10b981;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Dynamic Background Glows */
body::before, body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
}

body::before {
    top: -200px;
    left: -200px;
    background: rgba(234, 179, 8, 0.05); /* Yellow top left */
}

body::after {
    bottom: -200px;
    right: -200px;
    background: rgba(239, 68, 68, 0.05); /* Red bottom right */
}

.app-container {
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    background: rgba(9, 9, 11, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.header-content h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-content h1::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

.header-content .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 24px;
    gap: 24px;
}

/* Glass Panels */
.left-panel, .right-panel {
    flex: 1;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.search-container {
    padding: 20px 24px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.02);
}

.search-container input {
    width: 100%;
    padding: 14px 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.search-container input:focus {
    border-color: var(--accent-color);
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

.offense-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.section-header {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    padding: 16px 12px 8px 12px;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--panel-border) 0%, transparent 100%);
}

.offense-item {
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border: 1px solid transparent;
    gap: 16px;
    background: transparent;
    margin-bottom: 4px;
}

.offense-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.offense-item.selected {
    background: rgba(234, 179, 8, 0.05);
    border-color: rgba(234, 179, 8, 0.2);
}

/* Custom Checkbox */
.custom-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.custom-checkbox input {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: rgba(0,0,0,0.3);
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--accent-color);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Offense Details */
.offense-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.offense-title {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.offense-paragraph {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    background: rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

.offense-stats {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Badges */
.court-badge {
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid var(--danger-border);
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.court-badge::before {
    content: '⚖️';
    font-size: 10px;
}

/* Right Panel */
.right-panel {
    position: relative;
}

.warning-banner {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-bottom: 1px solid var(--danger-border);
    color: #fca5a5;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    animation: pulse-warn 2s infinite alternate;
}
.warning-banner::before {
    content: '⚠️';
    font-size: 16px;
}
@keyframes pulse-warn {
    from { background-color: rgba(239, 68, 68, 0.15); }
    to { background-color: rgba(239, 68, 68, 0.25); box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.2); }
}
.warning-banner.hidden {
    display: none;
}

.right-panel h2 {
    padding: 24px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.02);
}

.selected-list {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    margin-top: 60px;
    font-size: 15px;
    opacity: 0.5;
}

.selected-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.selected-item.most-severe {
    border: 1px solid rgba(234, 179, 8, 0.5);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08) 0%, rgba(0,0,0,0.4) 100%);
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.05);
}

.severe-badge {
    color: var(--accent-color);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: inline-block;
    background: rgba(234, 179, 8, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Calculator Section */
.calculator-section {
    padding: 24px;
    border-top: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.4);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 24px;
}

.discount-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.discount-wrapper label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-wrapper input[type="number"] {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--panel-border);
    color: var(--accent-color);
    padding: 10px 14px;
    border-radius: 8px;
    width: 90px;
    font-size: 16px;
    font-weight: 700;
    outline: none;
    transition: all 0.3s;
}
.discount-wrapper input[type="number"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Segmented Control (Radio Buttons) */
.segmented-control {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--panel-border);
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    text-align: center;
}

.segmented-control input[type="radio"]:checked + label {
    background: var(--text-main);
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Totals */
.totals-container {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-around;
}

.total-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.total-col .label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
}

.total-col .value {
    font-size: 28px;
    font-weight: 800;
}

.total-col .value.money { color: var(--success); }
.total-col .value.time { color: var(--danger); }

/* Buttons */
.action-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.6);
}

.action-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.action-btn:disabled {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast::before {
    content: '✓';
    background: rgba(0,0,0,0.2);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(40px);
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
