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

:root {
    --sidebar-width: 240px;
    --header-height: 56px;
    --color-bg: #f2f7f4;
    --color-sidebar-bg: #1a3d2b;
    --color-sidebar-text: #a8cbb8;
    --color-sidebar-hover: #254f38;
    --color-sidebar-active: #368C5A;
    --color-header-bg: #ffffff;
    --color-border: #d4e6dc;
    --color-text: #1a202c;
    --color-text-muted: #5a7a68;
    --color-accent: #368C5A;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}

/* Layout */

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar__brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
}

.sidebar__nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar__nav-label {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
}

.sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--color-sidebar-text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar__nav a:hover {
    background: var(--color-sidebar-hover);
    color: #ffffff;
}

.sidebar__nav a.active {
    background: var(--color-sidebar-active);
    color: #ffffff;
}

.sidebar__footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: var(--color-sidebar-text);
    font-size: 13px;
}

.sidebar__footer .user-email {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__footer a {
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 13px;
}

.sidebar__footer a:hover {
    color: #ffffff;
}

.logout-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-sidebar-text);
    font-size: 13px;
    font-family: inherit;
}

.logout-btn:hover {
    color: #ffffff;
}

/* Main */

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */

.header {
    height: var(--header-height);
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

/* Content */

.content {
    padding: 28px;
    flex: 1;
}

/* Messages */

.messages {
    list-style: none;
    margin-bottom: 20px;
}

.messages li {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}

.messages .success { background: #d1fae5; color: #065f46; }
.messages .error   { background: #fee2e2; color: #991b1b; }
.messages .warning { background: #fef3c7; color: #92400e; }
.messages .info    { background: #dbeafe; color: #1e40af; }

.index-messages {
    width: 100%;
    max-width: 600px;
    margin-bottom: 24px;
}

/* Index page */

.index-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 28px;
    background: var(--color-bg);
}

.index-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 48px;
    text-align: center;
}

.index-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
}

.index-user {
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    gap: 12px;
}

.index-user a {
    color: var(--color-accent);
    text-decoration: none;
}

.index-user a:hover {
    text-decoration: underline;
}

.index-logout-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-accent);
    font-size: 13px;
    font-family: inherit;
}

.index-logout-btn:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.index-registers {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 800px;
}

.register-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 36px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 500;
    min-width: 240px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.register-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(54,140,90,0.12);
}

.register-card__name {
    text-align: center;
}

/* Forms */

.form-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 32px;
    max-width: 952px;
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-field--wide {
    flex: 2;
}

.form-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form-field input {
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-field textarea {
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    resize: vertical;
}

.form-field textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(54,140,90,0.12);
}

.form-field input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(54,140,90,0.12);
}

.form-static {
    font-size: 14px;
    color: var(--color-text);
    padding: 10px 0;
    display: block;
}

.form-error {
    font-size: 12px;
    color: #991b1b;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.form-cancel {
    font-size: 14px;
    color: var(--color-text-muted);
    text-decoration: none;
}

.form-cancel:hover {
    color: var(--color-text);
}

.form-hint-link {
    font-size: 12px;
    color: var(--color-accent);
    text-decoration: none;
}

.form-hint-link:hover {
    text-decoration: underline;
}

/* Tables */

.list-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: var(--color-bg);
}

.coi-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.coi-badge--approved {
    background: #d1fae5;
    color: #065f46;
}

.agenda-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.agenda-badge--ok {
    background: #d1fae5;
    color: #065f46;
}

.agenda-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.agenda-badge--alert {
    background: #fee2e2;
    color: #991b1b;
}

.coi-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.coi-badge--alert {
    background: #fee2e2;
    color: #991b1b;
}

.table-action {
    font-size: 13px;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
}

.table-action:hover {
    text-decoration: underline;
}

.table-empty {
    color: var(--color-text-muted);
    text-align: center;
    padding: 32px !important;
}

/* Participants formset */

.participants-section {
    margin-top: 32px;
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
}

.participant-form {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--color-bg);
}

.participant-delete {
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.participants-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
}


.btn-add-row {
    margin-top: 12px;
    margin-bottom: 16px;
    padding: 7px 16px;
    font-size: 13px;
    font-family: inherit;
    color: var(--color-accent);
    background: #fff;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-add-row:hover {
    background: #f0faf4;
}

/* KOZ actions */

.koz-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.koz-actions > div {
    display: flex;
    gap: 16px;
}

.koz-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: #ffffff;
    background: var(--color-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.koz-btn:hover {
    background: #2d7a4e;
    box-shadow: 0 4px 10px rgba(54,140,90,0.25);
}

.koz-btn--approve {
    background: var(--color-accent);
}

.koz-btn--reject {
    background: #991b1b;
}

.koz-btn--reject:hover {
    background: #7f1d1d;
    box-shadow: 0 4px 10px rgba(153,27,27,0.25);
}

/* Changelog */

.changelog-section {
    margin-top: 32px;
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
    max-width: 952px;
}

.changelog-entry {
    margin-bottom: 20px;
}

.changelog-entry__meta {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.changelog-changes {
    border-collapse: collapse;
    font-size: 13px;
}

.changelog-changes td {
    padding: 2px 10px 2px 0;
    vertical-align: top;
}

.changelog-field {
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.changelog-old {
    color: #991b1b;
    text-decoration: line-through;
}

.changelog-arrow {
    color: var(--color-text-muted);
    padding: 2px 8px !important;
}

.changelog-new {
    color: #065f46;
}

.changelog-subject {
    font-weight: 400;
    color: var(--color-text);
}

.changelog-empty {
    font-size: 13px;
    color: var(--color-text-muted);
}
