/* PeraSignage UX V7 — dashboard, quick publish, notifications, calendar, compact flows */

:root {
    --pera-ink: #101828;
    --pera-subtle: #667085;
    --pera-line: #e7ebf1;
    --pera-soft: #f7f9fc;
    --pera-blue: #1478ff;
    --pera-violet: #6b4cff;
    --pera-green: #12b76a;
    --pera-red: #f04438;
    --pera-amber: #f79009;
    --pera-shadow: 0 18px 48px rgba(16, 24, 40, .08);
}

/* ---------- Global action strip ---------- */
.pera-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.pera-top-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transition: .18s ease;
}

.pera-top-action:hover {
    transform: translateY(-1px);
    border-color: #cfd7e4;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.pera-top-action.primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pera-blue), var(--pera-violet));
    color: #fff;
    box-shadow: 0 8px 18px rgba(45, 105, 255, .18);
}

.pera-top-action svg,
.pera-bell-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pera-bell-wrap {
    position: relative;
}

.pera-bell-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    cursor: pointer;
}

.pera-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--pera-red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
}

.pera-bell-badge.hidden { display: none; }

/* ---------- Dashboard ---------- */
#page-dashboard .page-header {
    margin-bottom: 16px;
}

.pera-dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 18px;
    margin-bottom: 16px;
    padding: 24px;
    border: 1px solid #dfe7f2;
    border-radius: 18px;
    background:
        radial-gradient(circle at 85% 15%, rgba(107, 76, 255, .18), transparent 34%),
        radial-gradient(circle at 70% 110%, rgba(20, 120, 255, .15), transparent 40%),
        linear-gradient(140deg, #ffffff 0%, #fbfcff 70%, #f6f8ff 100%);
    box-shadow: 0 14px 38px rgba(31, 45, 71, .05);
}

.pera-dashboard-hero::after {
    content: "";
    position: absolute;
    right: -68px;
    top: -86px;
    width: 250px;
    height: 250px;
    border: 1px solid rgba(44, 95, 255, .12);
    border-radius: 50%;
}

.pera-dashboard-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: #54708f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pera-dashboard-kicker span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pera-green);
    box-shadow: 0 0 0 5px rgba(18, 183, 106, .10);
}

.pera-dashboard-hero h2 {
    margin: 0;
    color: var(--pera-ink);
    font-size: clamp(26px, 2.4vw, 40px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.pera-dashboard-hero p {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--pera-subtle);
    font-size: 13px;
    line-height: 1.65;
}

.pera-dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.pera-dashboard-hero-actions button {
    min-height: 40px;
    padding: 0 15px;
    border-radius: 10px;
}

.pera-dashboard-live-card {
    align-self: stretch;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 17px;
    border: 1px solid rgba(42, 74, 126, .11);
    border-radius: 15px;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(12px);
}

.pera-dashboard-live-card .label {
    color: #7a8699;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.pera-live-number {
    margin: 5px 0 2px;
    color: #152033;
    font-size: 38px;
    font-weight: 850;
    letter-spacing: -.05em;
}

.pera-live-number small {
    margin-left: 3px;
    color: #8b96a8;
    font-size: 13px;
    font-weight: 700;
}

.pera-progress-track {
    overflow: hidden;
    height: 8px;
    margin: 10px 0 8px;
    border-radius: 999px;
    background: #edf1f6;
}

.pera-progress-track span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width .35s ease;
}

.pera-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pera-metric-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--pera-line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: .18s ease;
}

.pera-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(16, 24, 40, .06);
}

.pera-metric-card .icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 15px;
    border-radius: 9px;
    background: #f2f7ff;
    color: var(--pera-blue);
}

.pera-metric-card .icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.pera-metric-card strong {
    display: block;
    color: #111827;
    font-size: 24px;
    line-height: 1;
    letter-spacing: -.035em;
}

.pera-metric-card .metric-label {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.pera-metric-card .metric-note {
    display: block;
    margin-top: 3px;
    color: #98a2b3;
    font-size: 9px;
}

.pera-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 14px;
}

.pera-dashboard-card {
    border: 1px solid var(--pera-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(16, 24, 40, .025);
}

.pera-dashboard-card + .pera-dashboard-card {
    margin-top: 14px;
}

.pera-dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 17px 13px;
    border-bottom: 1px solid #eff2f6;
}

.pera-dashboard-card-head h3 {
    margin: 0;
    color: #172033;
    font-size: 14px;
    font-weight: 820;
}

.pera-dashboard-card-head p {
    margin: 4px 0 0;
    color: #8490a2;
    font-size: 10px;
    line-height: 1.45;
}

.pera-dashboard-card-body {
    padding: 14px 17px 17px;
}

.pera-onboarding-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    color: #475467;
    font-size: 10px;
    font-weight: 800;
}

.pera-onboarding-progress .bar {
    overflow: hidden;
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: #edf1f5;
}

.pera-onboarding-progress .bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--pera-blue), var(--pera-violet));
}

.pera-checklist {
    display: grid;
    gap: 8px;
}

.pera-check-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #edf0f4;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.pera-check-item:hover { background: #fafcff; border-color: #dfe8f6; }

.pera-check-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #f2f4f7;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 900;
}

.pera-check-item.done .pera-check-icon {
    background: #eafaf2;
    color: var(--pera-green);
}

.pera-check-copy strong {
    display: block;
    color: #344054;
    font-size: 11px;
}

.pera-check-copy span {
    display: block;
    margin-top: 2px;
    color: #98a2b3;
    font-size: 9px;
}

.pera-check-arrow { color: #98a2b3; font-size: 15px; }

.pera-upcoming-list,
.pera-activity-list {
    display: grid;
    gap: 6px;
}

.pera-upcoming-item,
.pera-activity-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f3f6;
}

.pera-upcoming-item:last-child,
.pera-activity-item:last-child { border-bottom: 0; }

.pera-upcoming-time {
    color: #344054;
    font-size: 10px;
    font-weight: 800;
}

.pera-upcoming-copy strong,
.pera-activity-copy strong {
    display: block;
    color: #344054;
    font-size: 10px;
}

.pera-upcoming-copy span,
.pera-activity-copy span {
    display: block;
    margin-top: 2px;
    color: #98a2b3;
    font-size: 9px;
}

.pera-upcoming-badge {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef5ff;
    color: #246bce;
    font-size: 8px;
    font-weight: 800;
}

.pera-empty-mini {
    padding: 12px 0;
    color: #98a2b3;
    font-size: 10px;
    text-align: center;
}

.pera-quick-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pera-quick-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px;
    border: 1px solid #edf0f5;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    text-align: left;
}

.pera-quick-link:hover { background: #f9fbff; border-color: #dce6f5; }
.pera-quick-link strong { display: block; font-size: 10px; }
.pera-quick-link span { display: block; margin-top: 2px; color: #98a2b3; font-size: 8px; }

/* ---------- Drawer / notification panel ---------- */
.pera-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: flex;
    justify-content: flex-end;
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(3px);
}
.pera-drawer-backdrop.hidden { display: none; }

.pera-drawer {
    display: flex;
    flex-direction: column;
    width: min(470px, 94vw);
    height: 100%;
    background: #fff;
    box-shadow: -20px 0 60px rgba(15, 23, 42, .16);
    animation: peraDrawerIn .22s ease both;
}
@keyframes peraDrawerIn { from { transform: translateX(24px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }

.pera-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--pera-line);
}
.pera-drawer-header h2 { margin: 0; color: #172033; font-size: 18px; }
.pera-drawer-header p { margin: 5px 0 0; color: #8a96a8; font-size: 10px; line-height: 1.5; }
.pera-drawer-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e4e8ef;
    border-radius: 9px;
    background: #fff;
    color: #667085;
    cursor: pointer;
    font-size: 20px;
}
.pera-drawer-body { overflow: auto; flex: 1; padding: 18px 20px; }
.pera-drawer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--pera-line); background: #fff; }

.pera-step-label {
    margin: 0 0 8px;
    color: #344054;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pera-source-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.pera-source-tab {
    padding: 11px 12px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #fff;
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}
.pera-source-tab.active { border-color: #9ec5ff; background: #eef6ff; color: #1768cf; box-shadow: inset 0 0 0 1px rgba(20,120,255,.06); }

.pera-quick-source-list,
.pera-quick-target-list {
    display: grid;
    gap: 7px;
    max-height: 260px;
    overflow: auto;
    padding-right: 2px;
}

.pera-select-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 9px 10px;
    border: 1px solid #e8ecf2;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.pera-select-row:hover { background: #fafcff; }
.pera-select-row input { width: 15px; height: 15px; margin: 0; }
.pera-select-row strong { display: block; color: #344054; font-size: 10px; }
.pera-select-row span { display: block; margin-top: 2px; color: #98a2b3; font-size: 8px; }
.pera-select-row .thumb { overflow: hidden; width: 42px; height: 32px; border-radius: 6px; background: #eef2f6; }
.pera-select-row .thumb img,
.pera-select-row .thumb video { width: 100%; height: 100%; object-fit: cover; }

.pera-drawer-divider { height: 1px; margin: 17px 0; background: #eef1f5; }
.pera-drawer-status { color: #667085; font-size: 9px; line-height: 1.5; }
.pera-drawer-status.error { color: var(--pera-red); }
.pera-drawer-status.success { color: var(--pera-green); }

.pera-notification-panel {
    position: fixed;
    top: 58px;
    right: 18px;
    z-index: 7100;
    width: min(370px, calc(100vw - 24px));
    max-height: min(620px, calc(100vh - 78px));
    overflow: hidden;
    border: 1px solid #e2e7ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
}
.pera-notification-panel.hidden { display: none; }
.pera-notification-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; border-bottom: 1px solid #edf0f4; }
.pera-notification-head strong { color: #172033; font-size: 12px; }
.pera-notification-head button { border: 0; background: transparent; color: #1478ff; font-size: 9px; font-weight: 800; cursor: pointer; }
.pera-notification-list { overflow: auto; max-height: 520px; padding: 5px 14px 12px; }
.pera-notification-item { display: grid; grid-template-columns: 10px 1fr; gap: 9px; padding: 11px 2px; border-bottom: 1px solid #f1f3f6; }
.pera-notification-item:last-child { border-bottom: 0; }
.pera-notification-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #98a2b3; }
.pera-notification-dot.error { background: var(--pera-red); }
.pera-notification-dot.success { background: var(--pera-green); }
.pera-notification-dot.warning { background: var(--pera-amber); }
.pera-notification-copy strong { display: block; color: #344054; font-size: 10px; }
.pera-notification-copy span { display: block; margin-top: 3px; color: #98a2b3; font-size: 8px; line-height: 1.45; }

/* ---------- Media grid / list ---------- */
.pera-media-view-toggle {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid #e5e9ef;
    border-radius: 9px;
    background: #f8fafc;
}
.pera-media-view-toggle button {
    min-width: 34px;
    height: 30px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8490a2;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}
.pera-media-view-toggle button.active { background: #fff; color: #1f67c7; box-shadow: 0 2px 7px rgba(15, 23, 42, .06); }

.media-table-wrap.pera-grid-mode { overflow: visible; border: 0; background: transparent; }
.media-table-wrap.pera-grid-mode .media-table { display: block; width: 100%; }
.media-table-wrap.pera-grid-mode thead { display: none; }
.media-table-wrap.pera-grid-mode tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}
.media-table-wrap.pera-grid-mode tbody tr {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #e4e9f0;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .025);
}
.media-table-wrap.pera-grid-mode tbody tr:hover { border-color: #d6e1ef; box-shadow: 0 12px 24px rgba(15, 23, 42, .06); }
.media-table-wrap.pera-grid-mode tbody td { display: block; width: 100%; padding: 0 12px; border: 0; }
.media-table-wrap.pera-grid-mode tbody td:first-child { order: 0; padding: 0; }
.media-table-wrap.pera-grid-mode .media-table-preview { width: 100%; height: 118px; border-radius: 0; object-fit: cover; background: #101828; }
.media-table-wrap.pera-grid-mode .media-table-name { order: 1; padding-top: 11px; }
.media-table-wrap.pera-grid-mode .media-table-name strong { font-size: 11px; }
.media-table-wrap.pera-grid-mode .media-table-name small { overflow: hidden; display: block; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.media-table-wrap.pera-grid-mode tbody td:nth-child(3) { order: 2; padding-top: 7px; }
.media-table-wrap.pera-grid-mode tbody td:nth-child(4) { order: 3; padding-top: 7px; }
.media-table-wrap.pera-grid-mode tbody td:nth-child(5) { order: 4; padding-top: 6px; color: #98a2b3; font-size: 9px; }
.media-table-wrap.pera-grid-mode tbody td:nth-child(6) { display: none; }
.media-table-wrap.pera-grid-mode tbody td:nth-child(7) { order: 5; padding-top: 10px; padding-bottom: 11px; margin-top: auto; }
.media-table-wrap.pera-grid-mode .media-table-actions { width: 100%; }
.media-table-wrap.pera-grid-mode .media-table-actions button { flex: 1; }

/* ---------- Playlist simplified mode ---------- */
.pera-playlist-mode-button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #e2e7ef;
    border-radius: 8px;
    background: #fff;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}
.pera-playlist-mode-button.active { border-color: #b8d4ff; background: #eff6ff; color: #1d6bd1; }

body:not(.pera-playlist-advanced) #playlist .duration-wrap,
body:not(.pera-playlist-advanced) #playlist .media-layout-wrap,
body:not(.pera-playlist-advanced) #playlist .media-layout-empty { display: none !important; }
body:not(.pera-playlist-advanced) #playlist .playlist-item {
    grid-template-columns: 36px 68px minmax(180px, 1fr) 124px !important;
    align-items: center;
}
body:not(.pera-playlist-advanced) .playlist-table-head {
    grid-template-columns: 36px 68px minmax(180px, 1fr) 124px !important;
}
body:not(.pera-playlist-advanced) .playlist-table-head span:nth-child(4),
body:not(.pera-playlist-advanced) .playlist-table-head span:nth-child(5) { display: none; }
body:not(.pera-playlist-advanced) #playlist .item-actions { opacity: .7; transition: opacity .15s ease; }
body:not(.pera-playlist-advanced) #playlist .playlist-item:hover .item-actions { opacity: 1; }

/* ---------- Calendar ---------- */
.pera-calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
}
.pera-calendar-nav, .pera-calendar-view-tabs { display: inline-flex; align-items: center; gap: 4px; }
.pera-calendar-nav button, .pera-calendar-view-tabs button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #fff;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}
.pera-calendar-view-tabs button.active { border-color: #b8d4ff; background: #eef6ff; color: #1a69ce; }
.pera-calendar-label { min-width: 150px; color: #344054; font-size: 11px; font-weight: 850; text-align: center; }
.pera-calendar-view.hidden, #schedule-list.pera-hidden { display: none !important; }
.pera-month-grid { overflow: hidden; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid #e6eaf0; border-radius: 12px; background: #fff; }
.pera-month-weekday { padding: 9px 7px; border-bottom: 1px solid #e7ebf1; background: #f8fafc; color: #98a2b3; font-size: 8px; font-weight: 850; text-align: center; text-transform: uppercase; }
.pera-day-cell { min-height: 104px; padding: 8px; border-right: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; background: #fff; }
.pera-day-cell:nth-child(7n) { border-right: 0; }
.pera-day-cell.muted { background: #fafbfc; color: #c0c7d2; }
.pera-day-cell.today { box-shadow: inset 0 0 0 2px rgba(20, 120, 255, .16); }
.pera-day-number { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; color: #475467; font-size: 9px; font-weight: 800; }
.pera-day-cell.today .pera-day-number { background: #1478ff; color: #fff; }
.pera-day-events { display: grid; gap: 4px; margin-top: 5px; }
.pera-calendar-event { overflow: hidden; width: 100%; padding: 5px 6px; border: 0; border-left: 3px solid #1478ff; border-radius: 5px; background: #eff6ff; color: #2c5f9d; font-size: 8px; font-weight: 760; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.pera-calendar-event.active { border-left-color: #12b76a; background: #ecfdf3; color: #147a4c; }
.pera-calendar-event.disabled { border-left-color: #98a2b3; background: #f2f4f7; color: #667085; }
.pera-week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pera-week-day { min-height: 210px; padding: 10px; border: 1px solid #e6eaf0; border-radius: 10px; background: #fff; }
.pera-week-day.today { border-color: #a9cdfd; box-shadow: inset 0 0 0 1px #dcecff; }
.pera-week-day-head { margin-bottom: 10px; color: #344054; font-size: 9px; font-weight: 850; }
.pera-week-day-head span { display: block; margin-top: 2px; color: #98a2b3; font-size: 8px; font-weight: 650; }

/* ---------- Group collapse ---------- */
.pera-collapse-button { transition: transform .18s ease; }
.robot-card.pera-collapsed .screens-grid { display: none; }
.robot-card.pera-collapsed .robot-header { border-bottom: 0; }
.robot-card.pera-collapsed .pera-collapse-button { transform: rotate(-90deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .pera-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pera-dashboard-columns { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .pera-top-action span { display: none; }
    .pera-top-action { width: 36px; padding: 0; }
    .pera-dashboard-hero { grid-template-columns: 1fr; }
    .pera-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pera-quick-links { grid-template-columns: 1fr; }
    .pera-calendar-controls { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
    .pera-dashboard-grid { grid-template-columns: 1fr; }
    .pera-dashboard-hero { padding: 18px; }
    .pera-upcoming-item, .pera-activity-item { grid-template-columns: 50px 1fr; }
    .pera-upcoming-badge { display: none; }
    .media-table-wrap.pera-grid-mode tbody { grid-template-columns: 1fr; }
}

/* Optional screen list view: compact operational scanning for large fleets */
body.pera-screen-list-mode .screens-grid {
    grid-template-columns: 1fr !important;
}
body.pera-screen-list-mode .screen-card {
    max-width: none !important;
    min-height: 0 !important;
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.3fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 12px !important;
}
body.pera-screen-list-mode .screen-card .screen-header {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
body.pera-screen-list-mode .screen-card .screen-body,
body.pera-screen-list-mode .screen-card .screen-info {
    margin: 0 !important;
}
body.pera-screen-list-mode .screen-card .screen-card-toolbar {
    justify-self: end;
}
@media (max-width: 900px) {
    body.pera-screen-list-mode .screen-card {
        grid-template-columns: 1fr;
    }
    body.pera-screen-list-mode .screen-card .screen-card-toolbar {
        justify-self: stretch;
    }
}
.pera-collapse-button svg {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}
