:root{
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;

    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);

}

*{ box-sizing: border-box; }

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

a{ color: inherit; text-decoration: none; }

img{ max-width: 100%; display: block; }

button{ font-family: inherit; }

.sr-only{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


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

.sidebar{
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;

}

.sidebar-brand{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
}

.sidebar-brand-logo{
    width: min(200px, 100%);
    height: auto;
}


.sidebar-note{
    color: var(--muted);
    font-size: 13px;
}

.sidebar-card{
    background: var(--surface-alt);
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    color: var(--muted);
}


.sidebar-nav{
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav a{
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-nav a i{
    width: 18px;
}

.sidebar-nav a.active{
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-nav a:hover{
    background: var(--surface-alt);
    color: var(--text);
    transform: translateX(2px);
}


.sidebar-footer{
    margin-top: auto;
    font-size: 14px;
}

.sidebar-logout{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-logout i{
    color: var(--danger);
}

.sidebar-logout:hover{
    background: var(--surface-alt);
    color: var(--text);
}


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

.page-header{
    margin-bottom: 24px;
}

.page-header h1{
    margin: 0 0 6px;
    font-size: 28px;
}

.page-header p{
    margin: 0;
    color: var(--muted);
}

.breadcrumbs{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 10px;
}

.breadcrumbs a{
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover{
    color: var(--text);
}

.breadcrumbs-separator{
    color: var(--border-strong);
}

.breadcrumbs-current{
    color: var(--text);
    font-weight: 600;
}


.toolbar{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.toolbar-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.search{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.search-field{
    position: relative;
    display: flex;
    align-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.search-button{
    position: absolute;
    right: 8px;
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}

.search-button:hover{
    color: var(--text);
    background: var(--surface-alt);
}


.search-field input{
    border: none;
    outline: none;
    min-width: 220px;
    font-size: 14px;
    background: transparent;
    color: var(--text);
    padding: 10px 42px 10px 12px;
    width: 100%;
}

.btn, .btn-secondary, .btn-danger, .btn-icon{
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn{
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.btn:hover{
    background: var(--accent-strong);
    transform: translateY(-1px);

}

.btn-secondary{
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

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

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

.btn-icon{
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    background: var(--surface);
    color: var(--muted);
    border-color: var(--border);
}

.btn-icon:hover{
    color: var(--accent);
    border-color: var(--accent);
}

.btn-icon.btn-icon--danger:hover{
    color: var(--danger);
    border-color: var(--danger);
}


.table-wrap{
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);

}

table{
    width: 100%;
    border-collapse: collapse;
}

th, td{
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}

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

tr:last-child td{
    border-bottom: none;
}

.row-actions{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}


.status-pill{
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-alt);
    color: var(--muted);
}

.status-pill--published{
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.status-pill--draft{
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.card{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.dashboard{
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-section{
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-columns{
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.stats-column-title{
    margin: 0;
    font-size: 16px;
    color: var(--muted);
}

.stats-column .card-grid{
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}




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

.dashboard-card{
    padding: 18px;
    
}

.dashboard-card h3{
    margin: 0 0 12px;
    font-size: 16px;
}

.dashboard-chart{
    width: 100%;
    height: 140px;
    max-height: 140px;
}

.section-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 12px;
}

.section-header h2{
    margin: 0;
    font-size: 20px;
}

.form .field{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form input,
.form select,
.form textarea{
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);

}

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


.field-grid{
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(120px, 160px) 100px max-content;
    gap: 8px;
    align-items: center;
}

.field-grid .js-set-now{
    width: 100px;
    justify-content: center;
}


.time-dropdown{
    position: relative;
    justify-self: start;
    width: max-content;
}

.time-menu{
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 160px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.time-menu.is-open{
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-route-map .route-map-controls{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-route-map .route-map{
    width: 100%;
    height: 320px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-alt);
}

.field-route-map .route-map-input{
    display: none;
}

.form small{
    color: var(--muted);
}

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

.form a:hover{
    color: var(--accent-strong);
    text-decoration: none;
}

.form input[type="checkbox"][id$="-clear_id"],
.form label[for$="-clear_id"]{
    display: none;
}


.form .field:has(input[type="checkbox"]){
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form .field:has(input[type="checkbox"]) input[type="checkbox"]{
    margin: 0;
}




.field-error{
    color: var(--danger);
    font-size: 13px;
}

.actions{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.table-actions{
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px 16px;

}

.modal{
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}

.modal[hidden]{
    display: none;
}

.modal.is-open{
    display: flex;
}

.modal__content{
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 720px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.modal__header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal__header h3{
    margin: 0;

}

.modal__body{
    display: grid;
    gap: 12px;
}

.modal__body .field{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.modal__body .field span{
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.modal__body input,
.modal__body textarea{
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
}

.modal__body textarea{
    resize: vertical;
    min-height: 90px;
}

@media (max-width: 768px){
    .modal__content{
        max-height: 90vh;
        overflow-y: auto;
    }
}


.empty{
    color: var(--muted);
    padding: 24px;
    text-align: center;
    background: var(--surface);
    border-radius: 12px;
}

.event-header{
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.event-actions{
    display: flex;
    justify-content: flex-end;
}


.event-title{
    font-size: 22px;
    font-weight: 600;
}

.event-meta{
    color: var(--muted);
    font-size: 14px;
}

.tabs, .subtabs{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tabs a, .subtabs a{
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
}

.tabs a.active, .subtabs a.active{
    background: var(--accent);
    color: #fff;
}

.card-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.info-card{
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.info-card h3{
    margin: 0 0 12px;
}


.stand-plan-card{
    text-align: center;
    margin-bottom: 20px;
}

.stand-plan-card .card-body{
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stand-plan-image{
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}



.info-row{
    color: var(--muted);
    margin-bottom: 8px;
}

.auth-page{
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card{
    background: var(--surface);
    border-radius: 18px;
    padding: 32px;
    width: min(420px, 92%);
    box-shadow: var(--shadow);
}

.auth-logo{
    width: min(260px, 80%);
    margin: 0 auto 16px;
}

.auth-card h1{
    text-align: center;
}


.input-with-icon{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.input-with-icon:focus-within{
    outline: none !important;
    box-shadow: none !important;
}


.input-with-icon i{
    color: var(--muted);
}

.input-with-icon input{
    border: none;
    outline: none !important;
    padding: 11px 0;
    width: 100%;
    background: transparent;
    box-shadow: none !important;
}

.input-with-icon input:focus,
.input-with-icon input:focus-visible,
.input-with-icon input:active{
    outline: none !important;
    box-shadow: none !important;
}

.input-with-icon input:-webkit-autofill,
.input-with-icon input:-webkit-autofill:hover,
.input-with-icon input:-webkit-autofill:focus{
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: inherit;
    transition: background-color 9999s ease-out, color 9999s ease-out;

}

.alert{
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-radius: 10px;
    margin-bottom: 16px;
}

#href_rega {
    margin-bottom: 15px;
}

@media (max-width: 960px){
    .layout{
        flex-direction: column;
    }
    .sidebar{
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .sidebar-brand{
        flex: 1 1 100%;
        align-items: center;
        text-align: center;
    }
    .sidebar-brand-logo{
        width: min(240px, 70vw);
    }

    .sidebar-nav{
        flex-direction: row;
        flex-wrap: wrap;
    }
    .content{
        padding: 24px;
    }
    .event-header{
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px){
    .toolbar{
        flex-direction: column;
        align-items: stretch;
    }
    .search-field{
        width: 100%;
    }
    .search-field input{
        min-width: 0;
        width: 100%;
    }

    .row-actions{
        flex-direction: row;
    }
    .btn, .btn-secondary{
        width: 100%;
        justify-content: center;
    }
    .tabs a, .subtabs a{
        width: 100%;
        justify-content: center;

    }
}