/* Events — uses Byteline theme variables so every theme and dark mode works */
.ev-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-1);
    padding: 22px 24px;
    margin-bottom: 22px;
}
.ev-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.ev-panel-title {
    font-family: var(--font-editorial);
    font-weight: 800;
    font-size: 20px;
    color: var(--heading);
}
.ev-note {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-soft);
    background: var(--surface-alt);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* Upcoming cards */
.ev-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.ev-card {
    --h: var(--brand-fg);
    border-radius: 14px;
    padding: 18px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--h) 22%, var(--surface)),
        color-mix(in srgb, var(--h) 8%, var(--surface))
    );
    border: 1px solid color-mix(in srgb, var(--h) 25%, var(--line));
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
    animation: fadeInUp var(--dur-med) var(--ease) both;
}
.ev-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
}
.ev-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.ev-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--h);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 19px;
}
.ev-chip {
    background: var(--surface);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink);
}
.ev-card-title {
    font-family: var(--font-editorial);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.25;
    color: var(--ink);
    margin: 16px 0 6px;
}
.ev-card-sub {
    font-size: 13px;
    color: var(--ink-soft);
}
.ev-card-sub b {
    color: var(--ink);
}
.ev-prog {
    display: flex;
    justify-content: space-between;
    margin: 16px 0 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
}
.ev-bar {
    height: 6px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    overflow: hidden;
}
.ev-bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--h);
    transition: width var(--dur-slow) var(--ease);
}
.ev-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}
.ev-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10.5px;
    box-shadow: 0 0 0 2px var(--surface);
}

/* Manage events */
.ev-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.ev-input,
.ev-select {
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
}
.ev-input:focus,
.ev-select:focus {
    border-color: var(--brand-fg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-fg) 18%, transparent);
}
.ev-select option {
    background: var(--surface);
    color: var(--ink);
}
.ev-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 8px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.ev-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 7px;
    background: none;
    color: var(--ink-soft);
    font-family: var(--font-head);
    font-size: 13.5px;
    letter-spacing: 0.02em;
    cursor: pointer;
}
.ev-tab i {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.ev-tab.is-active {
    background: var(--surface);
    color: var(--heading);
    box-shadow: var(--shadow-1);
}
.ev-scroll {
    overflow-x: auto;
}
.ev-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}
.ev-table th {
    text-align: left;
    padding: 12px 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--ink);
}
.ev-table td {
    padding: 14px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    vertical-align: middle;
}
.ev-table tbody tr {
    transition: background var(--dur-fast) var(--ease);
}
.ev-table tbody tr:hover {
    background: var(--surface-alt);
}
.ev-name {
    font-family: var(--font-editorial);
    font-weight: 700;
    font-size: 15.5px;
}
.ev-name small {
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 10.5px;
    color: var(--ink-soft);
    margin-top: 2px;
}
.ev-who {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}
.ev-type {
    --h: var(--brand-fg);
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.03em;
    background: color-mix(in srgb, var(--h) 16%, var(--surface));
    color: var(--ink);
    border-left: 3px solid var(--h);
}
.ev-pill {
    padding: 3px 11px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1.5px solid currentColor;
}
.ev-pill.is-Upcoming {
    color: var(--warn-fg);
}
.ev-pill.is-Planned {
    color: var(--brand-fg);
}
.ev-pill.is-Completed {
    color: var(--good-fg);
}
.ev-pill.is-Overdue {
    color: var(--accent-fg);
}
.ev-actions {
    white-space: nowrap;
    text-align: right;
}
.ev-actions .task-icon-btn {
    margin-left: 4px;
}
.ev-empty {
    padding: 36px 0 !important;
    text-align: center;
    color: var(--ink-soft);
}

@media (max-width: 880px) {
    .ev-panel {
        padding: 16px;
    }
    .ev-controls {
        width: 100%;
    }
    .ev-controls > * {
        flex: 1;
        min-width: 130px;
    }
}
@media print {
    .ev-controls,
    .ev-actions,
    .ev-tabs {
        display: none !important;
    }
}