:root{
    /* Modern color palette */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-light: #475569;
    
    /* Accent colors */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Spacing & sizing */
    --nav-height: 56px;
    --sidebar-width: 256px;
    --radius: 12px;
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.1);
    --surface-border: rgba(148, 163, 184, 0.12);
    --surface-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
}
[data-theme="light"]{
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #71717a;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --surface-border: rgba(15, 23, 42, 0.08);
    --surface-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
/* Reset & Base Styles */
*{ 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
html{ 
    scroll-behavior: smooth; 
}
body{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.auth-body{
    overflow: hidden;
}
.noselect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none; 
    -ms-user-select: none;
    user-select: none; 
}
/* Typography */
h1, h2, h3, h4, h5, h6{
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}
h1{ font-size: 1.6rem; }
h2{ font-size: 1.25rem; }
h3{ font-size: 1.1rem; }
p{ 
    margin-bottom: 1rem; 
    color: var(--text-secondary); 
}
/* Header */
.app-header{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 2000;
}
.header-left,
.header-right{
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-brand{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}
.header-brand:hover{
    color: var(--text-primary);
}
.header-logo{
    width: 34px;
    height: auto;
}
.header-greeting{
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-avatar{
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
}
.menu-btn, 
.theme-toggle{
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.menu-btn{
    display: none;
}
.menu-btn:hover, 
.theme-toggle:hover{
    background-color: var(--bg-hover);
    border-color: var(--border);
}
.theme-toggle {
    padding: 4px 7px;
    font-size: 11px;
}
/* Sidebar */
.sidebar{
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--nav-height));
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px 8px;
    z-index: 1500;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}
.sidebar::-webkit-scrollbar{
    width: 6px;
}
.sidebar::-webkit-scrollbar-track{
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb{
    background: var(--border-light);
    border-radius: 3px;
}
/* Main Layout */
.main-wrapper{
    margin-top: var(--nav-height);
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    flex: 1;
    transition: margin-left 0.3s ease;
}
.main-content{
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-size: 13px;
}
/* Navigation */
.nav-link{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 14px;
    transition: all 0.2s;
}
.nav-link:hover{
    background-color: var(--bg-hover);
    color: var(--text-primary);
}
.submenu{
    list-style: none;
    padding-left: 16px;
    display: none;
    margin-bottom: 4px;
}
.submenu.show{ 
    display: block; 
}
.submenu a{
    display: block;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
}
.submenu a:hover{
    background-color: var(--bg-hover);
    color: var(--text-secondary);
}
/* Footer */
.app-footer{
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}
/* Forms */
.form-container{
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--surface-shadow);
}
.form-group{
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
label{
    font-weight: 500;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0.01em;
}
input, 
select, 
textarea{
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}
input:focus, 
select:focus, 
textarea:focus{
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.form-readonly input,
.form-readonly select,
.form-readonly textarea {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-color: var(--border);
    pointer-events: none;
}
select{
    appearance: auto;
}
textarea{
    resize: vertical;
    min-height: 84px;
}
.form-grid-3{
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 12px;
}
@media (max-width: 768px){
.form-grid-3{
        grid-template-columns: 1fr;
    }
}
.form-actions{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
/* Login Card */
.auth-shell{
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    background:
        radial-gradient(900px 420px at 20% -10%, rgba(59, 130, 246, 0.22), transparent 60%);
}
.login-card{
    width: min(420px, 100%);
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 6px 0;
    box-shadow: none;
}
.auth-shell h2{
    font-family: "Avenir Next", "Trebuchet MS", sans-serif;
    letter-spacing: 0.01em;
}
.auth-shell .form-group{
    margin-bottom: 14px;
}
.auth-shell input{
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 12px;
}
.auth-shell .btn{
    width: 100%;
    height: 40px;
}
.auth-shell .forgot-link{
    margin-top: 14px;
}
.auth-shell .message-success,
.auth-shell .message-error{
    margin-top: 14px;
}
@media (max-width: 600px){
    .auth-shell{
        padding: 22px 16px;
    }
}
.login-card h2{
    margin: 0 0 24px 0;
    font-size: 24px;
    font-weight: 700;
}
.forgot-link{
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}
.forgot-link:hover{
    color: var(--accent);
}
/* Buttons */
.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
    line-height: 1;
    height: 32px;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    color: white;
    background: var(--accent);
    transition: all 0.2s;
    outline: none;
}
.btn-compact,
.btn-file-action,
.file-input-group .btn {
    height: 32px;
    padding: 0 12px;
    line-height: 1;
    font-size: 12px;
    width: auto;
    white-space: nowrap;
}
.btn:hover{
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn:focus{
    box-shadow: var(--focus-ring);
}
.btn:disabled{
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn:disabled,
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}
.btn-secondary{
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover{
    background: var(--bg-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}
.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
}
.btn-error,
.btn-red {
    background: var(--error);
}
.btn-error:hover,
.btn-red:hover {
    background: #dc2626;
}
/* Pagination */
.pagination{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 24px 0;
}
.pagination a, 
.pagination span{
    text-decoration: none;
    color: var(--text-primary);
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 13px;
    cursor: pointer;
}
.pagination a:hover{
    background-color: var(--bg-hover);
}
.pagination .active{
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}
.pagination .disabled{
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}
.pagination-info{
    font-size: 14px;
    color: var(--text-muted);
    min-width: 150px;
    text-align: center;
}
/* Compact Pagination */
.pagination-compact{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.pagination-compact-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.2s;
}
.pagination-compact-btn:hover{
    background: var(--bg-hover);
    border-color: var(--border);
}
.pagination-compact-btn.is-disabled{
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-compact-info{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.pagination-compact-info label{
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.pagination-compact-info select{
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
}
/* Data view header layout */
.data-view-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.data-view-title{
    margin: 0;
}
.data-view-pagination{
    flex: 1 1 240px;
    display: flex;
    justify-content: center;
}
.data-view-pagination .pagination-compact{
    margin: 0;
}
.data-view-actions{
    display: flex;
    justify-content: flex-end;
}
@media (max-width: 900px){
    .data-view-header{
        align-items: flex-start;
    }
    .data-view-pagination{
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
    .data-view-actions{
        order: 2;
        width: 100%;
        justify-content: flex-start;
    }
}
/* Cards & Content Layouts */
.card-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}
.needs-grid{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.card{
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--surface-shadow);
}
.card h2{
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 12px;
}
.card-content{
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.card-item{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.card-item:last-child{
    border-bottom: none;
}
.card-item-label{
    color: var(--text-muted);
}
.card-item-value{
    font-weight: 500;
    text-align: right;
}
.btn-link-clean{
    text-decoration: none;
}
.stichtag-input{
    max-width: 180px;
    display: inline-block;
}
.stichtag-btn{
    margin-left: 8px;
}
/* Utilities */
.util-grid-span-full{ grid-column: 1 / -1; }
.util-flex-row{ display: flex; flex-direction: row; }
.util-flex-col{ display: flex; flex-direction: column; }
.util-flex-wrap{ flex-wrap: wrap; }
.util-flex-nowrap{ flex-wrap: nowrap; }
.util-flex-1{ flex: 1; }
.util-flex-grow{ flex-grow: 1; }
.util-flex-no-shrink{ flex-shrink: 0; }
.util-align-center{ align-items: center; }
.util-align-start{ align-items: flex-start; }
.util-align-end{ align-items: flex-end; }
.util-justify-end{ justify-content: flex-end; }
.util-gap-10{ gap: 10px; }
.util-gap-12{ gap: 12px; }
.util-gap-20{ gap: 20px; }
.util-m-0{ margin: 0; }
.util-mt-6{ margin-top: 6px; }
.util-mt-12{ margin-top: 12px; }
.util-mt-15{ margin-top: 15px; }
.util-mt-18{ margin-top: 18px; }
.util-mt-20{ margin-top: 20px; }
.util-mt-24{ margin-top: 24px; }
.util-mb-12{ margin-bottom: 12px; }
.util-mb-16{ margin-bottom: 16px; }
.util-mb-18{ margin-bottom: 18px; }
.util-mb-20{ margin-bottom: 20px; }
.util-ml-8{ margin-left: 8px; }
.util-ml-12{ margin-left: 12px; }
.util-text-muted{ color: var(--text-muted); }
.util-text-right{ text-align: right; }
.util-text-left{ text-align: left; }
.util-text-center{ text-align: center; }
.util-font-12{ font-size: 12px; }
.util-font-14{ font-size: 14px; }
.util-font-normal{ font-weight: normal; }
.util-text-no-transform{ text-transform: none; }
.util-cursor-pointer{ cursor: pointer; }
.util-font-600{ font-weight: 600; }
.util-input-full{ width: 100%; }
.util-inline{ display: inline; }
.util-inline-block{ display: inline-block; }
.util-block{ display: block; }
.util-w-100{ width: 100%; }
.util-w-160{ width: 160px; }
.util-max-w-70{ max-width: 70%; }
.event-attendee-row{ align-items: flex-end; }
.event-attendee-select{ flex: 1 1 260px; max-width: 360px; }
.table-actions{ display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.qr-box{ background: #fff; padding: 10px; display: inline-block; }
.code-inline{ background: #eee; padding: 5px; letter-spacing: 1px; }
.avatar-preview-small{ width: 100px; height: 100px; }
.heading-sm{ margin-bottom: 20px; font-size: 1.1rem; }
.section-title{ margin-bottom: 12px; }
/* .btn-compact ist jetzt Teil der Sammelregel oben */
.danger-zone{ margin-top: 24px; padding: 20px; background: rgba(239, 68, 68, 0.05); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 12px; }
.danger-zone-title{ margin-bottom: 12px; font-size: 1.1rem; color: #ef4444; }
.col-20{ width: 20%; }
.col-50{ width: 50%; }
.col-10{ width: 10%; }
/* Admin Menu */
.admin-shell{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.admin-panel{
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    box-shadow: var(--surface-shadow);
}
.admin-panel-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.admin-panel-title{
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.admin-panel-list{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-link{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: border-color 0.2s, background-color 0.2s;
    min-width: 0;
}
.admin-link:hover{
    border-color: var(--border-light);
    background: var(--bg-tertiary);
}
.admin-link-text{
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.admin-link-title{
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.admin-link-desc{
    font-size: 12px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}
.admin-link-arrow{
    flex: 0 0 auto;
    font-size: 14px;
    color: var(--text-muted);
}
@media (max-width: 768px){
    .admin-shell{
        grid-template-columns: 1fr;
    }
    .needs-grid{
        grid-template-columns: 1fr;
    }
}
/* Profile Sections */
.profile-card-item{
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.profile-card-item:last-child{
    border-bottom: none;
}
.profile-avatar-large{
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-info{
    display: flex;
    flex-direction: column;
}
.profile-name{
    font-size: 16px;
    font-weight: 600;
}
.profile-username{
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}
.avatar-preview-container{
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
}
.profile-avatar{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent);
}
.avatar-thumb{
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}
@media (max-width: 480px){
.avatar-preview-container{
        width: 150px;
        height: 150px;
    }
}
/* Tables */
.table-container{
    width: 100%;
    overflow-x: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: var(--surface-shadow);
}
.data-table, 
.kv-table{
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-primary);
}
.data-table th, 
.data-table td,
.kv-table th, 
.kv-table td{
    padding: 12px;
    border-bottom: 1px solid var(--surface-border);
}
.data-table thead tr{ 
    background: rgba(148, 163, 184, 0.08); 
}
.data-table th,
.kv-table th{
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
}
.data-table th a{
    text-decoration: none;
    color: inherit;
    display: block;
    transition: color 0.2s;
}
.data-table th a:hover{
    color: var(--accent);
}
.data-table th a.sorted{
    color: var(--accent);
    font-weight: 700;
}
.data-table td{ 
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.data-table td:last-child{ 
    text-align: right; 
}
.data-table th:last-child{
    text-align: right;
}
tbody tr:hover{
    background-color: var(--bg-hover);
    transition: background 0.2s ease;
}
/* Files Section */
.upload-dropzone{
    background: var(--bg-secondary);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, background-color 0.2s;
}
.upload-dropzone.is-dragover{
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
}
.dropzone-hint{
    color: var(--text-muted);
    font-size: 13px;
}
.dropzone-subhint{
    color: var(--text-muted);
    font-size: 12px;
}
.upload-input{
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.upload-picker{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.upload-picker:hover{
    background: var(--accent-hover);
}
.upload-actions{
    display: flex;
    justify-content: center;
}
.upload-file-list{
    color: var(--text-secondary);
    font-size: 12px;
    word-break: break-word;
}
.files-container{
    background-color: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--surface-shadow);
}
.files-container h3{
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}
.files-table{
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.files-table thead{
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}
.files-table th{
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}
.files-table th:last-child{
    text-align: right;
}
.files-table th a{
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.2s;
}
.files-table th a:hover{
    color: var(--accent);
}
.files-table td{
    padding: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.files-table tbody tr:hover{
    background-color: var(--bg-hover);
    transition: background-color 0.2s;
}

/* Bulk Actions */
.bulk-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.bulk-actions-info {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.bulk-actions-buttons {
    display: flex;
    gap: 8px;
}

.bulk-actions-buttons .btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Checkboxes */
.checkbox-col {
    width: 40px;
    text-align: center;
    padding: 12px 6px;
}

.checkbox-select,
.file-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.no-files-message{
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
    font-size: 14px;
}
/* Badges */
.badge{
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}
.badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}
.badge-pending, .badge-type-training {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.22);
}
.badge-weapon-long {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.22);
}
.badge-weapon-short {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.22);
}
.badge-type-match {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.22);
}
[data-theme="light"] .badge-active {
    background: #86efac;
    color: #166534;
}
[data-theme="light"] .badge-inactive {
    background: #fca5a5;
    color: #7f1d1d;
}
[data-theme="light"] .badge-pending,
[data-theme="light"] .badge-type-training {
    background: #fde68a;
    color: #92400e;
}
[data-theme="light"] .badge-weapon-long {
    background: #bfdbfe;
    color: #1e40af;
}
[data-theme="light"] .badge-weapon-short {
    background: #e9d5ff;
    color: #6b21a8;
}
[data-theme="light"] .badge-type-match {
    background: #bbf7d0;
    color: #166534;
}

/* Log Viewer */
.filter-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.logs-info {
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.log-type-badge {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.log-message-header {
    text-align: left;
}

.data-table td.log-message {
    max-width: 400px;
    word-break: break-word;
    white-space: normal;
    text-align: left !important;
}

.sort-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.2s;
}

.sort-link:hover {
    color: var(--accent);
}

/* Responsive Design */
@media (max-width: 900px){
    .menu-btn { 
        display: inline-flex; 
    }
    
    .sidebar {
        width: 100%;
        left: 0;
        transform: translateY(-100%);
        height: auto;
        max-height: 85vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
        z-index: 1500;
    }
    
    .sidebar.mobile-active { 
        transform: translateY(0); 
    }
    
    .main-wrapper { 
        margin-left: 0; 
    }
}
@media (max-width: 768px){
.main-content{
        padding: 16px;
    }
.card-grid{
        grid-template-columns: 1fr;
    }
.admin-tiles{
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
.form-grid-3{
        grid-template-columns: 1fr;
    }
.table-container{
        border: none;
        box-shadow: none;
    }
.files-table thead{
        display: none;
    }
.files-table tr{
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.02));
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: block;
    box-shadow: var(--surface-shadow);
    }
.files-table td{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: none;
    text-align: left;
    white-space: normal;
    }
.files-table td::before{
        content: attr(data-label);
    display: inline-block;
    min-width: 120px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    }
.files-table td:first-child{
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 10px;
    margin-bottom: 8px;
    color: var(--accent);
    font-weight: 600;
    }
.files-table td:first-child::before{
        display: none;
    }
.files-table th:first-child,
.files-table td.checkbox-col {
        padding: 6px;
}
.files-table td.checkbox-col::before {
        display: none !important;
}
.files-table td:last-child{
    padding-top: 10px;
    border-top: 1px solid var(--surface-border);
    text-align: right;
    justify-content: flex-end;
    }
.files-table td:last-child::before{
    display: none;
    }
.pagination{
        gap: 4px;
    }
.pagination a,
    .pagination span{
        padding: 6px 10px;
        font-size: 12px;
    }
.bulk-actions-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
.bulk-actions-buttons {
        width: 100%;
        flex-wrap: wrap;
    }
.bulk-actions-buttons .btn {
        flex: 1 1 calc(50% - 4px);
        padding: 10px 8px;
    }
.filter-row {
        flex-direction: column;
        align-items: stretch;
    }
.filter-group {
        min-width: unset;
    }
.data-table td.log-message {
        max-width: none;
    }
}
/* Print Styles */
@media print{
    .app-header,
    .sidebar,
    .menu-btn,
    .theme-toggle {
        display: none;
    }

    .main-wrapper {
        margin-left: 0;
        margin-top: 0;
    }

    .card,
    .table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
/* Event Management Styles */
.event-toolbar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.event-toolbar-title h1{
    margin: 0;
}
.event-toolbar-title p{
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 12px;
}
.event-toolbar-actions{
    display: flex;
    gap: 8px;
    align-items: center;
}
/* Success & Error Messages */
.message-success{
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.message-error{
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.event-filter-actions{
    display: flex;
    gap: 6px;
}
.event-filter-bar{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}
.event-filter-field{
    flex: 1 1 0;
    min-width: 180px;
}
.event-filter-actions{
    flex: 0 0 auto;
    white-space: nowrap;
}
@media (max-width: 768px){
    .event-filter-bar{
        flex-wrap: wrap;
    }
    .event-filter-field{
        flex: 1 1 100%;
        min-width: 0;
    }
}
.sr-only{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
/* Pagination Custom */
.pagination span.active{
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}
.pagination span.disabled{
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}
/* Event Details */
.event-details{
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.event-details-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12px;
    color: var(--text-muted);
}
.event-details-meta strong{
    color: var(--text-secondary);
    font-weight: 600;
}
.event-details-description{
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.event-details-actions{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.event-signup-form{
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 0;
}
.event-signup-form button{
    width: auto;
}
/* Event Table */
.event-table td{
    white-space: normal;
    vertical-align: top;
}
.event-table th,
.event-table td{
    border-bottom: none;
}
.event-table tbody tr{
    border-bottom: 1px solid var(--border);
}
.event-table th,
.event-table td{
    padding: 8px 10px;
}
.event-table-event{
    min-width: 260px;
}
.event-table-title{
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.event-table-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}
.event-table-category{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
}
.event-table-date,
.event-table-participants{
    white-space: nowrap;
}
.event-table-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.event-table-actions .event-signup-form{
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.event-guest-label{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.event-guest-input{
    width: 56px;
    padding: 6px 8px;
    font-size: 12px;
}
@media (max-width: 768px){
.event-toolbar{
        flex-direction: column;
        align-items: flex-start;
    }
.event-table thead{
        display: none;
    }
.event-table,
    .event-table tbody,
    .event-table tr,
    .event-table td{
        display: block;
        width: 100%;
    }
.event-table tr{
        background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.02));
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
        border: 1px solid var(--surface-border);
        border-radius: 14px;
        margin-bottom: 14px;
        padding: 14px 16px;
        box-shadow: var(--surface-shadow);
    }
.event-table td{
        border: none;
        padding: 8px 0;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        white-space: normal;
    }
.event-table-event{
        min-width: 0;
    }
.event-table td::before{
        content: attr(data-label);
        display: inline-block;
        min-width: 120px;
        font-size: 10px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
.event-table-actions{
        justify-content: flex-start;
    }
    .data-table thead{
        display: none;
    }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td{
        display: block;
        width: 100%;
    }
    .data-table tr{
        background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.02));
        border: 1px solid var(--surface-border);
        border-radius: 14px;
        margin-bottom: 14px;
        padding: 14px 16px;
        box-shadow: var(--surface-shadow);
    }
    .data-table td{
        border: none;
        padding: 8px 0;
        white-space: normal;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }
    .data-table td:last-child{
        text-align: right;
        justify-content: flex-end;
    }
    .data-table td:last-child::before{
        display: none;
    }
    .data-table td::before{
        content: attr(data-label);
        display: inline-block;
        min-width: 120px;
        font-size: 10px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
}
/* Button Sizes */
.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    height: 28px;
}
.btn-success{
    background: #10b981;
    color: white;
    border-color: #10b981;
}
.btn-success:hover{
    background: #059669;
    border-color: #059669;
}
/* Pagination Container */
.pagination-container{
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.pagination-btn{
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-block;
}
.pagination-btn:hover:not(.pagination-disabled):not(.pagination-active){
    background: var(--bg-primary);
    border-color: var(--accent);
    color: var(--accent);
}
.pagination-btn.pagination-active{
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    cursor: default;
}
.pagination-btn.pagination-disabled{
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--bg-primary);
}
/* No Events */
.no-events{
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.no-events-icon{
    font-size: 48px;
    margin-bottom: 12px;
}
.no-events-title{
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.no-events-text{
    color: var(--text-muted);
    margin-bottom: 16px;
}