:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --warning: #d97706;
    --border: #dbe4f0;
    --shadow: 0 18px 45px rgba(37, 99, 235, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container: 1180px;
}

/* Dark Theme */
html.dark-mode {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-soft: #334155;
    --text: #f1f5f9;
    --muted: #cbd5e1;
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #475569;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    transition: background 0.3s ease, color 0.3s ease;
}

html.dark-mode body {
    background: linear-gradient(180deg, #0f172a 0%, #1a1f35 100%);
}

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

a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 2000;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(219, 228, 240, 0.9);
    transition: background 0.3s ease, border-color 0.3s ease;
}

html.dark-mode .site-header {
    background: rgba(30, 41, 59, 0.88);
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
}

.header-inner {
    min-height: 78px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.navigation {
    min-width: 0;
}

.navigation ul,
.header-actions {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin: 0;
}

.navigation ul {
    flex-wrap: wrap;
}

.header-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.navigation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--text);
    font-weight: 600;
    transition: 0.2s ease;
}

.navigation a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.nav-pill {
    background: var(--primary);
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
    height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.nav-pill:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.24);
    transform: translateY(-2px);
}

.nav-pill--ghost {
    background: transparent;
    color: var(--primary) !important;
    box-shadow: none;
    border: 2px solid var(--primary);
    padding: 0 18px;
}

.nav-pill--ghost:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

html.dark-mode .nav-pill--ghost {
    background: transparent;
    border: 2px solid rgba(59, 130, 246, 0.6);
    color: #93c5fd !important;
}

html.dark-mode .nav-pill--ghost:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #60a5fa;
}

.nav-pill--admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.24);
    padding: 0 20px;
}

.nav-pill--admin:hover {
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.32);
    transform: translateY(-2px);
}

.site-main {
    flex: 1;
    padding: 32px 0 72px;
}

.hero-section,
.page-section {
    padding: 28px 0;
}

.section-soft {
    padding-top: 0;
}

.hero-grid,
.form-layout,
.detail-layout,
.about-layout,
.profile-layout {
    display: grid;
    gap: 24px;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    align-items: stretch;
}

.hero-copy,
.content-card,
.info-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 32px;
    background: linear-gradient(135deg, #eaf2ff 0%, #ffffff 62%);
}

html.dark-mode .hero-copy {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d3e52 62%);
}

.hero-copy h1,
.content-card h1,
.content-card h2,
.section-header h1,
.section-header h2,
.empty-state h3,
.info-card h3 {
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.hero-copy h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

html.dark-mode .hero-copy h1,
html.dark-mode .hero-copy p {
    color: #f1f5f9;
}

.hero-copy p,
.section-lead,
.muted-text,
.info-card p,
.detail-description p,
.empty-state p,
.feature-list li {
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.hero-actions,
.section-actions,
.card-actions,
.form-actions,
.delete-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.section-actions {
    gap: 8px;
}

.hero-actions {
    margin-top: 28px;
}

.hero-panel,
.content-card,
.info-card,
.empty-state {
    padding: 32px;
}

.feature-list {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.feature-list li {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 28px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e8f0ff;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cards-grid,
.home-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.info-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 100%;
}

.card-content {
    display: grid;
    gap: 12px;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #eef2f7;
    color: var(--text);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-warning {
    background: #b91c1c;
    color: #fff;
}

.btn-warning:hover {
    background: #b91c1c;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-block {
    width: 100%;
}

.styled-form,
.delete-form {
    display: grid;
    gap: 20px;
}

.styled-form p {
    margin: 0;
}

.styled-form input,
.styled-form textarea,
.styled-form select,
.form-card input,
.form-card textarea,
.form-card select {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fbfdff;
    font-size: 1rem;
    color: var(--text);
}

.styled-form input[type="text"],
.form-card input[type="text"] {
    appearance: none;
}

.styled-form input[type="date"],
.form-card input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.styled-form textarea,
.form-card textarea {
    min-height: 140px;
    resize: vertical;
}

.styled-form input:focus,
.styled-form textarea:focus,
.styled-form select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.45);
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
    color: var(--text);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary);
}

html.dark-mode .btn-secondary {
    background: #334155;
    color: var(--text);
}

html.dark-mode .btn-secondary:hover {
    background: #475569;
}

html.dark-mode .btn-warning {
    background: #ca8a04;
    color: #fff;
}

html.dark-mode .btn-warning:hover {
    background: #a16207;
}

html.dark-mode .styled-form input,
html.dark-mode .styled-form textarea,
html.dark-mode .styled-form select,
html.dark-mode .form-card input,
html.dark-mode .form-card textarea,
html.dark-mode .form-card select {
    background: #334155;
    border-color: #475569;
}

html.dark-mode .section-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.alert-info,
.messages-stack {
    display: grid;
    gap: 16px;
}

.global-messages {
    position: fixed;
    top: calc(78px + 16px);
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 600px);
    display: grid;
    gap: 12px;
    padding: 0 16px;
    z-index: 1100;
    pointer-events: none;
}

.flash-message {
    pointer-events: auto;
    animation: flashIn 0.25s ease-out;
}

.flash-message--hide {
    animation: flashOut 0.35s ease-in forwards;
}

@keyframes flashIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes flashOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
    opacity: 1;
}

.alert-success {
    background: #0f5132;
    color: #f8fafc;
    border-color: #166534;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

html.dark-mode .alert-success {
    background: rgba(22, 101, 52, 0.18);
    color: #d8f3dc;
    border-color: rgba(34, 197, 94, 0.3);
}

html.dark-mode .alert-danger,
html.dark-mode .alert-error {
    background: rgba(220, 38, 38, 0.18);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.3);
}

html.dark-mode .alert-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fef9c3;
    border-color: rgba(250, 204, 21, 0.3);
}

html.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.3);
}

.empty-state {
    text-align: center;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    transition: background 0.3s ease;
}

html.dark-mode .site-footer {
    background: rgba(30, 41, 59, 0.88);
}

.footer-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.footer-inner p {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

@media (max-width: 1100px) {
    .header-inner {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .navigation ul,
    .header-actions {
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-main {
        padding-top: 24px;
    }

    .hero-copy,
    .content-card,
    .info-card,
    .empty-state {
        padding: 24px;
    }

    .navigation ul,
    .header-actions {
        gap: 8px;
    }

    .navigation a,
    .header-actions a {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.95rem;
    }
}
