/* ═══════════════════════════════════════════════
   SHS Schmid GmbH – Abstimmungssystem v2
   ═══════════════════════════════════════════════ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a4a 0%, #2d4a7a 50%, #1a3a5c 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2c3e50;
}

.container { max-width: 1400px; margin: 0 auto; }

/* ── HEADER ── */
header {
    background: white;
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}
header .logo { font-size: 2.2em; }
header h1 { color: #1a2a4a; font-size: 1.9em; font-weight: 700; }
.subtitle { color: #7f8c8d; font-size: 0.95em; margin-top: 3px; }

/* ── SECTION ── */
.section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── LOGIN TABS ── */
.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e8ecf0;
}
.tab-btn {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    font-size: 1.05em;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.25s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
}
.tab-btn.active { color: #2d4a7a; border-bottom-color: #2d4a7a; }
.tab-btn:hover { background: #f4f6f8; }

.login-form { max-width: 420px; margin: 0 auto; }
.login-form h2 { color: #1a2a4a; margin-bottom: 25px; text-align: center; font-size: 1.5em; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; color: #2c3e50; font-weight: 600; font-size: 0.92em; }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dde2e9;
    border-radius: 7px;
    font-size: 0.97em;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2d4a7a;
    box-shadow: 0 0 0 3px rgba(45,74,122,0.1);
    background: white;
}
.form-group textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ── BUTTONS ── */
.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 7px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary   { background: #2d4a7a; color: white; }
.btn-primary:hover { background: #1a3460; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,74,122,0.3); }
.btn-secondary { background: #95a5a6; color: white; }
.btn-secondary:hover { background: #7f8c8d; }
.btn-success   { background: #27ae60; color: white; }
.btn-success:hover { background: #1e9c52; }
.btn-danger    { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-warning   { background: #e67e22; color: white; }
.btn-warning:hover { background: #d35400; }
.btn-info      { background: #2980b9; color: white; }
.btn-info:hover { background: #2471a3; }
.btn-active    { background: #8e44ad; color: white; }
.btn-active:hover { background: #7d3c98; }
.btn-small     { padding: 7px 13px; font-size: 0.85em; }
.btn-xs        { padding: 4px 9px; font-size: 0.8em; }

/* ── HEADER BAR ── */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8ecf0;
    flex-wrap: wrap;
    gap: 10px;
}
.header-bar h2 { color: #1a2a4a; font-size: 1.5em; }

/* ── ADMIN TABS ── */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    background: #f4f6f8;
    padding: 8px;
    border-radius: 10px;
}
.admin-tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: #5d6d7e;
    font-size: 0.92em;
    white-space: nowrap;
}
.admin-tab-btn.active { background: #2d4a7a; color: white; box-shadow: 0 2px 8px rgba(45,74,122,0.3); }
.admin-tab-btn:hover:not(.active) { background: #e0e6ef; color: #1a2a4a; }

/* ── ADMIN CONTENT ── */
.admin-content { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.admin-content h3 { color: #1a2a4a; margin-bottom: 22px; font-size: 1.6em; }
.admin-content h4 { color: #34495e; margin-bottom: 14px; font-size: 1.15em; }

/* ── FORM CARD ── */
.form-card {
    background: #f7f9fc;
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 28px;
    border: 1.5px solid #e0e6ef;
}

/* ── IMPORT SECTION ── */
.import-section {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #dde2e9;
}
.help-text { color: #7f8c8d; font-size: 0.88em; margin-top: 8px; }

/* ── COMMUNITY/MEETING CARD GRID ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.community-card {
    background: white;
    border: 1.5px solid #e0e6ef;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.community-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.community-card h4 { color: #1a2a4a; font-size: 1.1em; margin-bottom: 8px; }
.community-card .code-badge {
    display: inline-block;
    background: #e8ecf7;
    color: #2d4a7a;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1em;
    letter-spacing: 2px;
    margin-bottom: 12px;
}
.community-card .meta { color: #7f8c8d; font-size: 0.85em; margin-bottom: 14px; }
.meeting-card {
    background: #f7f9fc;
    border: 1.5px solid #e0e6ef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}
.meeting-card:hover { border-color: #2d4a7a; }
.meeting-card.is-active {
    border-color: #27ae60;
    background: #f0faf4;
}
.meeting-card h5 { color: #1a2a4a; font-size: 1em; margin-bottom: 6px; }
.meeting-card .meeting-meta {
    font-size: 0.85em;
    color: #5d6d7e;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.meeting-card .meeting-meta span { display: flex; align-items: center; gap: 4px; }
.active-badge {
    display: inline-block;
    background: #27ae60;
    color: white;
    font-size: 0.78em;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}
.inactive-badge {
    display: inline-block;
    background: #95a5a6;
    color: white;
    font-size: 0.78em;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

/* ── BREADCRUMB / CONTEXT BAR ── */
.context-bar {
    background: #eef2f8;
    border: 1.5px solid #d0d8e8;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.92em;
    color: #34495e;
}
.context-bar strong { color: #1a2a4a; }
.context-bar .sep { color: #95a5a6; }
.context-bar .change-btn {
    margin-left: auto;
    background: none;
    border: 1px solid #95a5a6;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 0.85em;
    cursor: pointer;
    color: #5d6d7e;
    transition: all 0.2s;
}
.context-bar .change-btn:hover { border-color: #2d4a7a; color: #2d4a7a; }

/* ── TABLE ── */
.table-container { margin-top: 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border-radius: 8px; overflow: hidden; }
thead { background: #1a2a4a; color: white; }
th { padding: 13px 15px; text-align: left; font-weight: 600; font-size: 0.9em; white-space: nowrap; }
td { padding: 11px 15px; border-bottom: 1px solid #f0f3f7; font-size: 0.92em; }
tbody tr:hover { background: #f7f9fc; }
tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.status-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 700;
    white-space: nowrap;
}
.status-open    { background: #d4efdf; color: #1e8449; }
.status-closed  { background: #e8ecf0; color: #5d6d7e; }
.status-voting  { background: #fdebd0; color: #d35400; }
.status-active  { background: #d4efdf; color: #1e8449; }
.status-inactive{ background: #e8ecf0; color: #5d6d7e; }

/* ── ACTION BUTTONS ── */
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.action-buttons .btn { padding: 5px 11px; font-size: 0.82em; }

/* ── SORT BUTTONS ── */
.sort-buttons { display: flex; gap: 4px; }
.sort-buttons .btn { padding: 4px 8px; font-size: 0.88em; min-width: 28px; background: #e0e6ef; color: #2c3e50; }
.sort-buttons .btn:hover { background: #2d4a7a; color: white; }

/* ── PARTICIPANT / VOTING AREA ── */
.participant-auth {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: #f7f9fc;
    border-radius: 10px;
    border: 1.5px solid #e0e6ef;
}
.participant-auth h3 { text-align: center; color: #1a2a4a; margin-bottom: 22px; }

.meeting-info-box {
    background: #eef2f8;
    border: 1.5px solid #c5d3e8;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 22px;
}
.meeting-info-box h4 { color: #1a2a4a; margin-bottom: 8px; }
.meeting-info-box .info-row { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.9em; color: #5d6d7e; margin-top: 6px; }
.meeting-info-box .info-row span { display: flex; align-items: center; gap: 5px; }

.participant-info {
    background: #d4efdf;
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 18px;
    border-left: 4px solid #27ae60;
    font-size: 0.92em;
    color: #1e8449;
}

/* ── VOTING CARD ── */
.voting-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 18px;
    border: 2px solid #e0e6ef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: border-color 0.2s;
}
.voting-card:hover { border-color: #2d4a7a; }
.voting-card .agenda-number {
    display: inline-block;
    background: #2d4a7a;
    color: white;
    padding: 4px 14px;
    border-radius: 5px;
    margin-bottom: 12px;
    font-weight: bold;
    font-size: 0.9em;
}
.voting-card h4 { color: #1a2a4a; margin-bottom: 8px; font-size: 1.1em; }
.agenda-description { color: #5d6d7e; line-height: 1.6; margin-bottom: 12px; font-size: 0.93em; }
.agenda-proposal {
    background: #fff8e6;
    padding: 14px;
    border-radius: 7px;
    margin: 14px 0;
    border-left: 4px solid #e67e22;
    font-size: 0.9em;
    line-height: 1.6;
}
.vote-buttons { display: flex; gap: 12px; margin-top: 18px; }
.vote-buttons .btn { flex: 1; justify-content: center; font-size: 1em; padding: 13px; }
.vote-status {
    margin-top: 14px;
    padding: 11px;
    background: #d4efdf;
    border-radius: 7px;
    text-align: center;
    font-weight: 600;
    color: #1e8449;
    font-size: 0.92em;
}

/* ── RESULTS ── */
.result-item {
    background: white;
    padding: 22px;
    border-radius: 10px;
    margin-bottom: 18px;
    border-left: 4px solid #2d4a7a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.result-item h4 { color: #1a2a4a; margin-bottom: 6px; }
.result-proposal { font-size: 0.88em; color: #5d6d7e; margin-bottom: 14px; line-height: 1.5; }
.result-summary { display: flex; gap: 16px; margin-bottom: 14px; }
.result-stat { flex: 1; text-align: center; padding: 14px 10px; background: #f7f9fc; border-radius: 8px; border: 1.5px solid #e0e6ef; }
.result-stat .label { color: #7f8c8d; font-size: 0.82em; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.result-stat .value { font-size: 1.8em; font-weight: 800; color: #2c3e50; line-height: 1; }
.result-stat .sublabel { font-size: 0.78em; color: #95a5a6; margin-top: 4px; }
.result-stat.yes .value  { color: #1e8449; }
.result-stat.no .value   { color: #c0392b; }
.result-stat.abstain .value { color: #7f8c8d; }
.result-stat.yes  { border-color: #a9dfbf; }
.result-stat.no   { border-color: #f1948a; }
.total-shares {
    text-align: center;
    padding: 9px;
    background: #eaf7ef;
    border-radius: 6px;
    margin: 12px 0;
    font-weight: 700;
    color: #1e8449;
    font-size: 0.9em;
}
.result-details { margin-top: 14px; }
.result-details summary { cursor: pointer; color: #2d4a7a; font-weight: 600; font-size: 0.9em; padding: 8px 0; }
.result-details table { margin-top: 10px; }

/* ── MODAL ── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
}
.modal-content {
    background: white;
    margin: 4% auto;
    padding: 32px;
    border-radius: 12px;
    width: 92%;
    max-width: 620px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes slideDown { from { transform:translateY(-40px); opacity:0; } to { transform:translateY(0); opacity:1; } }
.modal-content h3 { color: #1a2a4a; margin-bottom: 22px; font-size: 1.3em; }
.close { color: #aaa; float: right; font-size: 26px; font-weight: bold; cursor: pointer; line-height: 1; }
.close:hover { color: #333; }

/* ── ALERTS / NOTICES ── */
.alert { padding: 13px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 0.92em; }
.alert-info    { background: #d6eaf8; border-left: 4px solid #2980b9; color: #1a5276; }
.alert-success { background: #d4efdf; border-left: 4px solid #27ae60; color: #1e8449; }
.alert-warning { background: #fdebd0; border-left: 4px solid #e67e22; color: #a04000; }
.alert-danger  { background: #fadbd8; border-left: 4px solid #e74c3c; color: #922b21; }

/* ── NO-MEETINGS EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 50px 30px;
    color: #95a5a6;
}
.empty-state .icon { font-size: 3em; margin-bottom: 16px; }
.empty-state p { font-size: 1.05em; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .cards-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    body { padding: 10px; }
    header { flex-direction: column; text-align: center; padding: 20px; }
    header h1 { font-size: 1.5em; }
    .section { padding: 20px 15px; }
    .admin-tabs { gap: 5px; }
    .admin-tab-btn { padding: 8px 12px; font-size: 0.85em; }
    .vote-buttons { flex-direction: column; }
    .result-summary { flex-direction: column; }
    .header-bar { flex-direction: column; align-items: flex-start; }
    .modal-content { margin: 2% auto; padding: 22px 18px; }
}
