/* ACE Core OS ACPanel layout. */

:root {
    --bg: #06111f;
    --bg-soft: #0a1b32;
    --panel: rgba(13, 28, 48, 0.96);
    --panel-soft: rgba(17, 37, 63, 0.92);
    --border: rgba(114, 160, 210, 0.26);
    --text: #f4f8ff;
    --muted: #9fb2c9;
    --cyan: #42c8ff;
    --blue: #2f80ed;
    --success: #54d38f;
    --sidebar-width: 286px;
    font-family: var(--acs-font);
}

/* ACE-UI-FIX-02: approved modern UI dashboard reference pass. */
:root {
    --bg: #0b1220;
    --bg-soft: #0f172a;
    --panel: #151e2e;
    --panel-soft: #182235;
    --panel-deep: #111827;
    --border: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --subtle: #94a3b8;
    --cyan: #60a5fa;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 260px;
}

body[data-ace-theme-scope="acpanel"] {
    background:
        radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.12), transparent 28%),
        radial-gradient(circle at 84% 10%, rgba(139, 92, 246, 0.1), transparent 30%),
        linear-gradient(145deg, #0b1220, #0f172a 56%, #0b1220);
}

.acp-shell {
    background: transparent;
}

.acp-sidebar {
    border-right-color: rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.98));
    padding: 12px 10px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.025);
}

.acp-brand {
    min-height: 52px;
    margin-bottom: 8px;
    padding: 8px 10px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.acp-avatar,
.acp-logo-mark {
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.acp-nav {
    gap: 5px;
}

.acp-nav-group-toggle,
.acp-nav a,
.acp-nav-single {
    min-height: 36px;
    border-radius: 8px;
    color: #cbd5e1;
    padding: 0 9px;
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}

.acp-nav-group-toggle:hover,
.acp-nav-group.active > .acp-nav-group-toggle,
.acp-nav a:hover,
.acp-nav a.active,
.acp-nav-single:hover,
.acp-nav-single.active {
    border-color: rgba(59, 130, 246, 0.32);
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.12));
}

.acp-header {
    min-height: 56px;
    border-bottom-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(18px);
    padding: 8px 16px;
}

.acp-search,
.acp-header-button,
.acp-icon-button,
.acp-select,
.acp-user-button,
.acp-bell-button,
.inline-form button {
    min-height: 34px;
    border-color: rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(21, 30, 46, 0.86);
    color: #e2e8f0;
    box-shadow: none;
}

.acp-search {
    max-width: 360px;
    flex: 0 1 360px;
    padding: 0 11px;
}

.acp-search input {
    min-height: 34px;
    color: #cbd5e1;
}

.acp-header-button:hover,
.acp-icon-button:hover,
.acp-user-button:hover,
.acp-bell-button:hover {
    border-color: rgba(59, 130, 246, 0.38);
    background: #1d2a40;
}

.acp-content {
    width: min(1220px, 100%);
    gap: 14px;
    padding: clamp(16px, 1.7vw, 24px);
}

.acp-kicker {
    color: #94a3b8;
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}

.acp-card,
.acp-dashboard-manager,
.acp-widget-library,
.acp-stat-card,
.acp-report-card,
.acp-side-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(24, 34, 53, 0.97), rgba(21, 30, 46, 0.97));
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.22);
}

.acp-card:hover,
.acp-stat-card:hover,
.acp-report-card:hover,
.acp-side-card:hover {
    border-color: rgba(148, 163, 184, 0.22);
    background: linear-gradient(145deg, rgba(29, 42, 64, 0.97), rgba(21, 30, 46, 0.99));
}

.acp-card h2,
.acp-report-card h2,
.acp-side-card h2 {
    color: #f8fafc;
    font-size: var(--acs-fs);
    font-weight: 600;
}

.acp-card p,
.acp-muted,
.acp-activity-list span {
    color: #94a3b8;
}

.acp-dashboard-layout,
.acp-dashboard-main,
.acp-dashboard-aside,
.acp-bottom-widget-zone,
.acp-report-grid {
    gap: 14px;
}

.acp-stat-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.acp-stat-card {
    min-height: 90px;
    padding: 13px;
}

.acp-stat-card strong {
    color: #f8fafc;
    font-size: clamp(22px, 1.65vw, 27px);
}

.acp-stat-card span,
.acp-stat-card small {
    font-size: var(--acs-fs-xs);
}

.acp-stat-card small {
    color: #22c55e;
}

.acp-report-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.acp-report-card {
    min-height: 246px;
    padding: 15px;
}

.acp-table-wrap,
.acp-status-table,
.acp-activity-list.preview {
    overflow: hidden;
    border-color: rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.42);
}

.acp-table {
    min-width: 860px;
}

.acp-table th,
.acp-table td {
    border-bottom-color: rgba(148, 163, 184, 0.12);
    padding: 11px 12px;
}

.acp-table th {
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.62);
    font-size: var(--acs-fs-xs);
    letter-spacing: 0;
}

.acp-table td {
    color: #dbeafe;
}

.acp-filter-bar,
.acp-form-grid {
    gap: 10px;
}

.acp-filter-bar input,
.acp-filter-bar select,
.acp-form-grid input,
.acp-form-grid select,
.acp-form-grid textarea,
[data-confirm-action] select {
    min-height: 36px;
    border-color: rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.52);
    color: #e2e8f0;
}

.acp-primary-link,
.acp-form-actions button,
.acp-filter-bar button,
[data-confirm-action] button,
.acp-dashboard-manager button.is-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid rgba(59, 130, 246, 0.52);
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    padding: 0 13px;
    line-height: 1;
    text-align: center;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.acp-secondary-link,
.acp-row-actions a,
.acp-pagination a,
.acp-form-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-color: rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(21, 30, 46, 0.86);
    color: #cbd5e1;
    line-height: 1;
    text-align: center;
}

.acp-pill,
.acp-mini-badge,
.acp-chip-list span {
    min-height: 23px;
    border-color: rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    font-size: var(--acs-fs-xs);
}

.acp-pill.is-ok {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.12);
}

.acp-pill.is-warning {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.12);
}

.acp-pill.is-error {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.12);
}

body[data-theme="light"] {
    --bg: #f8fbff;
    --bg-soft: #eef5ff;
    --panel: rgba(255, 255, 255, 0.98);
    --panel-soft: rgba(242, 247, 255, 0.98);
    --panel-deep: #ffffff;
    --border: rgba(75, 109, 151, 0.18);
    --text: #0f172a;
    --muted: #64748b;
}

body[data-theme="light"][data-ace-theme-scope="acpanel"] {
    background: linear-gradient(145deg, #f8fbff, #eef5ff 58%, #ffffff);
}

body[data-theme="light"] .acp-sidebar,
body[data-theme="light"] .acp-header,
body[data-theme="light"] .acp-card,
body[data-theme="light"] .acp-stat-card,
body[data-theme="light"] .acp-report-card,
body[data-theme="light"] .acp-side-card {
    color: #0f172a;
    border-color: rgba(75, 109, 151, 0.18);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .acp-card h2,
body[data-theme="light"] .acp-stat-card strong,
body[data-theme="light"] .acp-table td {
    color: #0f172a;
}

body[data-theme="light"] .acp-search,
body[data-theme="light"] .acp-header-button,
body[data-theme="light"] .acp-icon-button,
body[data-theme="light"] .acp-user-button,
body[data-theme="light"] .acp-bell-button,
body[data-theme="light"] .acp-filter-bar input,
body[data-theme="light"] .acp-filter-bar select,
body[data-theme="light"] .acp-form-grid input,
body[data-theme="light"] .acp-form-grid select,
body[data-theme="light"] .acp-table-wrap {
    background: rgba(248, 251, 255, 0.96);
    color: #0f172a;
}

@media (max-width: 1420px) {
    .acp-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .acp-report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(145deg, var(--bg), var(--bg-soft) 55%, #050a14);
}

body[data-theme="light"] {
    --panel: rgba(246, 250, 255, 0.98);
    --panel-soft: rgba(235, 243, 252, 0.95);
    --border: rgba(82, 117, 155, 0.25);
    --text: #0c1727;
    --muted: #53677e;
    background: linear-gradient(145deg, #eef6ff, #dcecff 55%, #f8fbff);
}

a {
    color: inherit;
    text-decoration: none;
}

.acp-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.acp-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--border);
    background: rgba(6, 17, 31, 0.92);
    overflow-y: auto;
    padding: 16px 12px;
    transition: width 180ms ease, transform 180ms ease;
}

body[data-theme="light"] .acp-sidebar {
    background: rgba(246, 250, 255, 0.92);
}

.acp-shell.sidebar-collapsed {
    --sidebar-width: 92px;
}

.acp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px 10px 20px;
}

.acp-avatar {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), #3bbcff);
    font-weight: 600;
}

.acp-brand strong,
.acp-brand span {
    display: block;
}

.acp-brand span {
    color: var(--muted);
    font-size: var(--acs-fs-xs);
}

/* Stage 1.3 (E1.3-T15f): the brand's text goes, its logo mark stays (".acp-logo" no longer exists, so every div of the
   brand was hidden, the mark too). */
.sidebar-collapsed .acp-brand div:not(.acp-logo-mark),
.sidebar-collapsed .acp-nav a span:last-child,
.sidebar-collapsed .acp-nav-group-toggle span:nth-child(2),
.sidebar-collapsed .acp-nav-chevron {
    display: none;
}

.acp-nav {
    display: grid;
    gap: 8px;
}

.acp-nav-group {
    display: grid;
    gap: 4px;
}

.acp-nav-group-toggle,
.acp-nav a,
.acp-nav-single {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    padding: 0 9px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.acp-nav-group-toggle:hover,
.acp-nav-group.active > .acp-nav-group-toggle,
.acp-nav a:hover,
.acp-nav a.active,
.acp-nav-single:hover,
.acp-nav-single.active {
    border-color: var(--border);
    color: var(--text);
    background: var(--panel-soft);
}

.acp-nav-single {
    min-height: 38px;
    margin-bottom: 8px;
    color: #c6d5e8;
    font-weight: 600;
}

.acp-nav-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    color: var(--muted);
    padding: 0 10px;
    font-size: var(--acs-fs-xs);
}

.acp-nav-chevron {
    margin-left: auto;
    color: var(--cyan);
    font-size: var(--acs-fs-title);
    line-height: 1;
}

.acp-nav-group.open .acp-nav-chevron {
    transform: rotate(45deg);
}

.acp-nav-submenu {
    display: none;
    gap: 3px;
    padding: 2px 0 6px 11px;
}

.acp-nav-group.open .acp-nav-submenu {
    display: grid;
}

.sidebar-collapsed .acp-nav-submenu {
    display: none !important;
}

.acp-main {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
}

.acp-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 62px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 18, 34, 0.86);
    backdrop-filter: blur(14px);
    padding: 10px 16px;
}

body[data-theme="light"] .acp-header {
    background: rgba(246, 250, 255, 0.86);
}

.acp-icon-button,
.acp-header-button,
.acp-select,
.acp-user-button,
.inline-form button {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 0 10px;
    font: inherit;
    font-weight: 600;
}

.acp-header-button.compact {
    min-width: auto;
    white-space: nowrap;
}

.acp-header-button.active {
    border-color: rgba(66, 200, 255, 0.55);
    color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(66, 200, 255, 0.1);
}

.acp-bell-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--text);
}

.acp-bell-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.acp-icon-button,
.acp-header-button,
.acp-user-button,
.inline-form button {
    cursor: pointer;
}

.acp-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
    flex: 1 1 260px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 0 12px;
}

.acp-search span {
    color: var(--cyan);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}

.acp-search input {
    width: 100%;
    min-height: 36px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
}

.acp-user {
    position: relative;
}

.acp-user-button {
    display: flex;
    align-items: center;
    gap: 9px;
}

.acp-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 240px;
    display: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    padding: 8px;
}

.acp-user.open .acp-user-menu {
    display: grid;
}

.acp-user-menu a,
.acp-user-menu button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    padding: 0 10px;
    font: inherit;
    text-align: left;
}

.acp-user-menu a:hover,
.acp-user-menu button:hover {
    background: var(--panel-soft);
}

.acp-content {
    width: min(1180px, 100%);
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 22px;
}

.acp-kicker {
    color: var(--cyan);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}

.acp-kicker {
    margin: 0;
}

.acp-card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    padding: 18px;
}

.acp-card h2 {
    max-width: 100%;
    margin: 0 0 8px;
    font-size: var(--acs-fs-section);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.acp-card p {
    color: var(--muted);
}

.acp-muted {
    color: var(--muted);
}

.acp-span-2 {
    grid-column: span 2;
}

.acp-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.acp-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 9px;
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}

.acp-pill.is-ok {
    color: var(--success);
    background: rgba(84, 211, 143, 0.14);
}

.acp-pill.is-warning {
    color: #ffd166;
    background: rgba(255, 209, 102, 0.14);
}

.acp-pill.is-error {
    color: #ff7b8a;
    background: rgba(255, 123, 138, 0.14);
}

.acp-pill.is-info {
    color: var(--cyan);
    background: rgba(66, 200, 255, 0.12);
}

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

.acp-metric-grid div {
    min-width: 0;
    min-height: 58px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 10px;
}

.acp-metric-grid span,
.acp-activity-list span,
.acp-empty-state span {
    display: block;
    color: var(--muted);
    font-size: var(--acs-fs-xs);
}

.acp-metric-grid strong {
    display: block;
    margin-top: 4px;
    font-size: var(--acs-fs);
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acp-report-card {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.acp-widget-controls {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

/* Stage 1.3 (E1.3-T13g): in edit mode a widget's controls are a bar of their own at its top (laid over it, they hid
   its title and, on a narrow widget, its content): the handle, then the buttons, wrapping on a narrow widget. */
.dashboard-edit-mode .acp-widget-controls {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin: 0 0 8px;
    pointer-events: auto;
}

.acp-widget-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 108, 108, 0.38);
    border-radius: 999px;
    background: rgba(96, 24, 36, 0.94);
    color: #ffd6d6;
    padding: 0;
    font: inherit;
    font-size: var(--acs-fs-title);
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

.dashboard-edit-mode [data-dashboard-widget] {
    position: relative;
    outline: 1px dashed rgba(66, 200, 255, 0.48);
    outline-offset: 3px;
    cursor: grab;
}

/* Stage 1.3 (E1.3-T13g): on a touch screen only the handle drags (the whole widget kept the page from scrolling);
   the buttons move and resize from the keyboard and on a phone; a placed widget's button leaves the library. */
.acp-widget-handle {
    margin-right: auto;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    font-weight: 600;
    letter-spacing: -2px;
}

/* The buttons are items of the bar itself: one row on a wide widget, two on a narrow one. */
.acp-widget-buttons {
    display: contents;
}

.acp-widget-buttons button {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 0 6px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.acp-widget-buttons .acp-widget-remove {
    position: static;
}

.acp-widget-library button[hidden] {
    display: none !important;
}

.dashboard-edit-mode [data-dashboard-widget] * {
    user-select: none;
}

.dashboard-edit-mode [data-dashboard-widget].dragging {
    opacity: 0.92;
    outline-color: rgba(84, 211, 143, 0.72);
    cursor: grabbing;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.dashboard-edit-mode [data-dashboard-widget].resizing {
    outline-color: rgba(84, 211, 143, 0.82);
}

.acp-widget-placeholder {
    min-height: 112px;
    border: 1px dashed rgba(66, 200, 255, 0.46);
    border-radius: 12px;
    background: rgba(47, 128, 237, 0.08);
}

.widget-hidden {
    display: none !important;
}

.dashboard-edit-mode .widget-hidden {
    display: none !important;
}

.acp-activity-list {
    display: grid;
    gap: 10px;
}

.acp-activity-list div,
.acp-empty-state {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 10px;
    align-items: center;
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 11px 12px;
}

.acp-activity-list span,
.acp-empty-state span {
    grid-column: 2;
}

.acp-empty-state {
    grid-template-columns: minmax(0, 1fr);
    min-height: 96px;
    place-items: center start;
}

.acp-empty-state span {
    grid-column: 1;
}

.acp-secondary-link {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    padding: 11px 14px;
    font-weight: 600;
}

.acp-primary-link,
.acp-form-actions button,
.acp-filter-bar button,
[data-confirm-action] button {
    min-height: var(--acs-btn-h);
    border: 1px solid rgba(66, 200, 255, 0.45);
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    padding: 0 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.acp-alert {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 600;
}

.acp-alert.success {
    color: var(--success);
    background: rgba(84, 211, 143, 0.1);
}

.acp-alert.error {
    color: #ff8f9b;
    background: rgba(255, 123, 138, 0.1);
}

.acp-filter-bar,
.acp-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.acp-filter-bar label,
.acp-form-grid label {
    display: grid;
    gap: 7px;
}

.acp-filter-bar span,
.acp-form-grid span,
.acp-role-box legend {
    color: var(--muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}

.acp-filter-bar input,
.acp-filter-bar select,
.acp-form-grid input,
.acp-form-grid select,
[data-confirm-action] select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 0 12px;
    font: inherit;
}

/* Stage 1.3 (E1.3-V25): a checkbox or a radio keeps its own size in a form (the rules of the fields sized it like a text
   field: the API token's scopes were large empty boxes, each alone above its name). A toggle row sets its own, later. */
.acp-filter-bar input[type="checkbox"],
.acp-filter-bar input[type="radio"],
.acp-form-grid input[type="checkbox"],
.acp-form-grid input[type="radio"] {
    width: auto;
    min-height: 0;
    padding: 0;
}

.acp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.acp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.acp-table th,
.acp-table td {
    border-bottom: 1px solid var(--border);
    padding: 13px 12px;
    text-align: left;
    vertical-align: top;
}

.acp-table th {
    color: var(--muted);
    background: var(--panel-soft);
    font-size: var(--acs-fs-xs);
    text-transform: uppercase;
}

.acp-table tr:last-child td {
    border-bottom: 0;
}

.acp-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acp-row-actions a,
.acp-pagination a,
.acp-form-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel-soft);
    padding: 0 10px;
    font-weight: 600;
}

.acp-mini-badge,
.acp-chip-list span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(66, 200, 255, 0.1);
    padding: 0 8px;
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}

.acp-pagination,
.acp-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.acp-role-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.acp-check-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    padding: 0 10px;
}

.acp-user-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.acp-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

[data-confirm-action] {
    display: grid;
    gap: 10px;
}

.acp-permission-form,
.acp-permission-sections {
    display: grid;
    gap: 14px;
}

.acp-permission-group {
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(66, 200, 255, 0.04);
    padding: 14px;
}

.acp-permission-group legend,
.acp-permission-group h3 {
    color: var(--cyan);
    font-weight: 600;
}

.acp-permission-group .acp-check-row {
    align-items: flex-start;
}

.acp-permission-group small {
    display: block;
    color: var(--muted);
    font-size: var(--acs-fs-xs);
}

.acp-permission-form button {
    justify-self: start;
}

.acp-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.acp-settings-card {
    min-height: 112px;
    display: grid;
    align-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
    padding: 16px;
}

.acp-settings-card:hover {
    border-color: rgba(66, 200, 255, 0.55);
}

.acp-settings-card strong {
    font-size: var(--acs-fs-title);
}

.acp-settings-card span {
    color: var(--muted);
}

.acp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.acp-tabs a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    padding: 0 12px;
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}

.acp-tabs a.active {
    color: #ffffff;
    border-color: rgba(66, 200, 255, 0.55);
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.settings-form label small,
.acp-toggle-row small {
    color: var(--muted);
    font-size: var(--acs-fs-xs);
}

.acp-toggle-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 78px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 12px;
}

.acp-toggle-row span {
    grid-column: 1 / -1;
}

.acp-toggle-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
}

.acp-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    color: var(--muted);
    /* (Stage 1.16e, round 6: the scale's secondary text, not the browser's 16.) */
    font-size: var(--acs-fs-sm);
    padding: 16px 28px;
}

@media (max-width: 980px) {
    .acp-shell {
        grid-template-columns: 1fr;
    }

    /* Stage 1.3 (E1.3-T13h): the open menu stays above the action bars (they covered it, z-index 30 to 60), over a
       dimmed page that closes it when touched. */
    .acp-sidebar {
        position: fixed;
        z-index: var(--ace-z-fixed, 1200);
        width: 282px;
        transform: translateX(-100%);
    }

    .acp-shell.sidebar-open .acp-sidebar {
        transform: translateX(0);
    }

    .acp-shell.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: calc(var(--ace-z-fixed, 1200) - 1);
        background: rgba(2, 6, 23, 0.55);
    }

    .acp-shell.sidebar-collapsed {
        --sidebar-width: 282px;
    }

    .sidebar-collapsed .acp-brand div:not(.acp-logo-mark),
    .sidebar-collapsed .acp-nav a span:last-child {
        display: block;
    }

    .acp-header {
        flex-wrap: wrap;
    }

    .acp-span-2 {
        grid-column: span 2;
    }

    .acp-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acp-filter-bar,
    .acp-form-grid,
    .acp-user-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phase 3 #8E: global compact spacing polish for ACPanel management screens. */
.acp-content {
    gap: 12px;
    padding: 18px 20px;
}

.acp-card p {
    font-size: var(--acs-fs-sm);
    line-height: 1.45;
}

.acp-card {
    border-radius: 12px;
    padding: 14px;
}

.acp-card h2 {
    margin-bottom: 8px;
    font-size: var(--acs-fs-title);
}

.acp-card-head {
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.acp-filter-bar,
.acp-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.acp-filter-bar label,
.acp-form-grid label,
.acp-sidebar-builder label {
    gap: 5px;
}

.acp-filter-bar span,
.acp-form-grid span,
.acp-role-box legend,
.acp-sidebar-builder label {
    font-size: var(--acs-fs-xs);
}

.acp-filter-bar input,
.acp-filter-bar select,
.acp-form-grid input,
.acp-form-grid select,
.acp-form-grid textarea,
[data-confirm-action] select,
.acp-sidebar-builder input[type="text"],
.acp-sidebar-builder select {
    min-height: 40px;
    border-radius: 9px;
    padding: 0 10px;
    font-size: var(--acs-fs-sm);
}

.acp-form-grid textarea {
    min-height: 112px;
    padding-top: 10px;
    resize: vertical;
}

.acp-primary-link,
.acp-secondary-link,
.acp-form-actions button,
.acp-filter-bar button,
[data-confirm-action] button,
.acp-row-actions a,
.acp-pagination a,
.acp-form-actions a,
.acp-dashboard-manager button,
.acp-widget-library button,
.acp-sidebar-manager button,
.acp-sidebar-manager .acp-primary-link {
    min-height: 34px;
    border-radius: 9px;
    padding: 0 10px;
    font-size: var(--acs-fs-xs);
}

.acp-form-actions,
.acp-pagination {
    gap: 8px;
    margin-top: 12px;
}

.acp-table th,
.acp-table td {
    padding: 9px 10px;
    font-size: var(--acs-fs-sm);
}

.acp-table th {
    font-size: var(--acs-fs-xs);
    letter-spacing: 0;
}

.acp-mini-badge,
.acp-chip-list span,
.acp-pill {
    min-height: 22px;
    padding: 0 7px;
    font-size: var(--acs-fs-xs);
}

.acp-alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: var(--acs-fs-sm);
}

.acp-tabs {
    gap: 6px;
    margin-bottom: 12px;
}

.acp-tabs a {
    min-height: 32px;
    border-radius: 9px;
    padding: 0 10px;
    font-size: var(--acs-fs-xs);
}

.acp-settings-grid {
    gap: 10px;
}

.acp-settings-card {
    min-height: 86px;
    border-radius: 12px;
    padding: 12px;
}

.acp-settings-card strong {
    font-size: var(--acs-fs);
}

.acp-settings-card span {
    font-size: var(--acs-fs-xs);
    line-height: 1.35;
}

.acp-role-box,
.acp-permission-group,
.acp-sidebar-builder-group,
.acp-sidebar-builder-item {
    border-radius: 12px;
    padding: 10px;
}

.acp-role-box,
.acp-permission-form,
.acp-permission-sections,
.acp-sidebar-builder,
.acp-sidebar-manager {
    gap: 10px;
}

.acp-check-row {
    min-height: 36px;
    border-radius: 9px;
    padding: 0 9px;
    font-size: var(--acs-fs-sm);
}

.acp-user-grid {
    gap: 10px;
}

.acp-metric-grid {
    gap: 7px;
}

.acp-metric-grid div {
    min-height: 52px;
    border-radius: 10px;
    padding: 8px;
}

.acp-row-actions {
    gap: 6px;
}

.acp-header {
    min-height: 58px;
    padding: 9px 14px;
}

.acp-header-actions {
    gap: 6px;
}

.acp-search input,
.acp-icon-button,
.acp-header-button,
.acp-select,
.acp-user-button,
.inline-form button {
    min-height: 34px;
}

.acp-user-menu {
    width: 220px;
}

.acp-user-menu a,
.acp-user-menu button {
    min-height: 34px;
    font-size: var(--acs-fs-sm);
}

.acp-dashboard-layout {
    gap: 14px;
}

.acp-dashboard-main,
.acp-dashboard-aside,
.acp-bottom-widget-zone {
    gap: 14px;
}

.acp-stat-row {
    gap: 10px;
}

.acp-stat-card {
    min-height: 98px;
    padding: 15px 14px;
}

.acp-report-grid {
    gap: 14px;
}

.acp-report-card {
    min-height: 272px;
    padding: 18px;
}

.acp-side-card {
    padding: 16px;
}

.acp-status-table div {
    min-height: 40px;
}

.acp-quick-grid {
    gap: 8px;
}

.acp-quick-grid a {
    min-height: 66px;
    border-radius: 8px;
    font-size: var(--acs-fs-xs);
}

@media (max-width: 980px) {
    .acp-content {
        padding: 16px;
    }

    .acp-filter-bar,
    .acp-form-grid,
    .acp-role-box,
    .acp-user-grid,
    .acp-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .acp-content {
        padding: 18px;
    }

    .acp-span-2,
    .acp-metric-grid,
    .acp-filter-bar,
    .acp-form-grid,
    .acp-role-box,
    .acp-user-grid,
    .acp-settings-grid {
        grid-template-columns: 1fr;
    }

    .acp-span-2 {
        grid-column: span 1;
    }

    .acp-search {
        min-width: 100%;
    }

    .acp-header-button,
    .acp-select {
        display: none;
    }
}

/* ACE-UI-FIX-02 final approved reference lock. */
body[data-ace-theme-scope="acpanel"]:not([data-theme="light"]),
body[data-theme="dark"][data-ace-theme-scope="acpanel"] {
    background:
        radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.12), transparent 28%),
        radial-gradient(circle at 84% 10%, rgba(139, 92, 246, 0.1), transparent 30%),
        linear-gradient(145deg, #0b1220, #0f172a 56%, #0b1220);
}

.acp-card,
.acp-stat-card,
.acp-report-card,
.acp-side-card,
.acp-dashboard-manager,
.acp-widget-library,
.acp-table-wrap {
    border-color: rgba(148, 163, 184, 0.16);
    border-radius: 10px;
}

.acp-primary-link,
.acp-form-actions button,
.acp-filter-bar button,
[data-confirm-action] button,
.acp-header-button,
.acp-icon-button,
.acp-user-button,
.acp-bell-button,
.acp-row-actions a,
.acp-pagination a,
.acp-form-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

/* Phase 3 #8A-2 final ACPanel polish: WHMCS/SaaS-style dashboard surface. */
:root {
    --bg: #050d18;
    --bg-soft: #08172a;
    --panel: rgba(13, 27, 47, 0.94);
    --panel-soft: rgba(18, 36, 61, 0.9);
    --panel-deep: rgba(7, 18, 34, 0.96);
    --border: rgba(127, 169, 221, 0.16);
    --text: #f6f9ff;
    --muted: #9aaec7;
    --cyan: #3fbfff;
    --blue: #2e7ff0;
    --success: #48df78;
    --warning: #ffd166;
    --danger: #ff6f87;
    --sidebar-width: 270px;
}

body {
    background:
        radial-gradient(circle at 20% 8%, rgba(47, 128, 237, 0.18), transparent 28%),
        radial-gradient(circle at 78% 18%, rgba(63, 191, 255, 0.09), transparent 30%),
        linear-gradient(145deg, #050b15, #081525 54%, #050a13);
}

body[data-theme="light"] {
    --panel: rgba(247, 250, 255, 0.98);
    --panel-soft: rgba(232, 241, 252, 0.96);
    --panel-deep: rgba(255, 255, 255, 0.96);
    --border: rgba(75, 109, 151, 0.22);
    --text: #0a1524;
    --muted: #5c6f86;
    background:
        radial-gradient(circle at 20% 8%, rgba(47, 128, 237, 0.13), transparent 28%),
        linear-gradient(145deg, #eef6ff, #f7fbff);
}

.acp-sidebar {
    padding: 14px;
    background: linear-gradient(180deg, rgba(7, 18, 34, 0.98), rgba(6, 16, 30, 0.96));
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .acp-sidebar {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(238, 246, 255, 0.96));
}

.acp-brand {
    min-height: 60px;
    padding: 4px 8px 18px;
}

.acp-logo-mark {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}

.acp-logo-mark::before,
.acp-logo-mark span {
    content: "";
    position: absolute;
    border-radius: 11px;
    background: linear-gradient(135deg, #36b7ff, #2d6df6);
    box-shadow: 0 12px 28px rgba(47, 128, 237, 0.28);
}

.acp-logo-mark::before {
    width: 13px;
    height: 34px;
    left: 6px;
    top: 4px;
    transform: rotate(42deg);
}

.acp-logo-mark span:first-child {
    width: 13px;
    height: 34px;
    left: 18px;
    top: 4px;
    transform: rotate(-42deg);
}

.acp-logo-mark span:last-child {
    width: 12px;
    height: 24px;
    left: 23px;
    top: 12px;
    transform: rotate(42deg);
    opacity: 0.72;
}

.sidebar-collapsed .acp-brand div:not(.acp-logo-mark),
.sidebar-collapsed .acp-collapse-hint,
.sidebar-collapsed .acp-nav a span:last-child,
.sidebar-collapsed .acp-nav-group-toggle span:nth-child(2),
.sidebar-collapsed .acp-nav-chevron {
    display: none;
}

.acp-svg-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: currentColor;
}

.acp-svg-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.acp-svg-icon.nav {
    width: 26px;
    height: 26px;
    color: #a7c3e6;
}

.acp-svg-icon.nav.mini {
    width: 18px;
    height: 18px;
    color: #b7c8dc;
}

.acp-svg-icon.stat {
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 999px;
    color: #2f8fff;
    background: radial-gradient(circle, rgba(47, 128, 237, 0.26), rgba(47, 128, 237, 0.08));
}

.acp-stat-card.success .acp-svg-icon.stat {
    color: var(--success);
    background: radial-gradient(circle, rgba(72, 223, 120, 0.24), rgba(72, 223, 120, 0.08));
}

.acp-svg-icon.button {
    width: 16px;
    height: 16px;
}

.acp-svg-icon.tiny {
    width: 15px;
    height: 15px;
}

.acp-svg-icon.soft {
    color: #8fb5df;
}

.acp-nav {
    gap: 6px;
}

.acp-nav-group {
    gap: 2px;
}

.acp-nav-group-toggle {
    min-height: 30px;
    padding: 0 6px;
    color: #8da4c0;
    font-size: var(--acs-fs-xs);
    letter-spacing: 0;
    text-transform: uppercase;
    background: transparent;
}

.acp-nav-group-toggle:hover,
.acp-nav-group.active > .acp-nav-group-toggle {
    color: #c7d8ed;
    border-color: transparent;
    background: transparent;
}

.acp-nav-submenu {
    padding: 2px 0 10px;
}

.acp-nav a {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    color: #c6d5e8;
    font-size: var(--acs-fs);
    font-weight: 600;
}

.acp-nav a:hover,
.acp-nav a.active,
.acp-nav-single:hover,
.acp-nav-single.active {
    border-color: rgba(47, 128, 237, 0.28);
    background: linear-gradient(135deg, rgba(47, 128, 237, 0.36), rgba(47, 128, 237, 0.18));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(92, 171, 255, 0.08);
}

.acp-nav a.active .acp-svg-icon {
    color: #dcecff;
}

.acp-nav-single.active .acp-svg-icon {
    color: #dcecff;
}

.acp-nav-chevron {
    color: #8ca6c5;
    font-size: var(--acs-fs);
}

.acp-collapse-hint {
    position: sticky;
    bottom: 0;
    width: 100%;
    min-height: 44px;
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: #d8e6f6;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.acp-header {
    min-height: 64px;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(6, 16, 30, 0.82);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.acp-icon-button,
.acp-header-button,
.acp-select,
.acp-user-button,
.inline-form button {
    min-height: 38px;
    border-radius: 9px;
    background: rgba(16, 33, 57, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.acp-icon-button {
    width: 42px;
    padding: 0;
}

.acp-header-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.acp-search {
    max-width: 360px;
    min-width: 230px;
    flex: 1 1 300px;
    border-radius: 10px;
    background: rgba(15, 31, 54, 0.88);
}

.acp-search input {
    min-height: 38px;
}

.acp-search kbd {
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 7px;
    font: inherit;
    font-size: var(--acs-fs-xs);
    white-space: nowrap;
}

.acp-bell-button {
    width: 44px;
    height: 38px;
    background: rgba(16, 33, 57, 0.86);
}

.acp-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 999px;
}

.acp-user-button {
    min-width: 146px;
    padding: 0 10px 0 2px;
}

.acp-user-copy {
    display: grid;
    text-align: left;
    line-height: 1.1;
}

.acp-user-copy small {
    color: var(--muted);
    font-size: var(--acs-fs-xs);
    font-weight: 400;
}

.acp-content {
    width: min(1500px, 100%);
    gap: 14px;
    padding: 24px;
}

.acp-card {
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(16, 31, 53, 0.96), rgba(12, 25, 44, 0.94));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .acp-card,
body[data-theme="light"] .acp-header-button,
body[data-theme="light"] .acp-icon-button,
body[data-theme="light"] .acp-select,
body[data-theme="light"] .acp-search,
body[data-theme="light"] .acp-user-button,
body[data-theme="light"] .acp-bell-button {
    background: rgba(250, 253, 255, 0.92);
}

.acp-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.acp-dashboard-manager {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(63, 191, 255, 0.24);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(18, 36, 61, 0.94), rgba(10, 25, 44, 0.94));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
    padding: 14px;
}

.acp-dashboard-manager[hidden],
.acp-widget-library[hidden] {
    display: none !important;
}

.acp-dashboard-manager strong,
.acp-dashboard-manager span {
    display: block;
}

.acp-dashboard-manager span,
.acp-widget-save-status {
    color: var(--muted);
    font-size: var(--acs-fs-sm);
}

.acp-dashboard-manager-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.acp-dashboard-manager button,
.acp-widget-library button {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 0 10px;
    font: inherit;
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    cursor: pointer;
}

.acp-dashboard-manager button:hover,
.acp-widget-library button:hover {
    border-color: rgba(63, 191, 255, 0.45);
    background: rgba(47, 128, 237, 0.2);
}

.acp-widget-library {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.acp-widget-library button {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 5px;
    text-align: left;
}

.acp-widget-library span,
.acp-widget-library small {
    min-width: 0;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.acp-widget-save-status {
    grid-column: 1 / -1;
    margin: 0;
}

.acp-widget-save-status.error {
    color: var(--danger);
}

.acp-dashboard-main,
.acp-dashboard-aside {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.acp-bottom-widget-zone {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.acp-stat-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.acp-stat-row,
.acp-report-grid,
.acp-dashboard-aside,
.acp-bottom-widget-zone {
    grid-auto-flow: dense;
}

.widget-size-wide {
    grid-column: span 2;
}

.widget-size-full {
    grid-column: 1 / -1;
}

.acp-dashboard-aside .widget-size-wide,
.acp-dashboard-aside .widget-size-full,
.acp-stat-row .widget-size-wide,
.acp-stat-row .widget-size-full {
    grid-column: auto;
}

.acp-stat-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 108px;
    padding: 18px 16px;
}

.acp-stat-card span,
.acp-stat-card small {
    display: block;
    min-width: 0;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acp-stat-card strong {
    display: block;
    max-width: 100%;
    margin: 6px 0;
    color: #ffffff;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

body[data-theme="light"] .acp-stat-card strong {
    color: var(--text);
}

.acp-stat-card small {
    color: var(--success);
    font-size: var(--acs-fs-xs);
}

.acp-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.acp-report-card {
    min-height: 294px;
    padding: 20px;
}

.dashboard-edit-mode [data-widget-zone] {
    border-radius: 14px;
    outline: 1px solid rgba(66, 200, 255, 0.08);
    outline-offset: 6px;
}

.acp-report-card h2,
.acp-side-card h2 {
    margin: 0 0 18px;
    font-size: var(--acs-fs-title);
}

.acp-status-table {
    display: grid;
}

.acp-status-table div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(82px, auto) auto;
    gap: 12px;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid rgba(127, 169, 221, 0.12);
}

.acp-status-table div:last-child {
    border-bottom: 0;
}

.acp-status-table span,
.acp-status-table strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acp-status-table span {
    color: #d7e4f3;
    font-weight: 600;
}

.acp-status-table strong {
    color: var(--muted);
    font-size: var(--acs-fs);
    font-weight: 600;
    text-align: right;
}

.acp-status-table .acp-pill {
    min-width: 42px;
    justify-content: center;
    border-radius: 7px;
    font-style: normal;
}

.acp-disk-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 18px;
    align-items: center;
}

.acp-disk-percent {
    display: block;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1;
}

.acp-disk-card span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: var(--acs-fs-title);
}

.acp-donut {
    width: 146px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(var(--blue) calc(var(--value) * 1%), #33455f 0);
    position: relative;
    box-shadow: 0 0 28px rgba(47, 128, 237, 0.12);
}

.acp-donut::after {
    content: "";
    position: absolute;
    inset: 30px;
    border-radius: inherit;
    background: #0d1c30;
}

body[data-theme="light"] .acp-donut::after {
    background: #f7fbff;
}

.acp-disk-legend {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.acp-disk-legend div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.acp-disk-legend span,
.acp-disk-legend strong {
    min-width: 0;
}

.acp-legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 99px;
}

.acp-legend-dot.used { background: #2f8fff; }
.acp-legend-dot.free { background: #4a9af8; }
.acp-legend-dot.total { background: #5d6f88; }

.acp-dashboard-aside {
    gap: 14px;
}

.acp-side-card {
    padding: 18px;
}

.acp-lock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success) !important;
    font-size: var(--acs-fs-title);
}

.acp-secondary-link.block {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.acp-activity-list.preview {
    gap: 0;
}

.acp-activity-list.preview div {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 40px;
    border: 0;
    border-bottom: 1px solid rgba(127, 169, 221, 0.11);
    border-radius: 0;
    background: transparent;
    padding: 8px 0;
}

.acp-activity-list.preview div:last-child {
    border-bottom: 0;
}

.acp-activity-list.preview strong,
.acp-activity-list.preview span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acp-activity-list.preview span {
    grid-column: auto;
    text-align: right;
}

.acp-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.acp-quick-grid a {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 74px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(23, 43, 70, 0.78);
    color: #f4f8ff;
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    text-align: center;
    padding: 10px 6px;
}

.acp-quick-grid a:hover {
    border-color: rgba(63, 191, 255, 0.45);
    background: rgba(47, 128, 237, 0.22);
}

.acp-sidebar-manager {
    display: grid;
    gap: 18px;
}

.acp-sidebar-manager .acp-card-head {
    align-items: flex-start;
    gap: 16px;
}

.acp-sidebar-manager .acp-row-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.acp-sidebar-manager .acp-row-actions form {
    margin: 0;
}

.acp-sidebar-manager button,
.acp-sidebar-manager .acp-primary-link {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(23, 43, 70, 0.9);
    color: var(--text);
    padding: 0 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.acp-sidebar-manager .acp-primary-link {
    border-color: rgba(47, 143, 255, 0.5);
    background: linear-gradient(135deg, #1f6ed8, #2f8fff);
    color: #ffffff;
}

.acp-sidebar-builder {
    display: grid;
    gap: 14px;
}

.acp-sidebar-builder-group {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(127, 169, 221, 0.16);
    border-radius: 14px;
    background: rgba(7, 18, 34, 0.48);
    padding: 14px;
}

.acp-sidebar-builder-head,
.acp-sidebar-builder-item {
    display: grid;
    grid-template-columns: auto minmax(180px, 1.2fr) minmax(140px, 0.6fr) auto;
    align-items: end;
    gap: 12px;
}

.acp-sidebar-builder-items {
    display: grid;
    gap: 10px;
    padding-left: 28px;
}

.acp-sidebar-builder-item {
    border: 1px solid rgba(127, 169, 221, 0.12);
    border-radius: 12px;
    background: rgba(15, 31, 53, 0.72);
    padding: 10px;
}

.acp-sidebar-builder label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    min-width: 0;
}

.acp-sidebar-builder input[type="text"],
.acp-sidebar-builder select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(7, 18, 34, 0.72);
    color: var(--text);
    padding: 0 10px;
    font: inherit;
}

body[data-theme="light"] .acp-sidebar-builder input[type="text"],
body[data-theme="light"] .acp-sidebar-builder select,
body[data-theme="light"] .acp-sidebar-manager button {
    background: rgba(246, 250, 255, 0.94);
}

.acp-check-row {
    display: inline-flex !important;
    grid-auto-flow: column;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    gap: 8px !important;
    min-height: 38px;
    white-space: nowrap;
}

.acp-drag-handle {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 38px;
    border: 1px solid rgba(127, 169, 221, 0.16);
    border-radius: 10px;
    color: var(--cyan);
    background: rgba(66, 200, 255, 0.08);
    cursor: grab;
    font-weight: 600;
    letter-spacing: -2px;
}

.acp-sidebar-builder-item small {
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: center;
}

.acp-sidebar-builder-group.dragging,
.acp-sidebar-builder-item.dragging {
    opacity: 0.52;
    outline: 2px dashed rgba(66, 200, 255, 0.6);
}

.acp-footer {
    border-top-color: rgba(127, 169, 221, 0.12);
    padding: 18px 24px;
}

@media (max-width: 1280px) {
    .acp-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .acp-dashboard-aside {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .acp-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .acp-report-grid,
    .acp-dashboard-aside {
        grid-template-columns: 1fr;
    }

    .acp-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acp-dashboard-manager,
    .acp-widget-library {
        grid-template-columns: 1fr;
    }

    .acp-dashboard-manager-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .acp-content {
        padding: 18px;
    }

    .acp-stat-row,
    .acp-report-grid,
    .acp-dashboard-aside,
    .acp-disk-card,
    .acp-quick-grid {
        grid-template-columns: 1fr;
    }

    .acp-stat-card,
    .acp-report-card,
    .acp-side-card {
        padding: 16px;
    }

    .acp-donut {
        width: 132px;
        margin: 0 auto;
    }

    .acp-status-table div,
    .acp-activity-list.preview div {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .acp-status-table em {
        grid-column: 2;
    }

    .acp-user-copy,
    .acp-search kbd {
        display: none;
    }

    .acp-sidebar-builder-head,
    .acp-sidebar-builder-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: stretch;
    }

    .acp-sidebar-builder-head label,
    .acp-sidebar-builder-item label,
    .acp-sidebar-builder-item small {
        grid-column: 2;
    }

    .acp-sidebar-builder-items {
        padding-left: 0;
    }
}

/* Phase 3 #8D addendum: clean sidebar, reliable icon-only collapse and full-width content. */
.acp-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    width: 100%;
    overflow: visible;
}

.acp-shell.sidebar-collapsed {
    --sidebar-width: 84px;
}

.acp-main,
.acp-header,
.acp-content {
    width: 100%;
    max-width: none;
}

.acp-content {
    justify-self: stretch;
}

.acp-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.acp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 220px;
}

.acp-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
}

.acp-header-left .acp-search {
    flex: 1 1 360px;
    max-width: 520px;
}

.sidebar-collapsed .acp-sidebar {
    overflow: visible;
    padding-inline: 10px;
    z-index: 3000;
}

.sidebar-collapsed .acp-brand {
    justify-content: center;
    padding-inline: 0;
}

.sidebar-collapsed .acp-brand div:not(.acp-logo-mark),
.sidebar-collapsed .acp-nav-single span:last-child,
.sidebar-collapsed .acp-nav-group-toggle span:nth-child(2),
.sidebar-collapsed .acp-nav-chevron {
    display: none !important;
}

.sidebar-collapsed .acp-nav {
    gap: 8px;
}

.sidebar-collapsed .acp-nav-single,
.sidebar-collapsed .acp-nav-group-toggle {
    justify-content: center;
    min-height: 44px;
    padding: 0;
}

.sidebar-collapsed .acp-nav-group {
    position: relative;
}

/* Stage 1.3 (E1.3-T15f): only the group under the pointer or the keyboard opens its flyout. Every group is "open" (the
   expanded menu's state), so the flyouts of all of them stood one over another on the page as soon as the menu folded. */
.sidebar-collapsed .acp-nav-group:hover .acp-nav-submenu,
.sidebar-collapsed .acp-nav-group:focus-within .acp-nav-submenu {
    position: fixed;
    top: 96px;
    left: calc(var(--sidebar-width) + 12px);
    z-index: 5000;
    display: grid !important;
    width: 238px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(8, 20, 36, 0.98);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    padding: 8px;
}

/* Stage 1.3 (E1.3-T15f): the collapsed sidebar's flyout keeps the sidebar's dark panel in both themes (in the light
   theme it turned near-white while its links kept the sidebar's pale text: 1.5:1). */

/* Phase 3 #8F Pages Manager polish */

/* Phase 3 #8F-2 Pages Manager UI + Trash polish */

.is-trash-row {
    opacity: 0.92;
}

.sidebar-collapsed .acp-nav-submenu a,
.sidebar-collapsed .acp-nav-submenu .acp-nav-empty {
    justify-content: flex-start;
    min-height: 36px;
    padding: 0 10px;
}

.sidebar-collapsed .acp-nav-submenu a span:last-child,
.sidebar-collapsed .acp-nav-submenu .acp-nav-empty {
    display: inline-flex !important;
}

.sidebar-collapsed .acp-collapse-hint {
    display: grid !important;
    place-items: center;
    min-height: 42px;
    padding: 0;
    font-size: 0;
}

.sidebar-collapsed .acp-collapse-hint::before {
    content: "»";
    color: var(--cyan);
    font-size: var(--acs-fs-section);
    line-height: 1;
}

@media (min-width: 981px) {
    .sidebar-collapsed .acp-collapse-hint::before {
        content: ">>";
    }
}

@media (max-width: 980px) {
    .acp-shell,
    .acp-shell.sidebar-collapsed {
        --sidebar-width: 282px;
        grid-template-columns: 1fr;
    }

    .sidebar-collapsed .acp-sidebar {
        overflow-y: auto;
        padding: 14px;
    }

    .sidebar-collapsed .acp-brand {
        justify-content: flex-start;
    }

    .sidebar-collapsed .acp-brand div:not(.acp-logo-mark),
    .sidebar-collapsed .acp-nav-single span:last-child,
    .sidebar-collapsed .acp-nav-group-toggle span:nth-child(2),
    .sidebar-collapsed .acp-nav-chevron {
        display: inline-flex !important;
    }

    .sidebar-collapsed .acp-nav-single,
    .sidebar-collapsed .acp-nav-group-toggle {
        justify-content: flex-start;
        padding: 0 10px;
    }

    /* Stage 1.3 (E1.3-T15f): on a phone a folded menu from the desktop still shows its open groups inline. */
    .sidebar-collapsed .acp-nav-group.open .acp-nav-submenu,
    .sidebar-collapsed .acp-nav-group:hover .acp-nav-submenu,
    .sidebar-collapsed .acp-nav-group:focus-within .acp-nav-submenu {
        display: grid !important;
        position: static;
        width: auto;
        max-height: none;
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 2px 0 10px;
    }

    .sidebar-collapsed .acp-collapse-hint {
        display: grid !important;
        font-size: var(--acs-fs);
    }

    .sidebar-collapsed .acp-collapse-hint::before {
        content: "";
        display: none;
    }

    .acp-header {
        align-items: flex-start;
    }

    .acp-header-left,
    .acp-header-actions {
        width: 100%;
    }

    .acp-header-actions {
        justify-content: flex-start;
        margin-left: 0;
    }
}

/* ACE Core UI System Phase 5: ACPanel Dashboard Premium Polish. */
.acp-dashboard-layout {
    gap: var(--ace-space-8, 16px);
    align-items: start;
}

.acp-dashboard-main,
.acp-dashboard-aside,
.acp-bottom-widget-zone {
    gap: var(--ace-space-8, 16px);
    min-width: 0;
}

.acp-stat-row {
    gap: var(--ace-space-6, 12px);
    align-items: stretch;
}

.acp-stat-card,
.acp-report-card,
.acp-side-card {
    min-width: 0;
    overflow: hidden;
    border-radius: var(--ace-radius-lg, 10px);
    border-color: color-mix(in srgb, var(--border) 74%, transparent);
    box-shadow: var(--ace-shadow-sm, 0 6px 18px rgba(17, 28, 45, 0.08));
}

.acp-stat-card {
    align-items: center;
    min-height: 104px;
    height: 100%;
    padding: var(--ace-space-7, 14px);
}

.acp-stat-card > div {
    min-width: 0;
}

.acp-stat-card strong {
    font-size: clamp(21px, 2vw, 28px);
    line-height: 1.05;
    letter-spacing: 0;
}

.acp-stat-card span,
.acp-stat-card small,
.acp-report-card h2,
.acp-side-card h2,
.acp-muted,
.acp-lock-status,
.acp-secondary-link,
.acp-status-table span,
.acp-status-table strong,
.acp-activity-list.preview strong,
.acp-activity-list.preview span,
.acp-quick-grid span {
    overflow-wrap: anywhere;
}

.acp-report-grid {
    gap: var(--ace-space-8, 16px);
    align-items: stretch;
}

.acp-report-card {
    display: grid;
    align-content: start;
    gap: var(--ace-space-5, 10px);
    min-height: 268px;
    padding: var(--ace-space-8, 16px);
}

.acp-report-card h2,
.acp-side-card h2 {
    margin-bottom: var(--ace-space-3, 6px);
    font-size: var(--ace-font-size-lg, 16px);
    line-height: var(--ace-line-height-tight, 1.15);
}

.acp-status-table {
    gap: 0;
    border: 1px solid color-mix(in srgb, var(--border) 54%, transparent);
    border-radius: var(--ace-radius-md, 8px);
    overflow: hidden;
    background: color-mix(in srgb, var(--panel-soft) 74%, transparent);
}

.acp-status-table div {
    min-height: 38px;
    padding: var(--ace-space-5, 10px) var(--ace-space-6, 12px);
    background: transparent;
}

.acp-status-table span {
    color: var(--text);
    font-size: var(--ace-font-size-sm, 13px);
}

.acp-status-table strong {
    font-size: var(--ace-font-size-sm, 13px);
    white-space: nowrap;
}

.acp-status-table .acp-pill {
    min-height: 22px;
    padding-inline: var(--ace-space-5, 10px);
}

.acp-disk-card {
    align-items: center;
    gap: var(--ace-space-8, 16px);
    min-width: 0;
}

.acp-donut {
    width: clamp(116px, 9vw, 138px);
    max-width: 100%;
    flex: 0 0 auto;
}

.acp-disk-legend {
    display: grid;
    gap: var(--ace-space-4, 8px);
}

.acp-disk-legend div {
    min-width: 0;
}

.acp-dashboard-aside {
    align-content: start;
}

.acp-side-card {
    display: grid;
    gap: var(--ace-space-5, 10px);
    min-height: 0;
    padding: var(--ace-space-7, 14px);
}

.acp-side-card .acp-muted {
    margin: 0;
    font-size: var(--ace-font-size-xs, 12px);
    line-height: var(--ace-line-height-normal, 1.45);
}

.acp-lock-status {
    display: inline-flex;
    align-items: center;
    gap: var(--ace-space-4, 8px);
    width: fit-content;
    max-width: 100%;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--success) 32%, var(--border));
    border-radius: var(--ace-radius-pill, 999px);
    background: color-mix(in srgb, var(--success) 12%, transparent);
    padding: var(--ace-space-3, 6px) var(--ace-space-5, 10px);
}

.acp-activity-list.preview {
    border: 1px solid color-mix(in srgb, var(--border) 54%, transparent);
    border-radius: var(--ace-radius-md, 8px);
    overflow: hidden;
}

.acp-activity-list.preview div {
    min-height: 36px;
    padding: var(--ace-space-4, 8px) var(--ace-space-5, 10px);
    gap: var(--ace-space-4, 8px);
    background: color-mix(in srgb, var(--panel-soft) 56%, transparent);
}

.acp-activity-list.preview strong {
    font-size: var(--ace-font-size-xs, 12px);
}

.acp-activity-list.preview span {
    max-width: 118px;
    color: var(--muted);
    font-size: var(--ace-font-size-2xs, 11px);
    white-space: nowrap;
}

.acp-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ace-space-4, 8px);
}

.acp-quick-grid a {
    min-height: 56px;
    border-radius: var(--ace-radius-md, 8px);
    padding: var(--ace-space-5, 10px);
    background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
    transition: transform var(--ace-transition-fast, 120ms ease), border-color var(--ace-transition-fast, 120ms ease), background var(--ace-transition-fast, 120ms ease);
}

.acp-quick-grid a:hover {
    transform: translateY(-1px);
}

.acp-quick-grid .acp-svg-icon {
    width: var(--ace-icon-md, 20px);
    height: var(--ace-icon-md, 20px);
}

.acp-widget-save-status,
.acp-empty-state {
    border-radius: var(--ace-radius-md, 8px);
}

.acp-widget-save-status.error {
    color: var(--danger);
}

.acp-empty-state {
    border: 1px dashed color-mix(in srgb, var(--border) 82%, transparent);
    background: color-mix(in srgb, var(--panel-soft) 64%, transparent);
}

.acp-dashboard-manager,
.acp-widget-library {
    border-radius: var(--ace-radius-lg, 10px);
    box-shadow: var(--ace-shadow-xs, 0 1px 2px rgba(17, 28, 45, 0.08));
}

.dashboard-edit-mode [data-widget-zone] {
    min-width: 0;
}

.dashboard-edit-mode [data-dashboard-widget] {
    outline-offset: 3px;
}

body[data-theme="light"] .acp-stat-card,
body[data-theme="light"] .acp-report-card,
body[data-theme="light"] .acp-side-card {
    box-shadow: var(--ace-shadow-sm, 0 6px 18px rgba(17, 28, 45, 0.08));
}

body[data-theme="light"] .acp-status-table,
body[data-theme="light"] .acp-activity-list.preview,
body[data-theme="light"] .acp-quick-grid a,
body[data-theme="light"] .acp-empty-state {
    background: color-mix(in srgb, var(--panel-soft) 78%, #ffffff);
}

@media (max-width: 1400px) {
    .acp-dashboard-layout {
        grid-template-columns: minmax(0, 1fr) minmax(292px, 312px);
    }

    .acp-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .acp-report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .acp-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .acp-dashboard-aside {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .acp-dashboard-aside,
    .acp-report-grid {
        grid-template-columns: 1fr;
    }

    .acp-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .acp-dashboard-layout,
    .acp-dashboard-main,
    .acp-dashboard-aside,
    .acp-bottom-widget-zone,
    .acp-report-grid,
    .acp-stat-row,
    .acp-quick-grid {
        grid-template-columns: 1fr;
    }

    .acp-stat-card,
    .acp-report-card,
    .acp-side-card {
        padding: var(--ace-space-7, 14px);
    }

    .acp-disk-card {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .acp-activity-list.preview div {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .acp-activity-list.preview span {
        grid-column: 2;
        max-width: 100%;
        text-align: left;
    }
}

/* ACE Core UI System Phase 5B: approved-preview dark dashboard refinement. */
:root {
    --bg: #0b1220;
    --bg-soft: #0f172a;
    --panel: #151e2e;
    --panel-soft: #182235;
    --panel-deep: #111827;
    --border: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --subtle: #94a3b8;
    --cyan: #60a5fa;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body[data-theme="dark"],
body:not([data-theme="light"]) {
    background:
        radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.12), transparent 26%),
        radial-gradient(circle at 86% 12%, rgba(139, 92, 246, 0.1), transparent 28%),
        linear-gradient(145deg, #0b1220 0%, #0f172a 58%, #0b1220 100%);
}

.acp-sidebar {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.98));
    border-right-color: rgba(148, 163, 184, 0.14);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

.acp-brand,
.acp-collapse-hint {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.62);
}

.acp-nav-single,
.acp-nav-group-toggle,
.acp-nav-submenu a {
    color: #cbd5e1;
}

.acp-nav-single:hover,
.acp-nav-group-toggle:hover,
.acp-nav-submenu a:hover,
.acp-nav-single.active,
.acp-nav-submenu a.active,
.acp-nav-group.open > .acp-nav-group-toggle {
    background: rgba(59, 130, 246, 0.13);
    color: #f8fafc;
}

.acp-nav-single.active,
.acp-nav-submenu a.active {
    box-shadow: inset 3px 0 0 var(--blue);
}

.acp-main {
    min-width: 0;
    background: transparent;
}

.acp-header {
    min-height: 64px;
    border-bottom-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.86);
    backdrop-filter: blur(18px);
}

.acp-search,
.acp-header-button,
.acp-icon-button,
.acp-select,
.acp-user-button,
.acp-bell-button {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(21, 30, 46, 0.82);
    color: #e2e8f0;
    box-shadow: none;
}

.acp-header-button:hover,
.acp-icon-button:hover,
.acp-user-button:hover,
.acp-bell-button:hover {
    border-color: rgba(59, 130, 246, 0.36);
    background: #1d2a40;
}

.acp-content {
    padding: clamp(16px, 1.8vw, 24px);
}

.acp-muted,
.acp-card p {
    color: #94a3b8;
}

.acp-card,
.acp-dashboard-manager,
.acp-widget-library {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(24, 34, 53, 0.96), rgba(21, 30, 46, 0.96));
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.24);
}

.acp-card:hover {
    border-color: rgba(148, 163, 184, 0.22);
    background: linear-gradient(145deg, rgba(29, 42, 64, 0.96), rgba(21, 30, 46, 0.98));
}

.acp-dashboard-layout {
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 16px;
}

.acp-dashboard-main,
.acp-dashboard-aside,
.acp-bottom-widget-zone,
.acp-report-grid {
    gap: 16px;
}

.acp-stat-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.acp-stat-card {
    min-height: 96px;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(24, 34, 53, 0.98), rgba(17, 24, 39, 0.96));
}

.acp-stat-card .acp-svg-icon.stat {
    color: var(--blue);
    background: rgba(59, 130, 246, 0.13);
}

.acp-stat-card.success .acp-svg-icon.stat {
    color: var(--success);
    background: rgba(34, 197, 94, 0.13);
}

.acp-stat-card span {
    color: #94a3b8;
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}

.acp-stat-card strong {
    color: #f8fafc;
    font-size: clamp(22px, 1.7vw, 27px);
}

.acp-stat-card small {
    color: #22c55e;
}

.acp-report-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.acp-report-card {
    min-height: 252px;
    padding: 16px;
}

.acp-side-card {
    padding: 14px;
}

.acp-report-card h2,
.acp-side-card h2 {
    color: #f8fafc;
    font-size: var(--acs-fs);
    font-weight: 600;
}

.acp-status-table,
.acp-activity-list.preview {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.42);
}

.acp-status-table div,
.acp-activity-list.preview div {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

.acp-status-table span,
.acp-activity-list.preview strong {
    color: #e2e8f0;
}

.acp-status-table strong,
.acp-activity-list.preview span {
    color: #94a3b8;
}

.acp-mini-badge {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.28);
}

.acp-disk-card {
    min-height: 172px;
}

.acp-donut {
    width: clamp(108px, 8vw, 130px);
    background: conic-gradient(var(--blue) calc(var(--value) * 1%), rgba(148, 163, 184, 0.12) 0);
}

.acp-donut::after {
    background: #151e2e;
}

.acp-disk-legend div {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.42);
}

.acp-lock-status {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.11);
    color: #d1fae5;
}

.acp-secondary-link,
.acp-quick-grid a {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.44);
    color: #cbd5e1;
}

.acp-secondary-link:hover,
.acp-quick-grid a:hover {
    border-color: rgba(59, 130, 246, 0.34);
    background: #1d2a40;
    color: #f8fafc;
}

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

.acp-quick-grid a {
    min-height: 54px;
}

.acp-dashboard-manager button,
.acp-widget-library button {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(21, 30, 46, 0.88);
    color: #e2e8f0;
}

.acp-dashboard-manager button:hover,
.acp-widget-library button:hover {
    border-color: rgba(59, 130, 246, 0.36);
    background: #1d2a40;
}

body[data-theme="light"] {
    --bg: #eef6ff;
    --bg-soft: #f7fbff;
    --panel: rgba(247, 250, 255, 0.98);
    --panel-soft: rgba(232, 241, 252, 0.96);
    --panel-deep: rgba(255, 255, 255, 0.96);
    --border: rgba(75, 109, 151, 0.22);
    --text: #0f172a;
    --muted: #475569;
    --subtle: #64748b;
}

body[data-theme="light"] .acp-sidebar,
body[data-theme="light"] .acp-header,
body[data-theme="light"] .acp-card,
body[data-theme="light"] .acp-dashboard-manager,
body[data-theme="light"] .acp-widget-library {
    border-color: rgba(75, 109, 151, 0.18);
    background: rgba(248, 251, 255, 0.94);
    color: #0f172a;
}

body[data-theme="light"] .acp-report-card h2,
body[data-theme="light"] .acp-side-card h2,
body[data-theme="light"] .acp-stat-card strong,
body[data-theme="light"] .acp-status-table span,
body[data-theme="light"] .acp-activity-list.preview strong {
    color: #0f172a;
}

body[data-theme="light"] .acp-muted,
body[data-theme="light"] .acp-status-table strong,
body[data-theme="light"] .acp-activity-list.preview span {
    color: #64748b;
}

body[data-theme="light"] .acp-donut::after {
    background: #f8fbff;
}

@media (max-width: 1420px) {
    .acp-dashboard-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .acp-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .acp-report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .acp-dashboard-layout,
    .acp-report-grid {
        grid-template-columns: 1fr;
    }

    .acp-dashboard-aside {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .acp-dashboard-aside,
    .acp-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .acp-dashboard-aside,
    .acp-stat-row,
    .acp-quick-grid {
        grid-template-columns: 1fr;
    }
}

/* Stage 1.4 (E1.4-T15, decision 16): the dashboard on the builder's grid engine (ace-grid.js): 24 columns and rows of
   8 px, each widget at its place (grid-column and grid-row from data-widget-place). A widget whose content is taller
   grows when the page is drawn (acpanel.js); columns never pull on each other.
   Stage 1.16b (18 Oct; P-Panou-Telefon, DE-FACUT.md 0.8 point 10): under 1281 px the widgets flow in their reading order, as the
   boards show them: on a tablet four columns (a figure a quarter, a card a half or the whole row), on a phone two (a figure a half,
   a card the whole row), each at least as tall as its place (--widget-h rows of 8 px); moving and resizing work there too. */
.acp-dashboard-layout.acp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    grid-auto-rows: 8px;
    column-gap: 16px;
    row-gap: 0;
    align-items: stretch;
}

.acp-dashboard-layout.acp-dashboard-grid > [data-dashboard-widget] {
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    overflow: auto;
}

/* Stage 1.16b (18 Oct; P-Panou-Edit, P-Panou-Edit-Widget): in the arranging mode each widget has a solid faint line, the chosen one
   the builder's chosen look (the shared piece in ace-grid.js: .ace-choosable, .ace-chosen, .ace-chosen-x); its own title gives way to
   the head of the arranging mode (the grip, the name, the arrows, S / M / L), so its content keeps its room. The card cuts what is
   taller than its place, a little outside its edge (overflow-clip-margin), so the handles and the red X, half outside, stay whole. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget] {
    position: relative;
    overflow: clip;
    overflow-clip-margin: 18px;
    border: 2px solid var(--acs-chosen-soft);
    outline: 0;
    cursor: grab;
}

@media (pointer: coarse) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget] {
        overflow-clip-margin: 24px;
        cursor: default;
    }
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget] > h2,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget] > .ace-ui-panou-head {
    display: none;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget]:focus-visible {
    outline: 3px solid var(--acs-primary);
    outline-offset: 3px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget].dragging,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget].resizing {
    z-index: 6;
    border-style: solid;
    box-shadow: var(--acs-shadow-strong);
    cursor: grabbing;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget].is-drop-target {
    border-style: solid;
    background: var(--acs-primary-soft);
}

/* The head of a widget while arranging (P-Panou-Edit): the grip, its name, then the arrows and S / M / L as one pill. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-widget-controls {
    position: static;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0 0 10px;
    pointer-events: auto;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-handle {
    position: relative;
    z-index: 8;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    margin: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--acs-radius-pill);
    background: transparent;
    color: var(--acs-muted);
    letter-spacing: 0;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-handle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (pointer: coarse) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-handle {
        width: 44px;
        height: 44px;
    }
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-name {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    color: var(--acs-text);
    font-size: var(--acs-fs);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-buttons {
    position: relative;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-buttons > button,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-sizes button {
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border: 0;
    border-radius: var(--acs-radius-pill);
    background: transparent;
    color: var(--acs-muted);
    font: inherit;
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    cursor: pointer;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-sizes {
    display: inline-flex;
    gap: 1px;
    padding: 2px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface-2);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-sizes button.is-active {
    background: var(--acs-primary-gradient);
    color: var(--acs-on-primary);
}

/* Stage 1.16b (P-Panou-Edit-Widget): a figure says its name in the head of the arranging mode, beside S / M / L, and its own label with
   the icon gives way, so the number and its note keep their room (they were cut). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > .ace-ui-panou-stat .ace-ui-panou-stat__head {
    display: none;
}
/* The recent activity's list keeps the card's ground while arranging (an old dark ground of the list showed through). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-grid .acp-activity-list.preview.ace-ui-panou-activity {
    background: transparent;
}

/* The red round X: the shared piece (.ace-chosen-x in ace-grid.js), on the top edge a little left of the corner, as on P-Panou-Edit. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-remove {
    --ace-x-gap: 24px;
}

.acp-shell:not(.dashboard-edit-mode) .acp-widget-controls {
    display: none;
}

/* The band of the arranging mode (P-Panou-Edit), over the page's header. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin: 0 0 20px;
    padding: 12px 16px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-primary-soft);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band[hidden],
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery[hidden],
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery-backdrop[hidden],
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-add-card[hidden] {
    display: none;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__text {
    display: grid;
    flex: 1 1 320px;
    gap: 2px;
    min-width: 0;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__text strong {
    color: var(--acs-text);
    font-size: var(--acs-fs);
    font-weight: 600;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__text span,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band .acp-widget-save-status {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band .acp-widget-save-status:empty {
    display: none;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band .acp-widget-save-status.error {
    color: var(--acs-danger);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band .acp-dashboard-manager-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* The Owner's "Pentru toți ▾": saving the arrangement for everyone, or putting everyone's back, in a small menu. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__global {
    position: relative;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__global > summary {
    list-style: none;
    cursor: pointer;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__global > summary::-webkit-details-marker {
    display: none;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__global > div {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    min-width: 240px;
    padding: 6px;
    border: 1px solid var(--acs-border);
    border-radius: 14px;
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow-strong);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-band__global > div .ace-c-btn {
    justify-content: flex-start;
    width: 100%;
}

/* "+ Adaugă widget": the dashed card after the widgets. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-add-card {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 6px;
    min-height: 180px;
    padding: 18px;
    border: 2px dashed var(--acs-primary);
    border-radius: var(--acs-radius);
    background: transparent;
    color: var(--acs-primary-text);
    font: inherit;
    text-align: center;
    cursor: pointer;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-add-card strong {
    font-size: var(--acs-fs);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-add-card small {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-add-card:hover {
    background: var(--acs-primary-soft);
}

/* The gallery: a drawer on the right (P-Panou-Edit), the tabs as one pill, the cards two a row. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: var(--acs-backdrop);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5001;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(560px, 100vw);
    box-sizing: border-box;
    padding: 20px 22px 0;
    overflow-y: auto;
    border-left: 1px solid var(--acs-border);
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow-strong);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__head h2 {
    margin: 0;
    font-size: var(--acs-fs-section);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface-2);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__tabs .ace-ui-chip {
    justify-content: center;
    min-height: 40px;
    border: 0;
    font: inherit;
    font-size: var(--acs-fs-sm);
    cursor: pointer;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__panel[hidden] {
    display: none;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__panel > p {
    margin: 0 0 12px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface-2);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__card p {
    flex: 1 1 auto;
    margin: 0;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__title strong {
    color: var(--acs-text);
    font-size: var(--acs-fs);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__title .acp-pill[hidden] {
    display: none;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__kinds .ace-ui-chip {
    min-height: 30px;
    font: inherit;
    font-size: var(--acs-fs-sm);
    cursor: pointer;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__foot small {
    min-width: 0;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__foot-note {
    position: sticky;
    bottom: 0;
    display: grid;
    gap: 2px;
    margin: auto -22px 0;
    padding: 14px 22px;
    border-top: 1px solid var(--acs-border);
    background: var(--acs-surface);
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}

/* A report drawn as bars or as a line (P-Panou-Edit). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 96px;
    margin: 4px 0 8px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-bars span {
    flex: 1 1 0;
    min-height: 4px;
    height: calc(var(--value, 0) * 1%);
    border-radius: 4px 4px 2px 2px;
    background: var(--acs-primary-soft);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-bars span.is-last {
    background: var(--acs-primary-gradient);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-line {
    display: block;
    width: 100%;
    height: 96px;
    margin: 4px 0 8px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-line polyline {
    stroke: var(--acs-primary);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Stage 1.16b (18 Oct; P-Panou): a widget's content starts at its top (a card taller than its content kept its rows spread over it). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-grid > [data-dashboard-widget] {
    align-content: start;
}

/* The four figures (P-Panou): the label beside its icon, the number, then a pill and a few words with the line of the last weeks. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-grid > .ace-ui-panou-stat {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding: 18px 20px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__head > span:last-child {
    display: inline;
    color: var(--acs-text);
    font-size: var(--acs-fs);
    font-weight: 400;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-c-tile-icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__value {
    color: var(--acs-text);
    font-size: var(--acs-fs-page);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__value.is-text {
    font-size: var(--acs-fs-title);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__foot .acp-pill {
    display: inline-flex;
    flex: 0 0 auto;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-stat .ace-ui-panou-stat__foot small {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-spark {
    flex: 0 1 84px;
    min-width: 28px;
    width: 84px;
    height: 30px;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-spark polyline {
    stroke: var(--acs-primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Sănătatea sistemului (P-Panou): all fine in a green panel; each check with its tick, the value on one line. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-score.is-ok {
    padding: 12px;
    border: 1px solid var(--acs-success);
    border-radius: 14px;
    background: var(--acs-success-soft);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-score.is-ok strong {
    color: var(--acs-success);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-tick {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--acs-neutral-soft);
    color: var(--acs-neutral);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-tick svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-tick.is-ok {
    background: var(--acs-success-soft);
    color: var(--acs-success);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-tick.is-warning {
    background: var(--acs-warning-soft);
    color: var(--acs-warning);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-tick.is-error {
    background: var(--acs-danger-soft);
    color: var(--acs-danger);
}

/* Stage 1.16b (review-b.md 7): a long value wraps on two lines at the right, as P-Panou ("rulează, acum 1 min"), never cut. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-card .ace-ui-panou-checks li strong {
    max-width: 170px;
    color: var(--acs-text);
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-card .ace-ui-panou-checks li > span:nth-child(2) {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The cards' titles as in P-Panou (18 px); a step done of "Primii pași" ticked in blue. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-grid > .ace-ui-panou-card h2 {
    font-size: var(--acs-fs-title);
    font-weight: 600;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-steps .ace-ui-panou-tick {
    width: 22px;
    height: 22px;
    border: 2px solid var(--acs-border-strong);
    border-radius: 50%;
    background: transparent;
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-steps .ace-ui-panou-tick.is-ok {
    border-color: transparent;
    background: var(--acs-primary-gradient);
    color: var(--acs-on-primary);
}

:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-steps .ace-ui-panou-tick svg {
    width: 13px;
    height: 13px;
}

/* Stage 1.16b (18 Oct; VERIFICARE-1-LA-1.md 2.4, piese-comune.md B2): "Vizualizare: Tabel ▾" opens the shared menu's list; the view in use
   on the soft blue. */
body[data-ace-theme-scope="acpanel"] .ace-biz-view-pill .ace-c-more-item.is-active {
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
}

/* Under 1281 px (the selectors carry .acp-content: the Panou's older flow in ace-panel-ui.css, 12 columns by the widgets' areas, gives
   way to this one). From 1025 px four columns; under it two, as on a phone (P-Panou-Telefon: the figures two a row). */
@media (max-width: 1280px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: auto;
        /* Stage 1.4 (E1.4-V120): in reading order; "dense" moved a later card into an earlier gap, ahead of what
           comes before it for the keyboard and a screen reader. A gap may stay at the end of a row. */
        grid-auto-flow: row;
        column-gap: 16px;
        row-gap: 16px;
        align-items: stretch;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > [data-dashboard-widget] {
        grid-column: auto / span 2 !important;
        grid-row: auto !important;
        min-height: calc(var(--widget-h, 0) * 8px);
        overflow: visible;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > [data-widget-cols="s"],
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > .acp-widget-add-card {
        grid-column: auto / span 1 !important;
        grid-row: auto !important;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > [data-widget-cols="l"] {
        grid-column: 1 / -1 !important;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-dashboard-grid > [data-dashboard-widget] {
        overflow: visible;
    }
}

@media (max-width: 1024px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 14px;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > [data-dashboard-widget],
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > [data-widget-cols="l"] {
        grid-column: 1 / -1 !important;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-layout.acp-dashboard-grid > [data-widget-cols="s"] {
        grid-column: auto / span 1 !important;
    }
}

/* With a finger, while arranging, the cards stand 48 px apart: the handles' 44 px zones of two neighbours do not overlap. */
@media (max-width: 1280px) and (pointer: coarse) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .acp-content .acp-dashboard-layout.acp-dashboard-grid {
        gap: 48px;
        padding: 12px 10px;
    }
}

@media (max-width: 767px) {
    /* An activity line on a phone as on a computer: the initials, who and what, when (an older rule for narrow screens put the
       initials alone on the left half). */
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-activity-list.ace-ui-panou-activity > div {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .ace-ui-panou-activity p {
        text-align: left;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .ace-ui-panou-activity .ace-ui-panou-initials {
        grid-column: 1;
        text-align: center;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .ace-ui-panou-activity > div > span:last-child {
        grid-column: 3;
        text-align: right;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery {
        padding: 16px 16px 0;
    }

    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-gallery__foot-note {
        margin: auto -16px 0;
        padding: 12px 16px;
    }
}

/* Stage 1.16b (18 Oct; P-Mesaje; review-b.md 9): the messages' list and the message read next to it. The initials on a solid round of one
   of five tones (by the person), the text in the surface's colour (light on the light theme's dark tones, dark on the dark theme's light
   ones); the chosen row on the soft primary ground, the unread dot, the text of the message in a soft box. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    background: var(--acs-primary);
    color: var(--acs-on-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-avatar.is-tone-1 { background: var(--acs-success); color: var(--acs-surface); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-avatar.is-tone-2 { background: var(--acs-warning); color: var(--acs-surface); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-avatar.is-tone-3 { background: var(--acs-info); color: var(--acs-surface); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-avatar.is-tone-4 { background: var(--acs-muted); color: var(--acs-surface); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__list {
    padding: 0;
    overflow: hidden;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row {
    color: var(--acs-text);
    text-decoration: none;
    border-bottom: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__rows li:last-child .ace-biz-inbox__row {
    border-bottom: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row.is-open {
    background: var(--acs-primary-soft);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row:focus-visible {
    outline: 2px solid var(--acs-focus);
    outline-offset: -2px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__who small,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__line > span:last-child {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row.is-unread .ace-biz-inbox__line > span:last-child {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--acs-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__head h2 {
    margin: 0;
    font-size: var(--acs-fs-title);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__head p {
    margin: 2px 0 0;
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__text {
    background: var(--acs-surface-2);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    line-height: 1.6;
}

/* Stage 1.16b (P-Panou "⋯"): a widget's options, the shared row menu, at the right of its title. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-panou-head > .ace-c-more {
    margin-left: auto;
}

/* Stage 1.16b (18 Oct; P-Panou-Configurare): "Termină configurarea" on the Panou: a soft red card, the solid red tile with the shield,
   the title with "Mai ai N zile" in solid red, the text, the steps as boxes with their links, "Termină acum" on the right. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-finish-setup {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    padding: 20px 22px;
    border: 1px solid var(--acs-danger);
    border-radius: var(--acs-radius);
    background: var(--acs-danger-soft);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup > .ace-c-tile-icon {
    flex: 0 0 auto;
    border-color: transparent;
    background: var(--acs-danger-solid);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__body {
    flex: 1 1 auto;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__title strong {
    color: var(--acs-danger);
    font-size: var(--acs-fs-title);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__pill {
    padding: 2px 10px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-danger-solid);
    color: var(--acs-white);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__body p {
    margin: 6px 0 10px;
    color: var(--acs-text);
    font-size: var(--acs-fs-sm);
    line-height: 1.55;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__items li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--acs-fs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__items a {
    color: var(--acs-primary-text);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    text-decoration: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__items small {
    color: var(--acs-success);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__box {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--acs-border-strong);
    border-radius: 6px;
    background: var(--acs-surface);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__items li.is-done .acp-finish-setup__box {
    border-color: var(--acs-primary);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__box svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup > .ace-c-btn {
    flex: 0 0 auto;
}
@media (max-width: 760px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-finish-setup {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup__body {
        flex-basis: calc(100% - 64px);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-finish-setup > .ace-c-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Stage 1.16b (P-Panou-Edit-Widget): on a figure the head says its name and S / M / L, as the board; the arrows that move it stay for
   the keyboard (they show while focused), so the name has its room. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode .ace-ui-panou-stat .acp-widget-buttons [data-widget-move]:not(:focus-visible) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Stage 1.16b (P-Panou-Cron): the scheduled tasks' banner as one soft red card: the solid red tile with the clock, the red title and its
   text, "Cum îl pornești" and "Rulează o dată acum" on the same row at the right; on a phone the buttons go under the text. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-cron {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border: 1px solid var(--acs-danger);
    border-radius: var(--acs-radius);
    background: var(--acs-danger-soft);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-cron > .ace-c-tile-icon {
    flex: 0 0 auto;
    border-color: transparent;
    background: var(--acs-danger-solid);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-cron__body {
    flex: 1 1 auto;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-cron__body strong {
    display: block;
    color: var(--acs-danger);
    font-size: var(--acs-fs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-cron__body p {
    margin: 2px 0 0;
    color: var(--acs-text);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-cron > .ace-c-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-cron .ace-c-actions form {
    margin: 0;
}
@media (max-width: 760px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-cron {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-cron__body {
        flex-basis: calc(100% - 60px);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content .acp-dashboard-cron > .ace-c-actions {
        flex-wrap: wrap;
        width: 100%;
    }
}
