/* ============================================
   TOP AUTOS — ADMIN EDITORIAL v2
   ============================================ */

body {
    background: var(--ink);
    overflow: hidden;
    cursor: auto;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
}

/* ============ SIDEBAR ============ */
.admin-side {
    background: var(--ink-soft);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.admin-side::-webkit-scrollbar { width: 3px; }
.admin-side::-webkit-scrollbar-thumb { background: var(--gold-deep); }

.side-brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.side-brand img { height: 48px; }
.side-brand .tag {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--gold);
}

.side-menu {
    flex: 1;
    padding: 1.5rem 0;
}
.side-chapter {
    padding: 1.5rem 1.5rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.side-chapter::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.side-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    color: var(--mist);
    font-family: var(--serif);
    font-size: 1.05rem;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    border-left: 2px solid transparent;
    position: relative;
}
.side-link i {
    color: var(--gold-deep);
    width: 18px;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.side-link:hover {
    background: rgba(201,169,97,0.04);
    color: var(--paper);
}
.side-link:hover i { color: var(--gold); }
.side-link.active {
    background: rgba(201,169,97,0.08);
    color: var(--paper);
    border-left-color: var(--gold);
}
.side-link.active i { color: var(--gold-bright); }
.side-link .badge {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    background: var(--gold);
    color: var(--ink);
}

.side-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.side-avatar {
    width: 42px; height: 42px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 1.2rem;
    color: var(--gold);
}
.side-user-info { flex: 1; }
.side-user-info strong {
    display: block;
    font-family: var(--serif);
    font-size: 1rem;
}
.side-user-info small {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold);
}

/* ============ MAIN ============ */
.admin-main-ed {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-top {
    padding: 1.5rem 3rem;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 2rem;
}
.top-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}
.top-search input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 0 0.8rem 2rem;
    color: var(--paper);
    font-family: var(--serif);
    font-size: 1.1rem;
    font-style: italic;
}
.top-search input::placeholder { color: var(--mist); }
.top-search input:focus { outline: none; border-bottom-color: var(--gold); }
.top-search i {
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
}
.top-actions {
    margin-left: auto;
    display: flex;
    gap: 1rem;
}
.top-btn {
    width: 42px; height: 42px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--gold);
    transition: all 0.3s var(--ease);
    position: relative;
    cursor: pointer;
}
.top-btn:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.top-btn .dot {
    position: absolute;
    top: 8px; right: 8px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.admin-content-ed {
    flex: 1;
    overflow-y: auto;
    padding: 3rem;
}
.admin-content-ed::-webkit-scrollbar { width: 6px; }
.admin-content-ed::-webkit-scrollbar-thumb { background: var(--gold-deep); }

.admin-tab-page { display: none; }
.admin-tab-page.active { display: block; animation: fadeUp 0.5s var(--ease); }

.admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}
.admin-page-head h1 {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1;
    font-weight: 300;
}
.admin-page-head .sub {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--mist);
    margin-top: 0.5rem;
}
.admin-page-head .eyebrow {
    margin-bottom: 1rem;
}

/* KPI EDITORIAL */
.kpi-grid-ed {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 4rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.kpi-cell {
    padding: 2.5rem;
    border-right: 1px solid var(--line);
    position: relative;
}
.kpi-cell:last-child { border-right: 0; }
.kpi-cell .index {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--gold-deep);
    letter-spacing: 0.3em;
}
.kpi-cell .lbl {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--gold);
    margin-bottom: 1rem;
}
.kpi-cell .val {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    line-height: 1;
    font-weight: 300;
    color: var(--paper);
    margin-bottom: 0.6rem;
}
.kpi-cell .val sub {
    font-size: 1rem;
    color: var(--mist);
    bottom: 0;
}
.kpi-cell .delta {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}
.kpi-cell .delta.up { color: #6ce5b3; }
.kpi-cell .delta.down { color: #ff8b7e; }

/* PANELS EDITORIAL */
.ed-panel {
    background: var(--ink-soft);
    border: 1px solid var(--line);
    margin-bottom: 2rem;
}
.ed-panel-head {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.ed-panel-head h3 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 300;
}
.ed-panel-head .actions { display: flex; gap: 0.6rem; }
.ed-panel-body { padding: 2rem; }
.ed-panel-body.flush { padding: 0; }

/* BUTTONS small */
.btn-ed-sm {
    padding: 0.5rem 1rem;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold);
    background: transparent;
    transition: all 0.3s var(--ease);
    cursor: pointer;
}
.btn-ed-sm:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn-ed-sm.solid { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn-ed-sm.solid:hover { background: transparent; color: var(--gold); }
.btn-ed-sm.bi-tab.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* TABLE editorial */
.ed-table {
    width: 100%;
    border-collapse: collapse;
}
.ed-table th {
    text-align: left;
    padding: 1.2rem 2rem;
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--gold);
    font-weight: 500;
    border-bottom: 1px solid var(--line);
    background: var(--ink);
    white-space: nowrap;
}
.ed-table td {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid rgba(201,169,97,0.08);
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--paper);
    vertical-align: middle;
}
.ed-table tr:hover td { background: rgba(201,169,97,0.03); }
.ed-table tr:last-child td { border-bottom: 0; }
.ed-table .cell-id {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--gold);
}
.ed-cell-veh {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.ed-cell-veh img {
    width: 56px; height: 40px;
    object-fit: cover;
}
.ed-cell-veh strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.ed-cell-veh small {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mist);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.9rem;
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border: 1px solid;
}
.status-pill.confirmed { color: #6ce5b3; border-color: rgba(108,229,179,0.4); }
.status-pill.pending { color: #f59e0b; border-color: rgba(245,158,11,0.4); }
.status-pill.in-progress { color: #93c5fd; border-color: rgba(147,197,253,0.4); }
.status-pill.completed { color: var(--mist); border-color: var(--line); }
.status-pill.available { color: #6ce5b3; border-color: rgba(108,229,179,0.4); }
.status-pill.rented { color: #f59e0b; border-color: rgba(245,158,11,0.4); }
.status-pill.maintenance { color: #ff8b7e; border-color: rgba(255,139,126,0.4); }
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.row-actions-ed {
    display: flex;
    gap: 0.3rem;
}
.row-actions-ed button {
    width: 30px; height: 30px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--gold);
    transition: all 0.2s var(--ease);
    font-size: 0.75rem;
    cursor: pointer;
}
.row-actions-ed button:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* CHARTS editorial */
.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.bar-chart-ed {
    height: 280px;
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
    padding: 1rem 0;
}
.bar-chart-ed .bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}
.bar-chart-ed .bar {
    width: 100%;
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-deep) 100%);
    border-top: 2px solid var(--gold);
    position: relative;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    min-height: 4px;
}
.bar-chart-ed .bar:hover { box-shadow: 0 -4px 20px rgba(201,169,97,0.4); }
.bar-chart-ed .bar::before {
    content: attr(data-value);
    position: absolute;
    top: -25px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}
.bar-chart-ed .bar:hover::before { opacity: 1; }
.bar-chart-ed .bar-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mist);
}

/* DONUT editorial */
.donut-ed {
    width: 200px; height: 200px;
    margin: 0 auto 1.5rem;
    position: relative;
}
.donut-ed svg { transform: rotate(-90deg); }
.donut-ed .center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.donut-ed .center .num {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--gold);
    line-height: 1;
}
.donut-ed .center .label {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--mist);
    margin-top: 0.3rem;
}
.donut-legend-ed { padding: 0 1rem; }
.donut-legend-ed .item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}
.donut-legend-ed .item:last-child { border-bottom: 0; }
.donut-legend-ed .sw { width: 14px; height: 14px; }
.donut-legend-ed .item span { flex: 1; color: var(--bone); }
.donut-legend-ed .item strong { font-family: var(--serif); color: var(--gold); }

/* PERMISSIONS */
.perm-card {
    padding: 2rem;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    margin-bottom: 1.5rem;
}
.perm-head {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.5rem;
}
.perm-head .avatar {
    width: 56px; height: 56px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    font-family: var(--serif);
    font-size: 1.3rem;
}
.perm-head strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 300;
}
.perm-head small {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--gold);
}
.perm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}
.perm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    font-family: var(--serif);
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
}

/* TOGGLES */
.toggle-ed {
    width: 50px; height: 26px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 50px;
    position: relative;
    transition: all 0.3s var(--ease);
    cursor: pointer;
}
.toggle-ed::after {
    content: '';
    position: absolute;
    top: 2px; left: 3px;
    width: 18px; height: 18px;
    background: var(--mist);
    border-radius: 50%;
    transition: all 0.3s var(--ease);
}
.toggle-ed.on { background: var(--gold); border-color: var(--gold); }
.toggle-ed.on::after { left: 27px; background: var(--ink); }

/* VAULT */
.vault-shell-ed {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    min-height: 600px;
}
.vault-tree-ed {
    border-right: 1px solid var(--line);
    padding: 1.5rem;
}
.vault-folder-ed {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.8rem;
    color: var(--mist);
    font-family: var(--serif);
    font-size: 1rem;
    transition: all 0.3s var(--ease);
    cursor: pointer;
}
.vault-folder-ed i { color: var(--gold); }
.vault-folder-ed:hover { background: rgba(201,169,97,0.04); color: var(--paper); }
.vault-folder-ed.active { background: rgba(201,169,97,0.08); color: var(--paper); }
.vault-folder-ed .count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--gold);
}

.vault-files-ed {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-content: start;
}
.file-card-ed {
    padding: 1.5rem;
    background: var(--ink);
    border: 1px solid var(--line);
    transition: all 0.3s var(--ease);
    cursor: pointer;
    position: relative;
}
.file-card-ed:hover { border-color: var(--gold); transform: translateY(-2px); }
.file-icon-ed {
    width: 48px; height: 60px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}
.file-icon-ed::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent var(--ink) transparent transparent;
}
.file-name-ed {
    font-family: var(--serif);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    word-break: break-all;
    line-height: 1.3;
}
.file-meta-ed {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mist);
}
.file-secure-ed {
    position: absolute;
    top: 1rem; right: 1rem;
    color: var(--gold);
    font-size: 0.7rem;
}

/* PLANNING EDITORIAL */
.planning-wrap {
    background: var(--ink-soft);
    border: 1px solid var(--line);
}
.planning-toolbar {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.planning-month {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--paper);
}
.planning-month em {
    font-style: italic;
    color: var(--gold);
    margin-left: 0.5rem;
}
.planning-actions { display: flex; gap: 0.5rem; }

.planning-legend {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--mist);
}
.planning-legend .leg {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.planning-legend .swatch {
    width: 14px; height: 14px;
}
.planning-legend .swatch.booked { background: var(--gold); }
.planning-legend .swatch.maint { background: rgba(239,68,68,0.3); border: 1px solid #ef4444; }
.planning-legend .swatch.weekend { background: rgba(212,175,55,0.06); border: 1px solid var(--line); }
.planning-legend .swatch.today { background: rgba(212,175,55,0.18); border: 1px solid var(--gold); }

.planning-frame {
    overflow-x: auto;
}
.planning-frame::-webkit-scrollbar { height: 6px; }
.planning-frame::-webkit-scrollbar-thumb { background: var(--gold-deep); }

.planning-grid {
    display: grid;
    min-width: 1100px;
    gap: 1px;
    background: var(--line);
}
.planning-cell {
    padding: 0.4rem;
    text-align: center;
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    background: var(--ink);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.planning-cell.header {
    color: var(--gold);
    background: var(--ink-soft);
    padding: 0.5rem 0.3rem;
    line-height: 1.1;
}
.planning-cell.header.label {
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    padding: 0.5rem 1rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
}
.planning-cell.header .d-num {
    font-size: 0.9rem;
    color: var(--paper);
    font-family: var(--serif);
    font-weight: 500;
}
.planning-cell.header .d-name {
    font-size: 0.55rem;
    color: var(--gold);
    margin-top: 0.1rem;
    letter-spacing: 0.1em;
}
.planning-cell.header.weekend .d-num { color: var(--mist); }
.planning-cell.header.weekend { background: rgba(212,175,55,0.04); }
.planning-cell.header.today { background: rgba(212,175,55,0.18); border-bottom: 1px solid var(--gold); }
.planning-cell.header.today .d-num { color: var(--gold-bright); }

.planning-cell.vehicle {
    color: var(--paper);
    font-family: var(--serif);
    font-size: 0.95rem;
    font-weight: 400;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    padding: 0.6rem 1rem;
    background: var(--ink-soft);
    border-right: 1px solid var(--line);
    gap: 0.7rem;
}
.planning-cell.vehicle img {
    width: 42px;
    height: 28px;
    object-fit: cover;
    border-radius: 2px;
}
.planning-cell.vehicle .v-info { flex: 1; min-width: 0; line-height: 1.2; }
.planning-cell.vehicle .v-info strong { display: block; font-size: 0.9rem; }
.planning-cell.vehicle .v-info small {
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mist);
}
.planning-cell.vehicle.placeholder {
    color: var(--mist);
    font-style: italic;
    border-right-style: dashed;
}
.planning-cell.vehicle.placeholder .ph-icon {
    width: 28px; height: 28px;
    border: 1px dashed var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 0.7rem;
}

.planning-cell.day { background: var(--ink); }
.planning-cell.day.weekend { background: rgba(212,175,55,0.04); }
.planning-cell.day.today { background: rgba(212,175,55,0.12); }
.planning-cell.day.placeholder {
    color: rgba(255,255,255,0.05);
}
.planning-cell.day.booked {
    background: var(--gold);
    color: var(--ink);
    font-weight: 600;
    font-family: var(--serif);
}
.planning-cell.day.booked.start::before { content: '●'; margin-right: 0.3rem; }
.planning-cell.day.maint {
    background: rgba(239,68,68,0.2);
    color: #ff8b7e;
    border-left: 2px solid #ef4444;
    border-right: 2px solid #ef4444;
}

.planning-empty-footer {
    padding: 2.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--line);
    background: var(--ink-soft);
}
.planning-empty-footer p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--mist);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

/* SETTINGS */
.settings-grid-ed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.toggle-row-ed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--line);
    gap: 1.5rem;
}
.toggle-row-ed:last-child { border-bottom: 0; }
.toggle-row-ed .info { flex: 1; }
.toggle-row-ed .info .lbl {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 0.2rem;
}
.toggle-row-ed .info .desc {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--mist);
}

/* ============ MODAL & DROPDOWNS ============ */
.modal-bd {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: modalFade 0.3s var(--ease);
}
.modal-bd.open { display: flex; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: var(--ink-soft);
    border: 1px solid var(--gold);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.4s var(--ease);
}
@keyframes modalSlide { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.modal-head h3 {
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 300;
}
.modal-head h3 em { font-style: italic; }
.modal-close-x {
    background: transparent;
    border: 1px solid var(--line);
    width: 36px; height: 36px;
    color: var(--gold);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}
.modal-close-x:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.modal-body-x { padding: 2rem; }
.modal-foot {
    padding: 1.2rem 2rem;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

/* DROPDOWN panel (notifications, messages) */
.dropdown-panel {
    position: absolute;
    top: 56px;
    right: 0;
    width: 380px;
    background: var(--ink-soft);
    border: 1px solid var(--gold);
    display: none;
    z-index: 1500;
    animation: dropFade 0.25s var(--ease);
}
.dropdown-panel.open { display: block; }
@keyframes dropFade { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-head {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dropdown-head h4 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 300;
}
.dropdown-head small {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--gold);
}
.dropdown-empty {
    padding: 3rem 2rem;
    text-align: center;
}
.dropdown-empty i {
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 1rem;
    display: block;
}
.dropdown-empty p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--mist);
    font-size: 1rem;
}

/* TEMPLATES EMAILS */
.tpl-card {
    background: var(--ink-soft);
    border: 1px solid var(--line);
    padding: 1.8rem 2rem;
    margin-bottom: 1rem;
    transition: all 0.3s var(--ease);
}
.tpl-card:hover { border-color: var(--gold); }
.tpl-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.8rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.tpl-card-head h4 {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 400;
}
.tpl-card-head h4 em { font-style: italic; color: var(--gold); }
.tpl-card .subject {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--gold);
    margin-bottom: 1rem;
}
.tpl-card .preview {
    font-family: var(--serif);
    font-style: italic;
    color: var(--bone);
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 80px;
    overflow: hidden;
    position: relative;
}
.tpl-card .preview::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 30px;
    background: linear-gradient(180deg, transparent, var(--ink-soft));
}

/* ACTIVITY LOG */
.act-row {
    display: grid;
    grid-template-columns: 40px 130px 180px 1fr 130px;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(201,169,97,0.05);
    font-family: var(--serif);
    font-size: 0.95rem;
}
.act-row:last-child { border-bottom: 0; }
.act-row:hover { background: rgba(201,169,97,0.03); }
.act-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 0.7rem;
}
.act-icon.login { border-color: #6ce5b3; color: #6ce5b3; }
.act-icon.logout { border-color: var(--mist); color: var(--mist); }
.act-icon.create { border-color: var(--gold); color: var(--gold); }
.act-icon.delete { border-color: #ef4444; color: #ef4444; }
.act-actor {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--paper);
    letter-spacing: 0.1em;
}
.act-action {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--gold);
}
.act-time {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--mist);
    text-align: right;
    letter-spacing: 0.15em;
}

@media (max-width: 992px) {
    .act-row { grid-template-columns: 40px 1fr 90px; }
    .act-actor, .act-time { display: none; }
}

/* MESSAGES INBOX */
.msg-row {
    display: grid;
    grid-template-columns: 50px 130px 1fr 130px auto;
    gap: 1.5rem;
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--line);
    transition: all 0.2s var(--ease);
    cursor: pointer;
    align-items: center;
}
.msg-row:hover { background: rgba(212,175,55,0.04); }
.msg-row.new { background: rgba(212,175,55,0.05); }
.msg-row.new:hover { background: rgba(212,175,55,0.08); }
.msg-row.delegated { opacity: 0.7; }
.msg-row.archived { opacity: 0.5; }

.msg-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    font-size: 1rem;
    flex-shrink: 0;
}
.msg-row.new .msg-avatar {
    background: var(--gold);
    color: var(--ink);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}

.msg-type {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    padding: 0.3rem 0.7rem;
    border: 1px solid;
    display: inline-block;
    white-space: nowrap;
}
.msg-type.reservation { color: #6ce5b3; border-color: rgba(108,229,179,0.4); }
.msg-type.partnership { color: var(--gold); border-color: rgba(212,175,55,0.4); }
.msg-type.newsletter { color: #93c5fd; border-color: rgba(147,197,253,0.4); }
.msg-type.contact { color: var(--mist); border-color: var(--line); }

.msg-content { min-width: 0; }
.msg-content strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    color: var(--paper);
}
.msg-content p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--mist);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-date {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mist);
    white-space: nowrap;
}
.msg-actions {
    display: flex;
    gap: 0.4rem;
}
.msg-actions button {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--gold);
    width: 32px; height: 32px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.msg-actions button:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.msg-actions button.danger:hover { background: #ef4444; color: var(--paper); border-color: #ef4444; }

.msg-empty {
    padding: 4rem 2rem;
    text-align: center;
}
.msg-empty i {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 1rem;
    display: block;
}
.msg-empty p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--mist);
    font-size: 1.1rem;
}

/* Message detail */
.msg-detail {
    padding: 2rem;
}
.msg-detail h3 {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}
.msg-detail .meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}
.msg-detail .meta span {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--mist);
}
.msg-detail .meta strong { color: var(--gold); }
.msg-detail .body {
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--bone);
    white-space: pre-wrap;
    padding: 1.5rem;
    background: var(--ink);
    border: 1px solid var(--line);
    margin-bottom: 2rem;
}

/* PHOTO UPLOAD */
.photo-drop {
    padding: 2rem 1.5rem;
    border: 1px dashed var(--gold);
    text-align: center;
    background: rgba(212,175,55,0.03);
    transition: all 0.3s var(--ease);
    cursor: pointer;
    position: relative;
}
.photo-drop:hover, .photo-drop.dragover {
    background: rgba(212,175,55,0.08);
    border-color: var(--gold-bright);
}
.photo-drop i {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
    display: block;
}
.photo-drop p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--paper);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}
.photo-drop small {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--mist);
}
.photo-drop input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.photo-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}
.photo-thumb {
    aspect-ratio: 4/3;
    border: 1px solid var(--line);
    background: var(--ink);
    position: relative;
    overflow: hidden;
}
.photo-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.photo-thumb .rm {
    position: absolute;
    top: 4px; right: 4px;
    width: 24px; height: 24px;
    background: rgba(0,0,0,0.7);
    color: var(--gold);
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}
.photo-thumb .rm:hover { background: var(--gold); color: var(--ink); }

/* TOAST */
.toast-stack {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.toast-ed {
    padding: 1rem 1.5rem;
    background: var(--ink-soft);
    border: 1px solid var(--gold);
    border-left: 3px solid var(--gold);
    color: var(--paper);
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: toastIn 0.4s var(--ease);
}
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-ed.fade-out { animation: toastOut 0.3s var(--ease) forwards; }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }
.toast-ed i { color: var(--gold); font-size: 1.2rem; }
.toast-ed .toast-body strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.05rem;
}
.toast-ed .toast-body small {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mist);
}

/* Ensure topbar buttons can host dropdowns */
.top-actions { position: relative; }
.top-btn { cursor: pointer; }

/* Reposition specific dropdowns under their button */
.top-btn-wrap {
    position: relative;
    display: inline-flex;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .admin-shell { grid-template-columns: 70px 1fr; }
    .side-brand .tag, .side-link span, .side-chapter, .side-user-info { display: none; }
    .side-brand img { height: 36px; }
    .side-link { justify-content: center; padding: 0.85rem 0; }
    .kpi-grid-ed { grid-template-columns: 1fr 1fr; }
    .kpi-cell:nth-child(2) { border-right: 0; }
    .kpi-cell:nth-child(odd) { border-right: 1px solid var(--line); }
    .chart-row { grid-template-columns: 1fr; }
    .vault-shell-ed { grid-template-columns: 1fr; }
    .perm-grid { grid-template-columns: 1fr; }
    .settings-grid-ed { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { display: none; }
    .top-search { display: none; }
    .admin-content-ed { padding: 1.5rem; }
    .kpi-grid-ed { grid-template-columns: 1fr; }
    .kpi-cell { border-right: 0; border-bottom: 1px solid var(--line); }
}
