/* ============================================
   admin-crud.css — Users/Events CRUD admin surface
   Editorial dark. Follows peakshot-theme tokens.
   Kept isolated from dashboard admin.css.
   ============================================ */

/* -------- Additional font: IBM Plex Mono for technical text -------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

.ac-page {
    --ac-mono: 'IBM Plex Mono', 'Courier New', monospace;
    --ac-panel: #0f0f17;
    --ac-panel-2: #14141d;
    --ac-line: #1e1e2a;
    --ac-line-hi: #2a2a3a;
    --ac-text: #e8e8f4;
    --ac-text-dim: #6b6b80;
    --ac-text-mute: #40405a;

    font-family: var(--font-body);
    color: var(--ac-text);
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 24px 96px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.ac-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ac-line);
    margin-bottom: 28px;
}

.ac-header-main { min-width: 0; }

.ac-kicker {
    font-family: var(--ac-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ac-text-mute);
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.ac-kicker a { color: var(--ac-text-dim); text-decoration: none; transition: color .15s; }
.ac-kicker a:hover { color: var(--ice-bright); }
.ac-kicker .sep { color: var(--ac-text-mute); }

.ac-title {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--ac-text);
    margin: 0 0 10px;
}
.ac-title .count { color: var(--ice); font-weight: 400; }

.ac-subtitle {
    font-family: var(--ac-mono);
    font-size: 12px;
    color: var(--ac-text-dim);
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}
.ac-subtitle .dot { color: var(--ac-text-mute); }

.ac-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ============================================
   BUTTONS
   ============================================ */
.ac-btn {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--ac-line-hi);
    background: var(--ac-panel);
    color: var(--ac-text);
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.ac-btn:hover { border-color: var(--ice-dim); color: var(--white); background: var(--ac-panel-2); }
.ac-btn:disabled, .ac-btn.is-disabled { opacity: .35; cursor: not-allowed; }

.ac-btn-primary {
    background: var(--ice);
    border-color: var(--ice);
    color: #0a0a0f;
    font-weight: 600;
}
.ac-btn-primary:hover { background: var(--ice-bright); border-color: var(--ice-bright); color: #0a0a0f; box-shadow: 0 0 0 3px var(--ice-glow); }

.ac-btn-ghost { background: transparent; border-color: transparent; color: var(--ac-text-dim); }
.ac-btn-ghost:hover { color: var(--ice-bright); background: transparent; border-color: transparent; }

.ac-btn-danger {
    background: transparent;
    border-color: rgba(255, 77, 79, 0.35);
    color: #ff6b6d;
}
.ac-btn-danger:hover { background: rgba(255, 77, 79, 0.12); border-color: var(--danger); color: #ff8080; }

.ac-btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 6px; }

/* ============================================
   FILTER BAR
   ============================================ */
.ac-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--ac-panel);
    border: 1px solid var(--ac-line);
    border-radius: 12px;
}

.ac-search {
    flex: 1;
    min-width: 240px;
    background: transparent;
    border: 1px solid var(--ac-line);
    border-radius: 8px;
    padding: 9px 14px;
    color: var(--ac-text);
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}
.ac-search:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px var(--ice-glow); }
.ac-search::placeholder { color: var(--ac-text-mute); }

.ac-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-chip {
    font-family: var(--ac-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--ac-line-hi);
    color: var(--ac-text-dim);
    text-decoration: none;
    transition: all .15s;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ac-chip:hover { border-color: var(--ice-dim); color: var(--white); }
.ac-chip.is-active {
    background: var(--ice-glow);
    border-color: var(--ice);
    color: var(--ice-bright);
}

.ac-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid var(--ac-line-hi);
    border-radius: 8px;
    font-size: 12px;
    color: var(--ac-text-dim);
    cursor: pointer;
    transition: color .15s, border-color .15s;
    user-select: none;
}
.ac-checkbox input { accent-color: var(--ice); }
.ac-checkbox:hover { color: var(--white); border-color: var(--ice-dim); }

/* ============================================
   DATA TABLE
   ============================================ */
.ac-table-wrap {
    background: var(--ac-panel);
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    overflow: hidden;
    /* horizontal scroll fallback on narrow viewports */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ac-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 13px;
    min-width: 720px; /* prevents column crush; wrap scrolls horizontally below this */
}

.ac-table thead th {
    font-family: var(--ac-mono);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ac-text-mute);
    text-align: left;
    padding: 12px 18px;
    background: var(--ac-panel-2);
    border-bottom: 1px solid var(--ac-line);
    white-space: nowrap;
}

.ac-table tbody tr {
    border-bottom: 1px solid var(--ac-line);
    transition: background .15s;
    cursor: pointer;
}
.ac-table tbody tr:last-child { border-bottom: 0; }
.ac-table tbody tr:hover { background: rgba(123, 110, 232, 0.04); }

.ac-table td {
    padding: 14px 18px;
    color: var(--ac-text);
    vertical-align: middle;
}

.ac-table tr.is-deleted { opacity: 0.55; }
.ac-table tr.is-deleted td { text-decoration: line-through; text-decoration-color: rgba(255,77,79,0.4); }

/* User cell — stacked name/email */
.ac-user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ac-avatar {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ice-dim), var(--ice));
    color: #fff;
    font-family: var(--ac-mono);
    font-size: 12px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.02em;
}
.ac-avatar-lg { width: 72px; height: 72px; border-radius: 14px; font-size: 22px; }
.ac-avatar-sm { width: 28px; height: 28px; border-radius: 6px; font-size: 11px; }

.ac-user-name { font-weight: 500; color: var(--white); font-size: 13.5px; }
.ac-user-email { color: var(--ac-text-dim); font-size: 11.5px; font-family: var(--ac-mono); margin-top: 2px; }

/* Meta values */
.ac-mono { font-family: var(--ac-mono); font-size: 11.5px; color: var(--ac-text-dim); }
.ac-mute { color: var(--ac-text-mute); }
.ac-num { font-family: var(--ac-mono); color: var(--ac-text); }
.ac-id { font-family: var(--ac-mono); color: var(--ac-text-mute); font-size: 10.5px; letter-spacing: 0.02em; }

/* ============================================
   BADGES
   ============================================ */
.ac-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--ac-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.5;
}
.ac-badge::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.ac-badge.no-dot::before { display: none; }

/* Role badges */
.ac-badge-role-1 { background: rgba(24, 201, 100, 0.10); color: #34d97e; }   /* Customer green */
.ac-badge-role-2 { background: rgba(123, 110, 232, 0.14); color: var(--ice-bright); }  /* Photographer purple */
.ac-badge-role-3 { background: rgba(250, 173, 20, 0.12); color: #ffc453; }  /* Admin gold */

/* Status badges */
.ac-badge-active   { background: rgba(24, 201, 100, 0.10); color: #34d97e; }
.ac-badge-inactive { background: rgba(107, 107, 128, 0.14); color: var(--ac-text-dim); }
.ac-badge-deleted  { background: rgba(255, 77, 79, 0.12); color: #ff8080; }

/* Tier badges — 6 commission segments */
.ac-badge-tier-1 { background: rgba(107, 107, 128, 0.14); color: #9898a8; }     /* New — gray */
.ac-badge-tier-2 { background: rgba(6, 182, 212, 0.14);   color: #22d3ee; }     /* Recurring — cyan */
.ac-badge-tier-3 { background: rgba(52, 217, 126, 0.14);  color: #34d97e; }     /* HighVolume — green */
.ac-badge-tier-4 { background: rgba(20, 184, 166, 0.14);  color: #2dd4bf; }     /* Partnership — teal */
.ac-badge-tier-5 { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }     /* Marketplace — silver */
.ac-badge-tier-6 {
    background: linear-gradient(135deg, rgba(250, 173, 20, 0.15), rgba(250, 173, 20, 0.05));
    color: #ffc453;
    border: 1px solid rgba(250, 173, 20, 0.35);
    box-shadow: 0 0 12px rgba(250, 173, 20, 0.08);
}                                                                                 /* Founder — gold, special */

.ac-verified-yes { color: #34d97e; font-size: 13px; }
.ac-verified-no  { color: var(--ac-text-mute); font-size: 13px; }

/* ============================================
   PAGINATION
   ============================================ */
.ac-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 8px;
    font-family: var(--ac-mono);
    font-size: 11.5px;
    color: var(--ac-text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ac-pagination .ac-btn { padding: 8px 14px; font-size: 12px; }

/* ============================================
   EMPTY STATE
   ============================================ */
.ac-empty {
    padding: 72px 24px;
    text-align: center;
    background: var(--ac-panel);
    border: 1px dashed var(--ac-line-hi);
    border-radius: 12px;
}
.ac-empty-icon {
    font-family: var(--ac-mono);
    font-size: 40px;
    color: var(--ac-text-mute);
    margin-bottom: 18px;
    letter-spacing: -.05em;
}
.ac-empty-title {
    font-family: var(--font-display);
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: -.01em;
    color: var(--ac-text);
    margin: 0 0 6px;
}
.ac-empty-sub {
    color: var(--ac-text-dim);
    font-size: 13px;
    margin: 0 0 20px;
}

/* ============================================
   DETAIL PAGE HERO
   ============================================ */
.ac-hero {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 28px;
    background: linear-gradient(180deg, var(--ac-panel-2), var(--ac-panel));
    border: 1px solid var(--ac-line);
    border-radius: 14px;
    margin-bottom: 24px;
}
.ac-hero-info { flex: 1; min-width: 0; }
.ac-hero-name {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1;
    color: var(--white);
    text-transform: uppercase;
    margin: 4px 0 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.ac-hero-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-family: var(--ac-mono);
    font-size: 12px;
    color: var(--ac-text-dim);
    letter-spacing: 0.02em;
}
.ac-hero-meta strong { color: var(--white); font-weight: 500; }
.ac-hero-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ============================================
   TABS
   ============================================ */
.ac-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ac-line);
    margin-bottom: 28px;
    padding: 0 4px;
}
.ac-tab {
    font-family: var(--ac-mono);
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 14px 18px;
    color: var(--ac-text-dim);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.ac-tab:hover { color: var(--white); }
.ac-tab.is-active {
    color: var(--ice-bright);
    border-bottom-color: var(--ice);
}

/* ============================================
   CARDS / SECTIONS
   ============================================ */
.ac-card {
    background: var(--ac-panel);
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 18px;
}

.ac-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -4px 0 20px;
    gap: 16px;
}

.ac-card-title {
    font-family: var(--ac-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ac-text-dim);
    margin: 0;
}

/* Field grid */
.ac-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 20px;
}
.ac-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Grid children default to min-width: auto (= min-content). For inputs
       with long content (URLs) or textareas, min-content can exceed the
       track share and overflow on mobile. Force the track to honor
       grid-template-columns. */
    min-width: 0;
}
.ac-field > .ac-input, .ac-field > textarea { max-width: 100%; }
.ac-field label {
    font-family: var(--ac-mono);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ac-text-mute);
}
.ac-input {
    font-family: var(--font-body);
    font-size: 13.5px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ac-panel-2);
    border: 1px solid var(--ac-line);
    color: var(--ac-text);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.ac-input:focus {
    outline: none;
    border-color: var(--ice);
    box-shadow: 0 0 0 3px var(--ice-glow);
}
.ac-input::placeholder { color: var(--ac-text-mute); }
.ac-input:disabled { opacity: 0.55; }

.ac-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%236b6b80' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.ac-textarea { min-height: 92px; font-family: var(--font-body); resize: vertical; }

.ac-value {
    font-family: var(--font-body);
    color: var(--ac-text);
    font-size: 13.5px;
    padding: 8px 0;
}
.ac-value.mono { font-family: var(--ac-mono); font-size: 12px; }

.ac-info-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ac-info-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ac-line);
    font-size: 13px;
}
.ac-info-list li:last-child { border-bottom: 0; }
.ac-info-list .label { font-family: var(--ac-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ac-text-mute); }
.ac-info-list .value { font-family: var(--ac-mono); font-size: 12px; color: var(--ac-text); text-align: right; }

.ac-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ac-line);
    align-items: center;
    flex-wrap: wrap;
}

.ac-help {
    font-size: 12px;
    color: var(--ac-text-mute);
    font-family: var(--ac-mono);
    letter-spacing: 0.02em;
}

/* ============================================
   ACTIVITY FEED
   ============================================ */
.ac-activity {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ac-activity li {
    display: grid;
    grid-template-columns: 130px 100px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--ac-line);
    font-size: 13px;
}
.ac-activity li:last-child { border-bottom: 0; }
.ac-activity .time { font-family: var(--ac-mono); font-size: 11.5px; color: var(--ac-text-mute); }
.ac-activity .kind {
    font-family: var(--ac-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--ac-line-hi);
    color: var(--ac-text-dim);
    text-align: center;
}
.ac-activity .kind-order { color: #34d97e; border-color: rgba(24, 201, 100, 0.3); }
.ac-activity .kind-event { color: var(--ice-bright); border-color: rgba(123, 110, 232, 0.3); }
.ac-activity .kind-audit { color: #ffc453; border-color: rgba(250, 173, 20, 0.3); }
.ac-activity .summary { color: var(--ac-text); }
.ac-activity .summary a { color: var(--ice-bright); }

/* ============================================
   DANGER ZONE
   ============================================ */
.ac-danger {
    margin-top: 32px;
    border: 1px solid rgba(255, 77, 79, 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,77,79,0.03), rgba(255,77,79,0.01));
    padding: 24px 24px 8px;
    box-shadow: 0 0 40px rgba(255, 77, 79, 0.04);
}
.ac-danger-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    text-transform: uppercase;
    color: #ff6b6d;
    letter-spacing: -0.01em;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ac-danger-title::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 12px var(--danger);
}
.ac-danger-action {
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 77, 79, 0.15);
}
.ac-danger-action:last-child { border-bottom: 0; }
.ac-danger-label {
    font-weight: 500;
    color: var(--white);
    margin-bottom: 4px;
    font-size: 14px;
}
.ac-danger-desc {
    font-size: 12.5px;
    color: var(--ac-text-dim);
    margin-bottom: 12px;
    line-height: 1.5;
}
.ac-danger-desc code {
    font-family: var(--ac-mono);
    background: rgba(255, 77, 79, 0.08);
    color: #ff8080;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
}
.ac-danger-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================
   STICKY BAR
   ============================================ */
.ac-sticky {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: var(--ac-panel);
    border: 1px solid var(--ice-dim);
    border-radius: 12px;
    padding: 12px 12px 12px 18px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,.6), 0 0 0 3px var(--ice-glow);
    z-index: 50;
    font-size: 13px;
    color: var(--ac-text);
}
.ac-sticky.hidden { display: none; }
.ac-sticky .pulse::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ice);
    box-shadow: 0 0 8px var(--ice);
    animation: ac-pulse 2s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes ac-pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }

/* ============================================
   TOAST
   ============================================ */
.ac-toast {
    position: fixed;
    top: 84px;
    right: 24px;
    background: var(--ac-panel);
    border: 1px solid var(--ac-line-hi);
    border-left: 3px solid var(--ice);
    padding: 12px 16px 12px 18px;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--ac-text);
    max-width: 380px;
    animation: ac-toast-in .25s ease-out;
}
.ac-toast.success { border-left-color: #34d97e; }
.ac-toast.error   { border-left-color: var(--danger); }
.ac-toast button {
    background: transparent; border: 0;
    color: var(--ice-bright);
    font-family: var(--ac-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background .15s;
}
.ac-toast button:hover { background: var(--ice-glow); }

@keyframes ac-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   IMPERSONATION BANNER (overrides theme default)
   ============================================ */
.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 600;
    background: linear-gradient(90deg, #ff4d4f, #d63a3c);
    color: white;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    font-family: var(--ac-mono, 'IBM Plex Mono', monospace);
    letter-spacing: 0.04em;
    box-shadow: 0 4px 24px rgba(255, 77, 79, 0.35);
}
.impersonation-banner strong { font-weight: 600; letter-spacing: 0.05em; text-transform: none; }

/* ============================================
   MOBILE CARD ROWS (below sm)
   Below 640px, the table transforms: each row becomes a stacked card
   so nothing is truncated or hidden.
   ============================================ */
@media (max-width: 640px) {
    .ac-table-wrap { border: 0; background: transparent; padding: 0; }
    .ac-table { display: block; min-width: 0; }
    .ac-table thead { display: none; }
    .ac-table tbody { display: block; display: flex; flex-direction: column; gap: 10px; }
    .ac-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        row-gap: 6px;
        column-gap: 12px;
        background: var(--ac-panel);
        border: 1px solid var(--ac-line);
        border-radius: 10px;
        padding: 14px;
        border-bottom: 1px solid var(--ac-line) !important;
    }
    .ac-table tr:hover { background: var(--ac-panel-2); }
    .ac-table td { padding: 0; border: 0; }
    .ac-table td[data-label]::before {
        content: attr(data-label) ": ";
        font-family: var(--ac-mono);
        font-size: 10px;
        letter-spacing: 0.08em;
        color: var(--ac-text-mute);
        text-transform: uppercase;
        margin-right: 6px;
    }
    .ac-table td.cell-user {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }
    .ac-table td.cell-id { grid-column: 1 / -1; }
    .ac-table td.cell-actions {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
    }
}

/* ============================================
   TABLET/DESKTOP RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .ac-page { padding: 20px 16px 120px; }
    .ac-title { font-size: 2rem; }
    .ac-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .ac-header-actions { justify-content: flex-start; flex-wrap: wrap; }
    .ac-filters { padding: 10px; }
    .ac-filters .ac-search { min-width: 100%; flex-basis: 100%; }
    .ac-chips { width: 100%; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .ac-chip { flex-shrink: 0; }
    .ac-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 16px;
    }
    .ac-hero-name { font-size: 1.6rem; }
    .ac-avatar-lg { width: 56px; height: 56px; font-size: 18px; }
    .ac-hero-actions { width: 100%; }
    .ac-hero-meta { gap: 10px 18px; }
    .ac-activity li { grid-template-columns: 1fr; gap: 4px; }
    .ac-activity .time, .ac-activity .kind { justify-self: start; }
    .ac-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ac-tab { flex-shrink: 0; }
    .ac-card { padding: 18px; }
    .ac-field-grid { grid-template-columns: 1fr; }
    /* Neutralize inline grid-column spans (span 2, 1 / -1) so a single column
       is honored. Without this, an inline `span 2` forces grid to create an
       implicit second column, re-pairing fields and pushing full-width fields
       into a narrow track on mobile. */
    .ac-field-grid > .ac-field { grid-column: 1 / -1 !important; }
    /* Drop the desktop top-margin used to align checkboxes with sibling
       inputs — pointless once fields stack vertically. */
    .ac-field-grid > .ac-field > .ac-checkbox[style*="margin-top"] { margin-top: 0 !important; }
    .ac-sticky {
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 16px;
        justify-content: space-between;
    }
    .ac-toast { top: auto; bottom: 84px; right: 16px; left: 16px; max-width: none; }
    .impersonation-banner {
        flex-direction: column;
        gap: 8px;
        padding: 10px 16px;
        font-size: 11px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ac-page { padding: 16px 12px 120px; }
    .ac-title { font-size: 1.6rem; }
    .ac-subtitle { font-size: 11px; gap: 10px; }
    .ac-header-actions .ac-btn { flex: 1; justify-content: center; }
    .ac-hero-name { font-size: 1.35rem; gap: 8px; }
    .ac-hero-meta { font-size: 11px; gap: 8px 14px; }
    .ac-card { padding: 16px; }
    .ac-card-actions { flex-direction: column; align-items: stretch; }
    .ac-card-actions .ac-btn { justify-content: center; }
    .ac-danger { padding: 18px 16px 8px; }
    .ac-danger-form { flex-direction: column; align-items: stretch; }
    .ac-danger-form .ac-input { min-width: 0; }
}

/* ============================================
   EVENT-SPECIFIC ADDITIONS
   ============================================ */

/* Event status badges */
.ac-badge-status-0 { background: rgba(107, 107, 128, 0.14); color: #9898a8; } /* Draft */
.ac-badge-status-1 { background: rgba(24, 201, 100, 0.10); color: #34d97e; } /* Published */
.ac-badge-status-2 { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; } /* Archived */

/* Lifecycle badges — enum has only Active=1 + Purged=2 */
.ac-badge-lifecycle-1 { background: rgba(24, 201, 100, 0.10); color: #34d97e; }             /* Active */
.ac-badge-lifecycle-2 { background: rgba(107, 107, 128, 0.18); color: var(--ac-text-dim); } /* Purged */

/* Table row warnings */
.ac-table tr.is-expiring td { border-left: 3px solid #f59e0b; }
.ac-table tr.is-abandoned { opacity: 0.7; }
.ac-table tr.is-abandoned .ac-user-name::after {
    content: ' ⚠';
    color: #ffc453;
    font-size: 12px;
    margin-left: 4px;
}

/* Retention timeline */
.ac-timeline {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    gap: 8px;
    overflow-x: auto;
}
.ac-timeline-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    position: relative;
    opacity: 0.4;
    transition: opacity .2s;
}
.ac-timeline-step.done { opacity: 1; }
.ac-timeline-step .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ac-text-mute);
    border: 2px solid var(--ac-panel);
    margin: 0 auto 8px;
    position: relative;
    z-index: 2;
}
.ac-timeline-step.done .dot {
    background: var(--ice);
    box-shadow: 0 0 12px var(--ice-glow);
}
.ac-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--ac-line-hi);
    z-index: 1;
}
.ac-timeline-step.done:not(:last-child)::after { background: var(--ice-dim); }
.ac-timeline-step .label {
    font-family: var(--ac-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ac-text-dim);
    margin-bottom: 4px;
}
.ac-timeline-step .ac-mono {
    font-size: 11px;
    color: var(--ac-text);
}

/* Additional activity kind for events */
.ac-activity .kind-order { color: #34d97e; border-color: rgba(24, 201, 100, 0.3); }
.ac-activity .kind-audit { color: #ffc453; border-color: rgba(250, 173, 20, 0.3); }

@media (max-width: 640px) {
    .ac-timeline { flex-direction: column; gap: 12px; }
    .ac-timeline-step { min-width: 0; text-align: left; padding-left: 24px; }
    .ac-timeline-step .dot { position: absolute; left: 0; top: 4px; margin: 0; }
    .ac-timeline-step:not(:last-child)::after {
        left: 5px;
        top: 12px;
        right: auto;
        bottom: -20px;
        width: 2px;
        height: auto;
    }
}
