:root {
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #16a34a;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --danger: #dc2626;
}

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

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.inline-flex {
    display: inline-flex;
} 

 

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    min-height: 91vh;
}

.layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.main-column {
    flex: 1 1 65%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.side-panel {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1.5rem;
}

header {
    margin-bottom: 1.5rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.brand-identity {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.brand-logo,
.login-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.brand-logo {
    border-radius: 12px;
    padding: 0.35rem;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

header h1 {
    margin: 0 0 0.3rem;
}

header p {
    margin: 0.2rem 0;
    color: var(--muted);
}

.status-messages {
    margin-top: 1rem;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.user-pill {
    background: #eef2ff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
    color: #312e81;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.alert ul {
    margin: 0;
    padding-left: 1.2rem;
}

.alert.success {
    background: #dcfce7;
    border-color: #15803d;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert.info {
    background: #dbeafe;
    border-color: var(--primary);
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-card {
    max-width: 480px;
    margin: 3rem auto 0;
}

.card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    margin-bottom: 2rem;
}

.card h2 {
    margin-top: 0;
}

.form-grid {
    display: grid;
    gap: 1rem 1.25rem;
}

.form-grid label,
.filters label {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    color: var(--muted);
    gap: 0.35rem;
}

.form-grid label input,
.form-grid label select,
.filters label input {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.form-row button {
    justify-self: flex-start;
}

.field-span-2 {
    grid-column: span 2;
}

.checkbox-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.checkbox-field input {
    width: auto;
}

.compact-grid {
    gap: 0.75rem;
}

.helper-text {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.full-width {
    width: 100%;
}

input,
select,
textarea,
button,
.ghost {
    font: inherit;
}

input,
select,
textarea {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.date-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

#membership-years {
    min-height: 150px;
    width: min(100%, 360px);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.chip {
    background: var(--accent);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

.inline-form {
    display: flex;
    align-items: center;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.small {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

button {
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    color: #fff;
    background: #1f2937;
    transition: background 0.2s, transform 0.2s;
}

button:hover {
    background: #111827;
}

.primary {
    background: var(--primary);
}

.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button.danger {
    background: var(--danger);
}

button.danger:hover {
    background: #b91c1c;
}

.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.filters.has-filter {
    border-left: 4px solid var(--primary);
    padding-left: calc(1rem - 4px);
    background: rgba(37, 99, 235, 0.05);
    border-radius: 12px;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-actions button {
    flex: 0 0 auto;
}

.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    background: transparent;
    transition: background 0.2s;
}

.ghost:hover {
    background: var(--bg);
}

.ghost.accent {
    border-color: var(--accent);
    color: var(--accent);
}

.ghost.accent:hover {
    background: rgba(22, 163, 74, 0.08);
}

.ghost.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.ghost.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.table-wrapper {
    overflow-x: auto;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-heading h2 {
    margin: 0;
}

.card-heading-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--muted);
}

.page-controls {
    display: flex;
    gap: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--muted);
}

tbody tr:hover {
    background: #f8fafc;
}

.hit {
    background: #fef3c7;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem;
}

.results-count {
    font-size: 0.95rem;
}

footer {
    padding: 45px 15px;
    background: #333333;
}

.copyrights, a:link {
    font-size: 0.75rem;
    text-align: center;
    color: #eeeeee;
}

.copyrights a {
    color: #eeeeee;
}

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

@media (max-width: 1100px) {
    .layout {
        flex-direction: column;
    }

    .side-panel {
        position: static;
        width: 100%;
    }
    
    .full-width {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .header-top {
        flex-direction: column;
    }

    .brand-identity {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-panel {
        width: 100%;
        justify-content: space-between;
    }

    .card {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: span 1;
    }
}

.grid-two {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.color-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.side-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    font-size: 0.9rem;
    transition: background 0.2s, border 0.2s;
}

.side-nav a:hover {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.05);
}

.side-card {
    padding: 1.25rem;
}

.settings-card h3 {
    margin-top: 1.2rem;
}

.settings-divider {
    border-top: 1px dashed var(--border);
    margin: 1rem 0;
}

.logo-preview {
    text-align: center;
    margin-bottom: 0.75rem;
}

.logo-preview img {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
}

.collapsible {
    padding: 0;
}

.collapsible summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.25rem;
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.collapsible summary::-webkit-details-marker {
    display: none;
}

.collapsible summary::after {
    content: '▾';
    transition: transform 0.2s ease;
    font-size: 0.9rem;
    color: var(--muted);
}

.collapsible[open] summary::after {
    transform: rotate(-180deg);
}

.collapsible .collapsible-content {
    padding: 0 1.25rem 1.25rem;
}
