/* Witch Dashboard — front-end. Scoped under .witch-fe to avoid theme collisions. */

.witch-fe {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 24px auto;
    font-family: inherit;
    color: #2d1a4a;
}

.witch-fe * { box-sizing: border-box; }

.witch-fe--gated {
    display: block;
    max-width: 480px;
    margin: 48px auto;
    text-align: center;
    padding: 32px;
    background: #f6efff;
    border-radius: 8px;
}

/* --- Left nav --- */
.witch-fe__nav {
    background: #2d1a4a;
    color: #efe6ff;
    border-radius: 8px;
    padding: 16px 0;
    align-self: start;
    position: sticky;
    top: 24px;
}
.witch-fe__brand {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 0 18px 16px;
    color: #b58dd1;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.witch-fe__nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px;
    color: #efe6ff;
    text-decoration: none;
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}
.witch-fe__nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.witch-fe__nav-item.is-active {
    background: rgba(181,141,209,.15);
    border-left-color: #b58dd1;
    color: #fff;
    font-weight: 600;
}
.witch-fe__nav-item--muted {
    margin-top: 16px;
    font-size: 13px;
    opacity: .6;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 14px;
}
.witch-fe__nav-icon {
    display: inline-block;
    width: 18px; text-align: center;
    color: #b58dd1;
    font-size: 14px;
}

/* --- Main content --- */
.witch-fe__main {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    box-shadow: 0 2px 10px rgba(45,26,74,.06);
    min-height: 500px;
}
.witch-fe__title {
    margin: 0 0 6px;
    font-size: 28px;
    color: #2d1a4a;
}
.witch-fe__count { color: #888; font-weight: 400; font-size: 0.7em; }
.witch-fe__lede  { color: #666; margin: 0 0 24px; }
.witch-fe__h2    { margin: 28px 0 12px; font-size: 18px; color: #6d4b8a; }
.witch-fe__empty { color: #888; font-style: italic; padding: 12px 0; }

.witch-fe-link { color: #6d4b8a; }
.witch-fe-link:hover { color: #b58dd1; }

/* --- Cards --- */
.witch-fe-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.witch-fe-card {
    background: #faf7fd;
    border: 1px solid #e0d6eb;
    border-left: 4px solid #6d4b8a;
    border-radius: 6px;
    padding: 14px 16px;
}
.witch-fe-card--primary {
    background: linear-gradient(135deg, #2d1a4a 0%, #6d4b8a 100%);
    border: none;
    color: #fff;
}
.witch-fe-card--primary .witch-fe-card__label { color: rgba(255,255,255,.7); }
.witch-fe-card--primary .witch-fe-card__value { color: #fff; }
.witch-fe-card--primary .witch-fe-card__sub   { color: rgba(255,255,255,.7); }
.witch-fe-card__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #666;
}
.witch-fe-card__value {
    font-size: 30px;
    font-weight: 600;
    margin: 6px 0 2px;
    color: #2d1a4a;
}
.witch-fe-card__sub { font-size: 12px; color: #777; }

/* --- Controls bar (pills + search + filter) --- */
.witch-fe-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0 20px;
}
.witch-fe-search,
.witch-fe-status-filter {
    padding: 7px 12px;
    border: 1px solid #e0d6eb;
    border-radius: 4px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: #2d1a4a;
}
.witch-fe-search { flex: 1 1 220px; min-width: 180px; }
.witch-fe-search:focus,
.witch-fe-status-filter:focus { outline: none; border-color: #b58dd1; box-shadow: 0 0 0 3px rgba(181,141,209,.15); }

/* --- Spell name + inline description --- */
.witch-fe-spell__name {
    display: inline-block;
    font-weight: 600;
    color: #2d1a4a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.witch-fe-spell__name:hover { color: #6d4b8a; border-bottom-color: #b58dd1; }
.witch-fe-spell__desc {
    margin-top: 6px;
    font-weight: normal;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    max-width: 560px;
    max-height: 4.5em;
    overflow: hidden;
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* --- Sort indicators --- */
.witch-fe-sortable thead th[data-sort] { cursor: pointer; user-select: none; position: relative; padding-right: 22px; }
.witch-fe-sortable thead th[data-sort]::after { content: "↕"; position: absolute; right: 8px; opacity: .3; font-size: 10px; }
.witch-fe-sortable thead th.sort-asc::after  { content: "▲"; opacity: 1; color: #b58dd1; }
.witch-fe-sortable thead th.sort-desc::after { content: "▼"; opacity: 1; color: #b58dd1; }

/* --- Job detail view --- */
.witch-fe-jobdetail__head {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 10px;
}
.witch-fe-jobdetail__head .witch-fe__title { margin: 0; }
.witch-fe-jobdetail__meta {
    background: #faf7fd;
    border: 1px solid #e0d6eb;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 14px 0 20px;
    font-size: 14px;
    line-height: 1.8;
    color: #3d2a5a;
}
.witch-fe-jobdetail__meta strong { color: #6d4b8a; margin-right: 6px; }
.witch-fe-jobdetail__actions {
    display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
    padding: 14px 18px;
    background: #2d1a4a;
    color: #efe6ff;
    border-radius: 6px;
    margin-bottom: 24px;
}
.witch-fe-jobdetail__check,
.witch-fe-jobdetail__sched {
    display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.witch-fe-jobdetail__check input[type=checkbox] { transform: scale(1.4); }
.witch-fe-jobdetail__sched input[type=date] { padding: 4px 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; border-radius: 3px; }
.witch-fe-notes__row--large { margin: 10px 0 14px; padding: 14px 18px; }
.witch-fe-notes__row--large .witch-fe-notes__value { max-width: none; font-size: 14px; line-height: 1.7; }

/* --- Pills (filter tabs) --- */
.witch-fe-pills { margin: 8px 0 20px; display: flex; gap: 6px; }
.witch-fe-pill {
    padding: 6px 14px;
    border: 1px solid #e0d6eb;
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
    color: #6d4b8a;
    font-size: 13px;
}
.witch-fe-pill.is-active {
    background: #6d4b8a;
    color: #fff;
    border-color: #6d4b8a;
}

/* --- Tables --- */
.witch-fe-table-wrap { overflow-x: auto; }
.witch-fe-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.witch-fe-table th,
.witch-fe-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee7f3;
}
.witch-fe-table th {
    background: #faf7fd;
    color: #6d4b8a;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.witch-fe-table tr:hover td { background: #fafafc; }
.witch-fe-jobs tr.is-done { opacity: .5; }
.witch-fe-jobs tr.is-done .witch-fe-spell { text-decoration: line-through; }
.witch-fe-jobs .witch-fe-spell { font-weight: 600; color: #2d1a4a; }

.witch-fe-toggle { transform: scale(1.3); cursor: pointer; }
.witch-fe-schedule {
    border: 1px solid #e0d6eb;
    border-radius: 4px;
    padding: 4px 6px;
    font: inherit;
    font-size: 13px;
}

.witch-fe-note {
    background: #111;
    border: 1px solid #2a2a2a;
    border-left: 4px solid #ffd700;
    border-radius: 6px;
    padding: 20px 24px;
    margin-top: 28px;
    color: #e8e4d8;
    line-height: 1.7;
}
.witch-fe-note strong { color: #ffd700; font-size: 15px; letter-spacing: .02em; }
.witch-fe-note p { margin: 12px 0 0; font-size: 14px; }
.witch-fe-note em { color: #ffd700; font-style: italic; }

.witch-fe-notes {
    margin-top: 6px;
    font-weight: normal;
}
.witch-fe-notes > summary {
    cursor: pointer;
    color: #6d4b8a;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    list-style: none;
    user-select: none;
}
.witch-fe-notes > summary::before { content: "▸ "; }
.witch-fe-notes[open] > summary::before { content: "▾ "; }
.witch-fe-notes > summary::-webkit-details-marker { display: none; }
.witch-fe-notes > summary:hover { color: #b58dd1; }
.witch-fe-notes__row {
    background: #faf7fd;
    border-left: 3px solid #b58dd1;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 3px;
}
.witch-fe-notes__label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6d4b8a;
    margin-bottom: 3px;
}
.witch-fe-notes__value {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    max-width: 600px;
}

.witch-fe-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
}
.witch-fe-status--processing { background: #b58dd1; }
.witch-fe-status--on-hold    { background: #d19a3b; }
.witch-fe-status--pending    { background: #888; }
.witch-fe-status--completed  { background: #5a8a5a; }
.witch-fe-status--failed     { background: #b04444; }
.witch-fe-status--cancelled  { background: #555; }

/* --- Calendar --- */
#witch-fe-calendar {
    margin-top: 12px;
    font-size: 13px;
}
#witch-fe-calendar .fc {
    background: #fff;
}

/* --- Toast --- */
.witch-fe-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: #2d1a4a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(45,26,74,.3);
    z-index: 10000;
    font-size: 14px;
}
.witch-fe-toast--success { background: #5a8a5a; }
.witch-fe-toast--error   { background: #b04444; }

/* --- Responsive --- */
@media (max-width: 782px) {
    .witch-fe {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }
    .witch-fe__nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
    }
    .witch-fe__brand { width: 100%; border-bottom: none; padding: 4px 10px 10px; }
    .witch-fe__nav-item {
        flex: 1 1 auto;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px;
        font-size: 13px;
        justify-content: center;
    }
    .witch-fe__nav-item.is-active { border-left: none; border-bottom-color: #b58dd1; }
    .witch-fe__nav-item--muted { display: none; }
    .witch-fe__main { padding: 18px; }
}
