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

:root {
    --primary: #1a3a5c;
    --accent:  #2e6da4;
    --light:   #f4f6f9;
    --border:  #dce1e8;
    --text:    #222;
    --muted:   #666;
    --success: #2e7d32;
    --warning: #e65100;
    --danger:  #c62828;
}

body { font-family: system-ui, sans-serif; color: var(--text); background: #fff; line-height: 1.6; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { background: var(--primary); color: #fff; padding: .75rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.site-brand a { text-decoration: none; color: #fff; }
.site-title { font-size: 1.25rem; font-weight: 700; display: block; }
.site-subtitle { font-size: .8rem; opacity: .8; }
.site-nav a { color: #fff; text-decoration: none; margin-left: 1.25rem; font-size: .95rem; }
.site-nav a:hover { text-decoration: underline; }
.nav-admin { background: var(--accent); padding: .2rem .6rem; border-radius: 4px; }

.notice-unofficial { background: #fff3cd; border-bottom: 1px solid #ffc107; padding: .4rem 1rem; font-size: .85rem; text-align: center; color: #856404; }

main.container { padding-top: 2rem; padding-bottom: 3rem; }

/* Footer */
.site-footer { background: var(--light); border-top: 1px solid var(--border); padding: 1.5rem 0; text-align: center; color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--accent); }

/* Headings */
h1 { font-size: 1.8rem; color: var(--primary); margin-bottom: 1.5rem; }
h2 { font-size: 1.3rem; color: var(--primary); margin-bottom: 1rem; }

/* Badges */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .78rem; font-weight: 600; color: #fff; }
.badge-ordinara { background: var(--accent); }
.badge-extraordinara { background: var(--warning); }

/* Status badges */
.status-pending        { color: var(--muted); }
.status-published      { color: var(--success); font-weight: 600; }
.status-failed         { color: var(--danger); }
.status-processing     { color: var(--accent); }

/* Cards grid */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; background: #fff; }
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.card a { text-decoration: none; color: inherit; display: block; }
.card-photo { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; display: block; margin: 0 auto .75rem; background: var(--light); }
.card-name { font-weight: 700; text-align: center; }
.card-party { text-align: center; margin-top: .25rem; }

/* Sessions list */
.sessions-list { display: flex; flex-direction: column; gap: 1rem; }
.session-item { border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
.session-meta { color: var(--muted); font-size: .88rem; margin-top: .25rem; }
.session-item h3 a { color: var(--primary); text-decoration: none; }
.session-item h3 a:hover { text-decoration: underline; }

/* Search */
.search-form { display: flex; gap: .5rem; margin-bottom: 2rem; }
.search-form input { flex: 1; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; }
.search-form button { padding: .5rem 1.25rem; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.search-result { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.search-result mark { background: #fff3cd; padding: 0 2px; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .35rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem;
}
.form-group textarea { min-height: 200px; font-family: monospace; font-size: .9rem; }
.btn { display: inline-block; padding: .5rem 1.25rem; border-radius: 6px; font-size: 1rem; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-sm { padding: .25rem .75rem; font-size: .85rem; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.admin-table th, .admin-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--light); font-weight: 600; }
.admin-table tr:hover td { background: var(--light); }

/* Transcript */
.transcript-text { white-space: pre-wrap; font-family: Georgia, serif; line-height: 1.8; font-size: 1rem; }
.transcript-text mark { background: #fff176; }

/* Stats bar */
.stats-bar { display: flex; gap: 2rem; margin-bottom: 2rem; }
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label  { font-size: .85rem; color: var(--muted); }

@media (max-width: 600px) {
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .stats-bar { gap: 1rem; }
    .stat-number { font-size: 1.5rem; }
}
