/* john cena panel — custom identity layer */
:root {
    --bg:           #08090c;
    --surface:      #0f1116;
    --surface-2:    #141820;
    --surface-3:    #191e28;
    --border:       #1e2430;
    --border-hi:    #2a3344;

    --amy:          #8b8b8b;
    --amy-hi:       #a3a3a3;
    --amy-lo:       #636363;
    --amy-dim:      rgba(139, 139, 139, 0.10);
    --amy-ring:     rgba(139, 139, 139, 0.28);

    --btn-primary-bg:         #333333;
    --btn-primary-bg-hover:   #404040;
    --btn-primary-bg-active:  #2a2a2a;
    --btn-primary-border:     rgba(51, 51, 51, 0.55);
    --btn-primary-border-hi:  rgba(64, 64, 64, 0.5);
    --btn-primary-border-down: rgba(42, 42, 42, 0.65);

    --accent:     var(--amy);
    --accent-dim: var(--amy-dim);
    --accent-hi:  var(--amy-hi);

    --r-s:  10px;
    --r-m:  14px;
    --r-l:  18px;
    --r-xl: 22px;
}

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    background-color: var(--bg);
    background-image:
        linear-gradient(
            165deg,
            rgba(8, 9, 12, 0.52) 0%,
            rgba(8, 9, 12, 0.78) 42%,
            rgba(8, 9, 12, 0.94) 100%
        ),
        url("../img/panel-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* branded wallpaper sits under the dot grid + canvas orbs */
body::before {
    opacity: 0.32;
}

#bg-canvas {
    opacity: 0.55;
}

/* brand */
.brand {
    gap: 10px;
    padding: 4px 8px 0;
}
.brand-stack {
    gap: 10px;
    padding: 0;
}
.brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1;
}
.sidebar-head .brand-text {
    gap: 0;
    line-height: 1;
}
.sidebar-head .brand-primary,
.sidebar-head .brand-secondary {
    line-height: 1;
    margin: 0;
}
.brand-primary {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-transform: lowercase;
}
.brand-secondary {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amy);
}

/* sidebar + nav */
.sidebar {
    background: rgba(8, 9, 12, 0.82);
    border-right-color: var(--border);
    padding-top: 0;
}
.sidebar-head {
    border-bottom-color: transparent;
}

/* sidebar chrome — dark panel, foot pinned bottom */
.sidebar-chrome {
    padding: 0;
    background: rgba(8, 9, 12, 0.92);
    display: flex;
    flex-direction: column;
}

.sidebar-chrome-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-direction: row;
    margin: 0;
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 12, 16, 0.88);
    flex-shrink: 0;
}

/* panel.css pins .sidebar-collapse absolute — reset for chrome header */
.sidebar-chrome-head .sidebar-collapse {
    position: static;
    top: auto;
    right: auto;
    align-self: center;
    margin: 0;
}

.sidebar-chrome-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.sidebar-chrome-logo {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(145deg, rgba(139, 139, 139, 0.55), rgba(99, 99, 99, 0.18));
    box-shadow: 0 0 0 1px rgba(139, 139, 139, 0.12), 0 10px 24px rgba(0, 0, 0, 0.28);
}

.sidebar-chrome-logo img {
    width: 100%;
    height: 100%;
    border-radius: 11px;
    object-fit: cover;
    display: block;
}

.sidebar-chrome-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.15;
}

.sidebar-chrome-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-transform: lowercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-chrome-sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-chrome-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    flex-shrink: 0;
    position: static;
    opacity: 0.72;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        opacity 0.15s ease;
}

.sidebar-chrome-collapse svg {
    width: 16px;
    height: 16px;
}

.sidebar-chrome-collapse:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    opacity: 1;
}

.sidebar-chrome .sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 12px 16px;
    background: transparent;
}

.sidebar-chrome-foot {
    margin: 0;
    margin-top: auto;
    padding: 14px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    border-top: 1px solid var(--border);
    background: rgba(6, 7, 10, 0.96);
    flex-shrink: 0;
}

.sidebar-chrome .nav-item {
    color: var(--text-2);
}

.sidebar-chrome .nav-item:hover,
.sidebar-chrome .nav-item.active {
    color: var(--text);
}

.sidebar-chrome .nav-label {
    color: var(--text-ghost);
}

.sidebar-chrome-util {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.sidebar-chrome-util:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.sidebar-chrome-util.is-telegram:hover {
    border-color: rgba(139, 139, 139, 0.32);
    background: rgba(139, 139, 139, 0.08);
}

.sidebar-chrome-util.is-telegram:hover .sidebar-chrome-util-title {
    color: var(--amy-hi);
}

.sidebar-chrome-util.is-logout:hover {
    border-color: rgba(248, 113, 113, 0.32);
    background: rgba(239, 68, 68, 0.08);
}

.sidebar-chrome-util.is-logout:hover .sidebar-chrome-util-title {
    color: #fca5a5;
}

.sidebar-chrome-util-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(139, 139, 139, 0.08);
    color: var(--amy);
    border: 1px solid rgba(139, 139, 139, 0.14);
}

.sidebar-chrome-util.is-logout .sidebar-chrome-util-icon {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.16);
}

.sidebar-chrome-util-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.sidebar-chrome-util-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.sidebar-chrome-util-title {
    font-size: 13px;
    font-weight: 600;
    color: #f9fafb;
    letter-spacing: -0.01em;
}

.sidebar-chrome-util-sub {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.25;
}

.sidebar-chrome-util-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-3);
    opacity: 0.7;
    transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.sidebar-chrome-util.is-telegram:hover .sidebar-chrome-util-arrow {
    color: var(--amy);
    opacity: 1;
    transform: translate(1px, -1px);
}

.sidebar-chrome-foot .sidebar-logout-form {
    margin: 0;
    min-width: 0;
}

@media (max-width: 900px) {
    .sidebar-chrome-collapse {
        display: none;
    }
}

/* sidebar stays dark even when light theme is on */
html[data-theme="light"] .sidebar.sidebar-chrome {
    background: rgba(8, 9, 12, 0.96);
    border-right-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .sidebar-chrome-head {
    background: rgba(11, 12, 16, 0.94);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .sidebar-chrome-title {
    color: #f3f4f6;
}

html[data-theme="light"] .sidebar-chrome .sidebar-scroll {
    background: transparent;
}

html[data-theme="light"] .sidebar-chrome .nav-label {
    color: rgba(148, 163, 184, 0.85);
}

html[data-theme="light"] .sidebar-chrome .nav-item {
    color: rgba(226, 232, 240, 0.72);
}

html[data-theme="light"] .sidebar-chrome .nav-item:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .sidebar-chrome .nav-item.active {
    color: #f8fafc;
    background: rgba(139, 139, 139, 0.12);
    box-shadow: inset 0 0 0 1px rgba(139, 139, 139, 0.18);
}

html[data-theme="light"] .sidebar-chrome .nav-icon {
    color: rgba(148, 163, 184, 0.9);
}

html[data-theme="light"] .sidebar-chrome .nav-item.active .nav-icon {
    color: var(--amy);
}

.nav-label {
    letter-spacing: 0.12em;
    color: var(--text-3);
}
.nav-item {
    border-radius: 10px;
    font-weight: 500;
}
.nav-item.active {
    background: rgba(139, 139, 139, 0.08);
    box-shadow: inset 0 0 0 1px rgba(139, 139, 139, 0.14);
}
.nav-item.active::before { display: none; }
.nav-item.active .nav-icon { color: var(--amy); }

/* topbar */
.topbar .crumb .sep:first-child {
    color: var(--amy);
    font-weight: 600;
    text-transform: lowercase;
}

/* cards + stats */
.card {
    border-color: var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%), var(--surface);
    box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.stat-tile {
    border-color: var(--border);
    background: linear-gradient(180deg, rgba(139, 139, 139, 0.04), transparent 55%), var(--surface);
}
.stat-tile .stat-label svg { color: var(--amy); }

/* buttons + pills */
.btn.primary {
    background: linear-gradient(180deg, #404040, var(--btn-primary-bg));
    border-color: rgba(139, 139, 139, 0.35);
    color: #e5e5e5;
}
.pill.amy,
.badge.amy,
.alert.info,
.subject-preview-tag.amy {
    color: var(--amy);
    border-color: rgba(139, 139, 139, 0.28);
    background: var(--amy-dim);
}
.fc-option.is-selected.is-active,
.main.page--preview .tpl-list .tpl.active {
    background: rgba(139, 139, 139, 0.12);
    border-color: rgba(139, 139, 139, 0.35);
}

/* login */
.login-card {
    border-color: var(--border-hi);
    background: linear-gradient(165deg, rgba(139, 139, 139, 0.05), transparent 42%), var(--surface);
}
.login-card::before {
    background: radial-gradient(circle, rgba(139, 139, 139, 0.10), transparent 62%);
}
.login-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.login-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.login-brand-text .brand-primary { font-size: 16px; }
.login-brand-text .brand-secondary { font-size: 10px; }
.login-tag {
    border-color: rgba(139, 139, 139, 0.18);
    background: rgba(139, 139, 139, 0.06);
    color: var(--amy-hi);
}
.login-h1 em {
    font-style: normal;
    color: var(--amy);
}

/* recent sends table — compact rows, truncate long templates */
.dash-grid > .card.flush .table {
    table-layout: fixed;
    width: 100%;
}
.dash-grid > .card.flush .table th:nth-child(1),
.dash-grid > .card.flush .table td:nth-child(1) { width: 22%; }
.dash-grid > .card.flush .table th:nth-child(2),
.dash-grid > .card.flush .table td:nth-child(2) { width: 26%; }
.dash-grid > .card.flush .table th:nth-child(3),
.dash-grid > .card.flush .table td:nth-child(3) { width: 34%; }
.dash-grid > .card.flush .table th:nth-child(4),
.dash-grid > .card.flush .table td:nth-child(4) { width: 18%; }
.dash-grid > .card.flush .table th,
.dash-grid > .card.flush .table td {
    font-size: 11px;
    padding: 9px 12px;
    overflow: hidden;
}
.dash-grid > .card.flush .table th {
    font-size: 9.5px;
}
.dash-grid > .card.flush .table td .mono {
    font-size: 10px;
}
.dash-grid > .card.flush .table td:last-child {
    white-space: nowrap;
    width: 18%;
    overflow: visible;
}
.dash-grid > .card.flush .table .brand-cell {
    font-size: 10.5px;
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.dash-grid > .card.flush .table .brand-cell .cell-scroll {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto;
    max-width: 100%;
    min-width: 0;
    flex: 1;
    padding-right: 0;
}
.dash-grid > .card.flush .table td .cell-scroll {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
}

/* notification popover extras */
.notif-popover-head,
.notif-popover-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.notif-popover-foot {
    border-bottom: 0;
    border-top: 1px solid var(--border);
}
.notif-popover-inner .notif-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 12px;
}
.dash-notif-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* preview panes — block clicks on inlined html (send fallback path) */
.preview-frame a,
.preview-frame button,
.preview-frame input,
.preview-frame select,
.preview-frame textarea,
.preview-frame summary,
.preview-frame [role="button"],
.preview-frame [onclick] {
    pointer-events: none !important;
    cursor: default !important;
}
