:root {
    --bni-red: #c8102e;
    --bg: #f3f3f3;
    --card: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --border: #e5e5ea;
    --hover: #fafafa;
    --next: #fff5f7;
    --error-bg: #fff2f2;
    --error-border: #f1b8b8;
    --error-text: #8a1f1f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, 'SF Pro Text', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.bni { color: var(--bni-red) !important; }

.app {
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
}

header { margin-bottom: 32px; }

h1 {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0 0 6px;
}

.subtitle {
    color: var(--muted);
    font-size: 18px;
}

.search { margin: 28px 0; }

.search input {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--card);
    font-family: inherit;
}

.search input:focus {
    border-color: var(--bni-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .15);
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    transition: .2s ease;
}

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

.item.next {
    background: var(--next);
    border-left: 4px solid var(--bni-red);
}

.main { flex: 1; }

.relatore {
    font-size: 17px;
    font-weight: 600;
}

.next .relatore { color: var(--bni-red); }

.meta {
    margin-top: 4px;
    display: flex;
    gap: 18px;
    font-size: 14px;
    color: var(--muted);
    align-items: center;
    flex-wrap: wrap;
}

.date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    padding: 2px;
    display: inline-flex;
}

.calendar-btn:hover { color: var(--bni-red); }

.badge {
    margin-left: 10px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--bni-red);
    color: #fff;
    font-weight: 600;
}

.hr-fine {
    border: none;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.08);
    margin: 24px 0;
}

a {
    color: var(--bni-red);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

.footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo {
    width: 90px;
    height: auto;
    opacity: 0.75;
    transition: opacity .2s ease;
}

.footer-logo:hover { opacity: 1; }

.hidden { display: none !important; }

.btn-storico {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--bni-red);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all .18s ease;
    margin-bottom: 28px;
}

.btn-storico:hover,
.btn-storico.active {
    background: var(--bni-red);
    color: #fff;
    border-color: var(--bni-red);
}

.btn-storico:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .2);
}

.box-errore {
    margin: 20px 0 30px;
    padding: 14px 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    border-radius: 6px;
    line-height: 1.5;
}

.box-vuota {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
}
