* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

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

.topbar {
    min-height: 64px;
    background: #0f172a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.topbar strong {
    display: block;
    font-size: 18px;
}

.topbar span {
    color: #cbd5e1;
    font-size: 13px;
}

.topbar nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar nav a {
    background: rgba(255,255,255,0.08);
    padding: 9px 14px;
    border-radius: 12px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 64px);
}

.tabs {
    background: #111827;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tab-btn {
    border: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: #1f2937;
    color: #e5e7eb;
    cursor: pointer;
    text-align: right;
    font-size: 15px;
}

.tab-btn.active {
    background: #2563eb;
    color: white;
}

.content {
    padding: 24px;
    max-width: 1100px;
    width: 100%;
}

.panel-title h1 {
    margin-bottom: 4px;
}

.panel-title p {
    color: #64748b;
    margin-top: 0;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    margin: 18px 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.card h2,
.card h1 {
    margin-top: 0;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 12px;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

button {
    font-family: inherit;
}

.card button,
.login-card button,
.chat-input-row button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
}

.record-item {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: #f8fafc;
}

.record-item h3 {
    margin: 0 0 8px;
}

.record-item p {
    white-space: pre-wrap;
}

.record-item small,
.chat-message small {
    color: #64748b;
}

.muted {
    color: #64748b;
}

.hidden {
    display: none;
}

.chat-box {
    height: 360px;
    overflow: auto;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 12px;
}

.chat-message {
    background: white;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.chat-message p {
    margin: 6px 0;
}

.chat-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.chat-input-row input {
    margin: 0;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, #1d4ed8, transparent 32%),
        #0f172a;
}

.login-card {
    width: min(420px, calc(100% - 32px));
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.brand {
    color: #2563eb;
    font-weight: bold;
    margin-bottom: 12px;
}

.login-card h1 {
    margin-top: 0;
}

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 14px;
}

.hint {
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    color: #475569;
}

.manager-layout {
    padding: 24px;
    max-width: 1100px;
    margin: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px;
    text-align: right;
}

th {
    background: #f8fafc;
}

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

    .tabs {
        flex-direction: row;
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
    }

    .content {
        padding: 14px;
    }

    .chat-input-row {
        grid-template-columns: 1fr;
    }
}

/* SharePoint custom form */
.share-hero {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    align-items: stretch;
    margin: 18px 0;
}

.share-hero > div:first-child,
.share-hero-box {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.share-hero h2 {
    margin: 12px 0 8px;
    font-size: 28px;
}

.share-hero p,
.share-hero-box span {
    color: #dbeafe;
    line-height: 1.9;
}

.share-hero-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.share-hero-box strong {
    font-size: 22px;
    margin-bottom: 10px;
}

.pill {
    display: inline-flex;
    background: rgba(255,255,255,0.14);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.24);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.share-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.share-section {
    background: white;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.share-section h3 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 18px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-section h3::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 999px;
    display: inline-block;
}

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

.share-grid label,
.full-note label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: bold;
    color: #334155;
    font-size: 14px;
}

.share-grid input,
.share-grid select,
.share-section textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px 13px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 0;
    transition: 0.18s ease;
}

.share-grid input:focus,
.share-grid select:focus,
.share-section textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.full-note textarea {
    min-height: 150px;
}

.share-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.share-actions button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 13px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
}

.share-actions .secondary-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.share-record {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.share-record-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.data-chip {
    display: inline-flex;
    gap: 5px;
    background: #eef2ff;
    color: #1e293b;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 13px;
}

.share-note {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 0;
    margin-top: 14px;
    white-space: pre-wrap;
}

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

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

@media (max-width: 640px) {
    .share-grid {
        grid-template-columns: 1fr;
    }

    .share-actions {
        flex-direction: column;
    }

    .share-actions button {
        width: 100%;
    }
}

/* SharePoint saved forms list and editing */
.share-toolbar {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
    margin: 18px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.share-toolbar button,
.list-panel-head button,
.small-edit-btn {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 11px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.share-toolbar .secondary-btn,
.list-panel-head .secondary-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.edit-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.list-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.list-panel-head h2 {
    margin-bottom: 4px;
}

.list-panel-head p {
    margin-top: 0;
    color: #64748b;
}

.small-edit-btn {
    background: #0f172a;
    white-space: nowrap;
}

.small-edit-btn:hover,
.share-toolbar button:hover,
.list-panel-head button:hover {
    opacity: 0.9;
}

/* Locked SharePoint F list */
.lock-card {
    max-width: 620px;
    margin: 18px auto;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.lock-card h2 {
    margin-bottom: 8px;
}

.pin-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 18px;
}

.pin-row input {
    margin: 0;
    letter-spacing: 4px;
    direction: ltr;
    text-align: center;
    font-weight: bold;
}

.pin-row button,
.table-actions button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.error-text {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    border-radius: 12px;
    margin-top: 12px;
}

.table-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.table-panel-head h2 {
    margin-bottom: 4px;
}

.table-panel-head p {
    margin-top: 0;
    color: #64748b;
}

.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-actions .secondary-btn {
    background: #e2e8f0;
    color: #0f172a;
}

.table-count {
    margin: 12px 0;
    color: #0f172a;
    font-weight: bold;
}

.excel-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: white;
    max-height: 70vh;
}

.excel-table {
    min-width: 1600px;
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.excel-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1e40af;
    color: white;
    border: 1px solid #93c5fd;
    padding: 10px;
    white-space: nowrap;
    text-align: right;
}

.excel-table td {
    border: 1px solid #e2e8f0;
    padding: 9px;
    vertical-align: top;
    background: #ffffff;
    min-width: 130px;
    max-width: 260px;
    white-space: pre-wrap;
}

.excel-table tr:nth-child(even) td {
    background: #f8fafc;
}

@media (max-width: 640px) {
    .pin-row {
        grid-template-columns: 1fr;
    }

    .table-actions {
        width: 100%;
    }

    .table-actions button {
        width: 100%;
    }
}

/* Admin delete controls */
.record-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.small-delete-btn,
.table-delete-btn {
    border: 0;
    background: #dc2626;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    white-space: nowrap;
}

.table-delete-btn {
    padding: 8px 12px;
}

.small-delete-btn:hover,
.table-delete-btn:hover {
    opacity: 0.9;
}

/* Admin delete controls */
.record-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.small-delete-btn,
.table-delete-btn {
    border: 0;
    background: #dc2626;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    white-space: nowrap;
}

.table-delete-btn {
    padding: 8px 12px;
}

.small-delete-btn:hover,
.table-delete-btn:hover {
    opacity: 0.9;
}

/* Admin delete controls */
.record-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.small-delete-btn,
.table-delete-btn {
    border: 0;
    background: #dc2626;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    white-space: nowrap;
}

.table-delete-btn {
    padding: 8px 12px;
}

.small-delete-btn:hover,
.table-delete-btn:hover {
    opacity: 0.9;
}

/* FG group chat badge */
.chat-group-badge {
    display: inline-flex;
    margin-right: 8px;
    background: #eef2ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    vertical-align: middle;
}

/* Config request and admin pool */
.config-hero {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    align-items: stretch;
    margin: 18px 0;
}

.config-hero > div:first-child,
.config-hero-box {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.config-hero h2 {
    margin: 12px 0 8px;
    font-size: 28px;
}

.config-hero p,
.config-hero-box span {
    color: #dbeafe;
    line-height: 1.9;
}

.config-hero-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.config-hero-box strong {
    font-size: 22px;
    margin-bottom: 10px;
}

.admin-config-hero > div:first-child {
    background: linear-gradient(135deg, #111827, #047857);
}

.admin-config-hero .config-hero-box {
    background: linear-gradient(135deg, #047857, #0f766e);
}

.config-button-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.config-button-grid button {
    border: 0;
    background: white;
    color: #0f172a;
    border-radius: 20px;
    padding: 22px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #dbeafe;
    transition: 0.18s ease;
}

.config-button-grid button:hover {
    transform: translateY(-2px);
    border-color: #2563eb;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.18);
}

.config-result {
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    background: #0f172a;
    color: #dbeafe;
    border-radius: 18px;
    padding: 18px;
    font-size: 13px;
    line-height: 1.8;
    cursor: pointer;
    border: 1px solid #1e293b;
}

.admin-config-label {
    display: block;
    font-weight: bold;
    margin: 12px 0 6px;
}

.raw-config-area {
    min-height: 220px;
    direction: ltr;
    text-align: left;
    font-family: monospace;
    font-size: 13px;
}

.config-admin-table td {
    direction: ltr;
    text-align: left;
}

.config-admin-table td:nth-child(2),
.config-admin-table td:nth-child(3),
.config-admin-table td:nth-child(4),
.config-admin-table td:nth-child(5),
.config-admin-table td:nth-child(6),
.config-admin-table td:nth-child(12) {
    direction: rtl;
    text-align: right;
}

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

    .config-button-grid {
        grid-template-columns: 1fr;
    }
}

/* Excel import for config pool */
.excel-import-box {
    margin-top: 22px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #dbeafe;
    background: #f8fafc;
}

.excel-import-box h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

.excel-import-box p {
    color: #64748b;
    line-height: 1.8;
}

.excel-import-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.excel-import-row input[type="file"] {
    background: white;
    margin: 0;
}

.excel-import-row button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .excel-import-row {
        grid-template-columns: 1fr;
    }

    .excel-import-row button {
        width: 100%;
    }
}

/* Clean Excel-only Add Configs layout */
.clean-import-box {
    margin-top: 10px;
    background: #ffffff;
    border: 1px solid #dbeafe;
}

#addConfigsPanel .excel-table-wrap {
    max-height: 72vh;
    scroll-behavior: auto;
}

#addConfigsPanel .table-panel-head {
    position: relative;
}

/* Admin Config Dataframe: English LTR */
#addConfigsPanel,
#addConfigsPanel .card,
#addConfigsPanel .table-panel-head,
#addConfigsPanel .excel-table-wrap,
#addConfigsPanel .excel-table,
#addConfigsPanel .excel-table th,
#addConfigsPanel .excel-table td {
    direction: ltr !important;
    text-align: left !important;
}

#addConfigsPanel .excel-table th {
    white-space: nowrap;
}

#addConfigsPanel .excel-table td {
    vertical-align: top;
}

#addConfigsPanel .config-result,
#addConfigsPanel textarea,
#addConfigsPanel input,
#addConfigsPanel select {
    direction: ltr !important;
    text-align: left !important;
}

#addConfigsPanel .table-actions {
    direction: ltr !important;
}

#addConfigsPanel .table-delete-btn {
    direction: ltr !important;
    text-align: center !important;
}

/* Chat delete and clear tools */
.chat-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.chat-admin-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.chat-admin-tools select {
    margin: 0;
    min-width: 180px;
    padding: 10px 12px;
}

.danger-soft-btn {
    border: 0;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
}

.chat-message-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.chat-delete-btn {
    border: 0;
    background: #ef4444;
    color: white;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}

.mini-fg {
    display: inline-flex;
    margin-right: 6px;
    background: #eef2ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: normal;
}

@media (max-width: 640px) {
    .chat-admin-tools,
    .chat-admin-tools select,
    .danger-soft-btn {
        width: 100%;
    }
}

/* Reminder and Calendar professional panels */
.productivity-hero,
.calendar-top {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    align-items: stretch;
    margin: 18px 0;
}

.productivity-hero > div:first-child,
.productivity-hero-box,
.calendar-top > div:first-child {
    background: linear-gradient(135deg, #0f172a, #2563eb);
    color: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.productivity-hero h2,
.calendar-top h2 {
    margin: 12px 0 8px;
    font-size: 28px;
}

.productivity-hero p,
.productivity-hero-box span,
.calendar-top p {
    color: #dbeafe;
    line-height: 1.9;
}

.productivity-hero-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.productivity-hero-box strong {
    font-size: 24px;
    margin-bottom: 8px;
}

.reminder-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 18px;
    align-items: start;
}

.field-label {
    display: block;
    font-weight: bold;
    margin: 12px 0 6px;
    color: #334155;
}

.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: 5px solid #2563eb;
    border-radius: 18px;
    padding: 15px;
}

.reminder-item.done {
    opacity: 0.65;
    border-right-color: #16a34a;
}

.reminder-item h3 {
    margin: 0 0 8px;
}

.reminder-item p {
    white-space: pre-wrap;
    margin: 0 0 8px;
}

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

.reminder-actions button,
.danger-btn {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 9px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.danger-btn,
.reminder-actions .danger-btn {
    background: #dc2626;
}

.calendar-shell {
    margin-top: 18px;
}

.calendar-top {
    grid-template-columns: 1fr auto;
}

.calendar-nav {
    background: white;
    border-radius: 24px;
    padding: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.10);
}

.calendar-nav button,
.calendar-side button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 11px 14px;
    border-radius: 13px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.calendar-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.calendar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #0f172a;
    color: white;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.calendar-weekdays div {
    padding: 12px;
    text-align: center;
    font-weight: bold;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.calendar-cell {
    min-height: 118px;
    background: white;
    border: 0;
    border-right: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    padding: 9px;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.calendar-cell:hover {
    background: #f8fafc;
}

.calendar-cell.muted-month {
    background: #f1f5f9;
    color: #94a3b8;
}

.calendar-cell.today {
    box-shadow: inset 0 0 0 2px #2563eb;
}

.calendar-cell.selected {
    background: #eff6ff;
}

.day-num {
    font-weight: bold;
    font-size: 15px;
}

.calendar-cell-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-event {
    background: #f8fafc;
    border-right: 4px solid #2563eb;
    border-radius: 8px;
    padding: 4px 6px;
    font-size: 11px;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-side textarea {
    min-height: 90px;
}

.soft-hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-event-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: 5px solid #2563eb;
    border-radius: 16px;
    padding: 13px;
}

.calendar-event-item h3 {
    margin: 0 0 7px;
}

.calendar-event-item p {
    white-space: pre-wrap;
    margin: 0 0 8px;
}

.calendar-event-item button {
    margin-top: 10px;
}

@media (max-width: 1100px) {
    .reminder-grid,
    .calendar-main,
    .productivity-hero,
    .calendar-top {
        grid-template-columns: 1fr;
    }

    .calendar-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .calendar-board {
        overflow-x: auto;
    }

    .calendar-weekdays,
    .calendar-grid {
        min-width: 760px;
    }

    .reminder-item {
        flex-direction: column;
    }

    .reminder-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Strong highlight for current day in Calendar */
.calendar-cell.today {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.32), inset 0 0 0 3px #bfdbfe !important;
    transform: translateY(-1px);
    position: relative;
    z-index: 1;
}

.calendar-cell.today .day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.18);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    min-width: 34px;
    height: 34px;
    font-size: 17px;
    font-weight: 900;
}

.calendar-cell.today .mini-event {
    background: rgba(255,255,255,0.16);
    color: #ffffff;
    border-right-color: #ffffff !important;
}

.calendar-cell.today:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
}

/* =========================================================
   Workspace Theme System
   Choices: Light, Dark, System, Night Owl, Solarized Green,
   Solarized Dark, Night Eyes
   ========================================================= */

.theme-picker {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    padding: 9px 12px;
    font-family: inherit;
    cursor: pointer;
    max-width: 180px;
}

.theme-picker option {
    color: #0f172a;
    background: #ffffff;
}

/* Base variables */
:root {
    --app-bg: #f1f5f9;
    --app-text: #0f172a;
    --topbar-bg: #0f172a;
    --sidebar-bg: #111827;
    --sidebar-btn: #1f2937;
    --sidebar-btn-text: #e5e7eb;
    --accent: #2563eb;
    --accent-2: #1d4ed8;
    --card-bg: #ffffff;
    --card-soft: #f8fafc;
    --border: #e2e8f0;
    --muted: #64748b;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --danger: #dc2626;
    --shadow: rgba(15, 23, 42, 0.08);
}

/* Light */
:root[data-theme="light"] {
    --app-bg: #f1f5f9;
    --app-text: #0f172a;
    --topbar-bg: #0f172a;
    --sidebar-bg: #111827;
    --sidebar-btn: #1f2937;
    --sidebar-btn-text: #e5e7eb;
    --accent: #2563eb;
    --accent-2: #1d4ed8;
    --card-bg: #ffffff;
    --card-soft: #f8fafc;
    --border: #e2e8f0;
    --muted: #64748b;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --danger: #dc2626;
    --shadow: rgba(15, 23, 42, 0.08);
}

/* Dark */
:root[data-theme="dark"] {
    --app-bg: #0b1120;
    --app-text: #e5e7eb;
    --topbar-bg: #020617;
    --sidebar-bg: #020617;
    --sidebar-btn: #111827;
    --sidebar-btn-text: #dbeafe;
    --accent: #3b82f6;
    --accent-2: #2563eb;
    --card-bg: #111827;
    --card-soft: #0f172a;
    --border: #334155;
    --muted: #94a3b8;
    --input-bg: #0f172a;
    --input-border: #475569;
    --danger: #ef4444;
    --shadow: rgba(0, 0, 0, 0.30);
}

/* Night Owl inspired */
:root[data-theme="night-owl"] {
    --app-bg: #011627;
    --app-text: #d6deeb;
    --topbar-bg: #010d18;
    --sidebar-bg: #010d18;
    --sidebar-btn: #0b2942;
    --sidebar-btn-text: #d6deeb;
    --accent: #82aaff;
    --accent-2: #7fdbca;
    --card-bg: #0b1f33;
    --card-soft: #0f2a43;
    --border: #1d3b53;
    --muted: #91a7bd;
    --input-bg: #011627;
    --input-border: #1d3b53;
    --danger: #ef5350;
    --shadow: rgba(0, 0, 0, 0.36);
}

/* Solarized Green */
:root[data-theme="solarized-green"] {
    --app-bg: #fdf6e3;
    --app-text: #073642;
    --topbar-bg: #2b4a42;
    --sidebar-bg: #073642;
    --sidebar-btn: #0f4c45;
    --sidebar-btn-text: #eee8d5;
    --accent: #2aa198;
    --accent-2: #859900;
    --card-bg: #fffaf0;
    --card-soft: #eee8d5;
    --border: #d8cfb8;
    --muted: #657b83;
    --input-bg: #fffaf0;
    --input-border: #c7bea7;
    --danger: #dc322f;
    --shadow: rgba(7, 54, 66, 0.12);
}

/* Solarized Dark */
:root[data-theme="solarized-dark"] {
    --app-bg: #002b36;
    --app-text: #eee8d5;
    --topbar-bg: #001f27;
    --sidebar-bg: #001f27;
    --sidebar-btn: #073642;
    --sidebar-btn-text: #eee8d5;
    --accent: #268bd2;
    --accent-2: #2aa198;
    --card-bg: #073642;
    --card-soft: #002b36;
    --border: #28505a;
    --muted: #93a1a1;
    --input-bg: #002b36;
    --input-border: #586e75;
    --danger: #dc322f;
    --shadow: rgba(0, 0, 0, 0.35);
}

/* Night Eyes inspired */
:root[data-theme="night-eyes"] {
    --app-bg: #101419;
    --app-text: #d7dde8;
    --topbar-bg: #090c10;
    --sidebar-bg: #0b0f14;
    --sidebar-btn: #151b23;
    --sidebar-btn-text: #c8d3e0;
    --accent: #5cc8ff;
    --accent-2: #9f7aea;
    --card-bg: #161c24;
    --card-soft: #101820;
    --border: #2a3441;
    --muted: #9aa9ba;
    --input-bg: #101820;
    --input-border: #344253;
    --danger: #ff6b6b;
    --shadow: rgba(0, 0, 0, 0.42);
}

/* Apply variables to existing app */
body {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

.topbar {
    background: var(--topbar-bg) !important;
}

.tabs {
    background: var(--sidebar-bg) !important;
}

.tab-btn {
    background: var(--sidebar-btn) !important;
    color: var(--sidebar-btn-text) !important;
}

.tab-btn.active {
    background: var(--accent) !important;
    color: #ffffff !important;
}

.card,
.share-section,
.lock-card,
.calendar-board,
.calendar-side,
.chat-message,
.record-item,
.excel-import-box,
.share-toolbar,
#mySharepointListPanel,
#sharepointFTablePanel {
    background: var(--card-bg) !important;
    color: var(--app-text) !important;
    border-color: var(--border) !important;
    box-shadow: 0 12px 30px var(--shadow) !important;
}

.record-item,
.chat-box,
.calendar-event-item,
.reminder-item,
.share-grid input,
.share-grid select,
.share-section textarea,
.calendar-cell,
.mini-event {
    background: var(--card-soft) !important;
    color: var(--app-text) !important;
    border-color: var(--border) !important;
}

input,
textarea,
select {
    background: var(--input-bg) !important;
    color: var(--app-text) !important;
    border-color: var(--input-border) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted) !important;
}

.panel-title p,
.muted,
.card p,
.record-item small,
.chat-message small,
.list-panel-head p,
.table-panel-head p {
    color: var(--muted) !important;
}

button,
.card button,
.login-card button,
.chat-input-row button,
.share-actions button,
.calendar-nav button,
.calendar-side button,
.config-button-grid button,
.excel-import-row button,
.pin-row button,
.table-actions button {
    background: var(--accent) !important;
    color: #ffffff !important;
}

.secondary-btn,
.share-actions .secondary-btn,
.table-actions .secondary-btn,
.share-toolbar .secondary-btn,
.list-panel-head .secondary-btn {
    background: var(--card-soft) !important;
    color: var(--app-text) !important;
    border: 1px solid var(--border) !important;
}

.small-delete-btn,
.table-delete-btn,
.danger-btn,
.chat-delete-btn {
    background: var(--danger) !important;
    color: #ffffff !important;
}

.danger-soft-btn {
    background: color-mix(in srgb, var(--danger) 16%, var(--card-bg)) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.share-hero > div:first-child,
.share-hero-box,
.config-hero > div:first-child,
.config-hero-box,
.productivity-hero > div:first-child,
.productivity-hero-box,
.calendar-top > div:first-child {
    background: linear-gradient(135deg, var(--topbar-bg), var(--accent)) !important;
    color: #ffffff !important;
}

.calendar-weekdays,
.excel-table th {
    background: var(--topbar-bg) !important;
    color: #ffffff !important;
}

.excel-table td {
    background: var(--card-bg) !important;
    color: var(--app-text) !important;
    border-color: var(--border) !important;
}

.excel-table tr:nth-child(even) td {
    background: var(--card-soft) !important;
}

.calendar-cell.today {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    color: #ffffff !important;
}

.calendar-cell.selected {
    outline: 3px solid var(--accent) !important;
}

.data-chip,
.chat-group-badge,
.mini-fg,
.pill {
    background: color-mix(in srgb, var(--accent) 18%, var(--card-bg)) !important;
    color: var(--app-text) !important;
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border)) !important;
}

/* Keep config/code outputs readable */
.config-result {
    background: #050b14 !important;
    color: #dbeafe !important;
    border-color: #263244 !important;
}

/* Login page also follows selected theme after login page loads */
.login-body {
    background:
        radial-gradient(circle at top, var(--accent), transparent 32%),
        var(--topbar-bg) !important;
}

.login-card {
    background: var(--card-bg) !important;
    color: var(--app-text) !important;
}

/* Enhanced Admin Config Dataframe */
.admin-df-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 190px auto auto;
    gap: 10px;
    align-items: center;
    margin: 14px 0;
    direction: ltr !important;
}

.admin-df-search,
.admin-df-toolbar select {
    direction: ltr !important;
    text-align: left !important;
    margin: 0 !important;
    height: 42px;
}

.danger-outline-btn {
    border: 1px solid #ef4444 !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
    padding: 11px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: bold;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
}

.sortable-th:hover {
    filter: brightness(1.12);
}

.enhanced-df-table td.editable-cell {
    cursor: text;
    min-width: 150px;
}

.enhanced-df-table td.editable-cell:focus {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    background: #fff7ed !important;
    color: #111827 !important;
}

.enhanced-df-table td.readonly-cell {
    opacity: 0.78;
    font-weight: bold;
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.saving-cell {
    background: #fef3c7 !important;
}

.saved-cell {
    background: #dcfce7 !important;
}

.error-cell {
    background: #fee2e2 !important;
}

.actions-cell {
    text-align: center !important;
    position: sticky;
    right: 0;
    z-index: 1;
}

.admin-config-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    background: var(--app-bg, #0f172a) !important;
    padding: 18px !important;
    overflow: auto !important;
}

.admin-config-fullscreen .config-hero,
.admin-config-fullscreen > .card:first-of-type {
    display: none !important;
}

.admin-config-fullscreen .card {
    margin: 0 !important;
    height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
}

.admin-config-fullscreen .excel-table-wrap {
    max-height: none !important;
    flex: 1;
    height: 100% !important;
}

.admin-config-fullscreen .admin-df-toolbar {
    grid-template-columns: minmax(320px, 1fr) 220px auto auto;
}

.admin-config-fullscreen .enhanced-df-table {
    min-width: 2200px;
}

@media (max-width: 820px) {
    .admin-df-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-df-toolbar button,
    .admin-df-toolbar select,
    .admin-df-toolbar input {
        width: 100%;
    }
}

/* Optional person info before approving config */
.config-person-info {
    margin-top: 16px;
    background: var(--card-soft, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 18px;
    padding: 16px;
}

.config-person-info h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

.config-person-info p {
    color: var(--muted, #64748b);
    margin-top: 0;
}

.config-person-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.config-person-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: bold;
}

.config-person-grid input {
    margin: 0;
}

@media (max-width: 640px) {
    .config-person-grid {
        grid-template-columns: 1fr;
    }
}

/* Config Delivery Mode Switch */
.delivery-mode-box {
    margin: 14px 0 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border, #dbeafe);
    background: var(--card-soft, #f8fafc);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    direction: ltr !important;
}

.delivery-mode-box h3 {
    margin: 0 0 4px;
}

.delivery-mode-box p {
    margin: 0;
    color: var(--muted, #64748b);
}

.delivery-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.delivery-switch input {
    display: none;
}

.delivery-slider {
    width: 58px;
    height: 30px;
    border-radius: 999px;
    background: #2563eb;
    position: relative;
    transition: 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.delivery-slider::after {
    content: "";
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 999px;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.2s ease;
}

.delivery-switch input:checked + .delivery-slider {
    background: #f97316;
}

.delivery-switch input:checked + .delivery-slider::after {
    transform: translateX(28px);
}

.mode-modified {
    color: #2563eb;
}

.mode-raw {
    color: #f97316;
}

@media (max-width: 760px) {
    .delivery-mode-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Config Provider Availability Switch */
.provider-mode-box {
    margin: 14px 0 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border, #dbeafe);
    background: var(--card-soft, #f8fafc);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    direction: ltr !important;
}

.provider-mode-box h3 {
    margin: 0 0 4px;
}

.provider-mode-box p {
    margin: 0;
    color: var(--muted, #64748b);
}

.provider-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.provider-switch input {
    display: none;
}

.provider-slider {
    width: 58px;
    height: 30px;
    border-radius: 999px;
    background: #dc2626;
    position: relative;
    transition: 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.provider-slider::after {
    content: "";
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 999px;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.2s ease;
}

.provider-switch input:checked + .provider-slider {
    background: #16a34a;
}

.provider-switch input:checked + .provider-slider::after {
    transform: translateX(28px);
}

.provider-on {
    color: #16a34a;
}

.provider-off {
    color: #dc2626;
}

.provider-paused-box {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.provider-paused-box h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

.provider-paused-box p {
    margin: 0;
    line-height: 1.8;
}

.config-button-grid.provider-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.4);
}

@media (max-width: 760px) {
    .provider-mode-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Repair: stable config mode buttons */
.mode-toggle-btn {
    min-width: 190px;
    border: 0 !important;
    border-radius: 16px !important;
    padding: 13px 18px !important;
    color: white !important;
    font-weight: 900 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18) !important;
    transition: transform 0.15s ease, opacity 0.15s ease !important;
}

.mode-toggle-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.mode-toggle-btn:disabled {
    opacity: 0.6 !important;
    cursor: wait !important;
}

.provider-on-btn {
    background: #16a34a !important;
}

.provider-off-btn {
    background: #dc2626 !important;
}

.modified-btn {
    background: #2563eb !important;
}

.raw-btn {
    background: #f97316 !important;
}

/* Hide old broken slider pieces if any remained */
.provider-switch,
.delivery-switch,
.provider-slider,
.delivery-slider {
    display: none !important;
}

/* Final stable provider/delivery buttons */
.mode-toggle-btn {
    min-width: 190px;
    border: 0 !important;
    border-radius: 16px !important;
    padding: 13px 18px !important;
    color: white !important;
    font-weight: 900 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18) !important;
}

.mode-toggle-btn:disabled {
    opacity: 0.65 !important;
    cursor: wait !important;
}

.provider-on-btn {
    background: #16a34a !important;
}

.provider-off-btn {
    background: #dc2626 !important;
}

.modified-btn {
    background: #2563eb !important;
}

.raw-btn {
    background: #f97316 !important;
}

.provider-switch,
.delivery-switch,
.provider-slider,
.delivery-slider {
    display: none !important;
}

/* Append new configs safely */
.append-configs-card {
    margin-top: 18px;
}

.append-config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    direction: ltr !important;
}

.append-config-grid label,
.append-text-label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 800;
    color: var(--app-text, #e5e7eb);
}

.append-config-grid select {
    direction: ltr !important;
    text-align: left !important;
}

.append-text-label {
    margin-top: 14px;
}

.append-config-textarea {
    min-height: 210px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, monospace;
    font-size: 13px;
    margin-top: 8px;
}

.append-actions {
    direction: ltr !important;
}

@media (max-width: 900px) {
    .append-config-grid {
        grid-template-columns: 1fr;
    }
}

/* Config Statistics Dashboard */
.config-stats-box {
    margin: 14px 0 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border, #dbeafe);
    background: var(--card-soft, #f8fafc);
    direction: ltr !important;
}

.config-stats-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.config-stats-head h3 {
    margin: 0 0 4px;
    color: var(--app-text, #0f172a);
}

.config-stats-head p {
    margin: 0;
    color: var(--muted, #64748b);
}

.stats-legend {
    display: inline-flex;
    background: rgba(37, 99, 235, 0.12);
    color: var(--app-text, #0f172a);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.config-stats-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--card-bg, #ffffff);
}

.config-stats-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    direction: ltr !important;
    text-align: left !important;
}

.config-stats-table th {
    background: var(--topbar-bg, #0f172a);
    color: white;
    padding: 11px 10px;
    border: 1px solid var(--border, #334155);
    font-weight: 900;
    white-space: nowrap;
}

.config-stats-table td {
    padding: 10px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--card-bg, #ffffff);
    color: var(--app-text, #0f172a);
    white-space: nowrap;
    font-weight: 700;
}

.config-stats-table tr:nth-child(even) td {
    background: var(--card-soft, #f8fafc);
}

.stats-fg-name {
    font-weight: 900 !important;
    min-width: 160px;
}

.stats-total-cell {
    background: rgba(37, 99, 235, 0.10) !important;
}

.stats-all-row td {
    background: rgba(22, 163, 74, 0.14) !important;
    font-weight: 900 !important;
}

.stat-total {
    color: var(--app-text, #0f172a);
}

.stat-available {
    color: #16a34a;
}

.stat-assigned {
    color: #dc2626;
}

.stat-sep {
    color: var(--muted, #64748b);
    padding: 0 4px;
}

/* Final repair for config dataframe visibility */
.admin-config-table-scroll {
    width: 100%;
    max-height: 650px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.35);
}

.admin-config-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    direction: ltr !important;
    text-align: left !important;
    font-size: 13px;
}

.admin-config-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
    color: #e0f2fe;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    white-space: nowrap;
}

.admin-config-table td {
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--app-text, #e5e7eb);
    vertical-align: top;
    max-width: 420px;
}

.admin-config-table code {
    display: block;
    max-width: 420px;
    max-height: 90px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    direction: ltr !important;
    text-align: left !important;
}

.status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
}

.status-available {
    background: rgba(22, 163, 74, 0.16);
    color: #22c55e;
}

.status-assigned {
    background: rgba(220, 38, 38, 0.16);
    color: #f87171;
}

.empty-box {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
    color: var(--muted, #bfdbfe);
}

/* Restored config dataframe table */
.admin-config-table-scroll {
    width: 100%;
    max-height: 650px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.35);
}

.admin-config-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    direction: ltr !important;
    text-align: left !important;
    font-size: 13px;
}

.admin-config-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
    color: #e0f2fe;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    white-space: nowrap;
}

.admin-config-table td {
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--app-text, #e5e7eb);
    vertical-align: top;
    max-width: 420px;
}

.admin-config-table code {
    display: block;
    max-width: 420px;
    max-height: 90px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    direction: ltr !important;
    text-align: left !important;
}

.empty-box {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
    color: var(--muted, #bfdbfe);
}

/* Professional Messenger Chat */
.pro-chat-shell {
    display: flex;
    flex-direction: column;
    height: 72vh;
    min-height: 560px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.12), transparent 30%),
        rgba(15, 23, 42, 0.35);
    direction: ltr !important;
}

.pro-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.45);
    direction: rtl !important;
}

.pro-chat-header h2 {
    margin: 0;
    color: var(--app-text, #e0f2fe);
}

.pro-chat-header p {
    margin: 4px 0 0;
    color: var(--muted, #93c5fd);
}

.pro-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pro-chat-row {
    display: flex;
    width: 100%;
}

.pro-chat-row.own {
    justify-content: flex-end;
}

.pro-chat-row.incoming {
    justify-content: flex-start;
}

.pro-chat-bubble {
    max-width: min(680px, 78%);
    padding: 10px 12px;
    border-radius: 18px;
    color: #e5e7eb;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.pro-chat-row.own .pro-chat-bubble {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    border-bottom-right-radius: 5px;
}

.pro-chat-row.incoming .pro-chat-bubble {
    background: rgba(30, 41, 59, 0.92);
    border-bottom-left-radius: 5px;
}

.pro-chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    font-size: 12px;
    opacity: 0.85;
}

.pro-chat-meta span {
    font-weight: 900;
}

.pro-chat-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    direction: auto;
    text-align: start;
}

.pro-chat-quoted {
    border-inline-start: 4px solid rgba(255,255,255,0.55);
    padding: 7px 9px;
    margin: 6px 0 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pro-chat-quoted b {
    font-size: 12px;
}

.pro-chat-quoted span {
    font-size: 13px;
    opacity: 0.9;
    max-height: 42px;
    overflow: hidden;
}

.pro-chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pro-chat-bubble:hover .pro-chat-actions {
    opacity: 1;
}

.pro-chat-actions button {
    border: 0;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255,255,255,0.16);
    color: white;
}

.pro-chat-image {
    display: block;
    max-width: 320px;
    max-height: 260px;
    border-radius: 14px;
    margin-top: 8px;
    object-fit: cover;
}

.pro-chat-video {
    display: block;
    width: min(420px, 100%);
    max-height: 310px;
    border-radius: 14px;
    margin-top: 8px;
    background: black;
}

.pro-chat-file-name,
.pro-chat-document {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 9px 11px;
    border-radius: 12px;
    background: rgba(255,255,255,0.14);
    color: white;
    text-decoration: none;
    font-weight: 800;
}

.pro-chat-reply-preview,
.pro-chat-attachment-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.88);
    color: #e0f2fe;
}

.pro-chat-reply-preview p {
    margin: 3px 0 0;
    color: #bfdbfe;
}

.pro-chat-reply-preview button,
.pro-chat-attachment-preview button {
    border: 0;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 18px;
}

.pro-chat-emoji-box {
    grid-template-columns: repeat(5, 42px);
    gap: 7px;
    padding: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.92);
}

.pro-chat-emoji-box button {
    width: 42px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    font-size: 20px;
}

.pro-chat-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.72);
}

.pro-chat-form textarea {
    flex: 1;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    border-radius: 16px;
    padding: 12px 14px;
    direction: auto;
}

.pro-chat-icon-btn,
.pro-chat-send-btn {
    border: 0;
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
}

.pro-chat-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 20px;
}

.pro-chat-send-btn {
    padding: 0 18px;
    background: #14b8a6;
    color: white;
}

.pro-chat-file-btn {
    margin: 0;
}

@media (max-width: 700px) {
    .pro-chat-shell {
        height: 76vh;
        min-height: 500px;
    }

    .pro-chat-bubble {
        max-width: 88%;
    }

    .pro-chat-form {
        gap: 6px;
    }

    .pro-chat-send-btn {
        padding: 0 12px;
    }
}

/* Safety: professional chat v2 should not behave as global frame */
#professionalChatMount2 {
    margin-bottom: 20px;
}

/* Remove accidental old global mount visually */
body > #professionalChatMount,
.workspace > #professionalChatMount,
main > #professionalChatMount {
    display: none !important;
}

/* Final forced messenger UI */
.old-chat-hidden-by-messenger {
    display: none !important;
}

#forcedMessengerChat {
    margin: 18px 0 22px;
}

#forcedMessengerChat .pro-chat-messages {
    min-height: 430px;
}

/* Safe chat collapse button */
.safe-chat-collapse-btn {
    border: 1px solid rgba(255,255,255,0.22);
    background: #14b8a6;
    color: white;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.safe-chat-collapse-btn:hover {
    opacity: 0.92;
}

#forcedMessengerChat.safe-chat-collapsed {
    height: auto !important;
    min-height: 0 !important;
}

#forcedMessengerChat.safe-chat-collapsed .pro-chat-messages,
#forcedMessengerChat.safe-chat-collapsed .pro-chat-reply-preview,
#forcedMessengerChat.safe-chat-collapsed .pro-chat-emoji-box,
#forcedMessengerChat.safe-chat-collapsed .pro-chat-attachment-preview,
#forcedMessengerChat.safe-chat-collapsed .pro-chat-form {
    display: none !important;
}

#forcedMessengerChat.safe-chat-collapsed .pro-chat-header {
    border-bottom: 0 !important;
}

/* Reminder delete button */
.delete-reminder-safe-btn {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: white;
    font-weight: 900;
    cursor: pointer;
    margin-top: 10px;
    margin-inline-start: 8px;
}

.delete-reminder-safe-btn:hover {
    opacity: 0.9;
}

/* Deletable reminders/notes panel */
.deletable-notes-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
    direction: rtl;
}

.deletable-notes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.deletable-notes-head h2 {
    margin: 0 0 4px;
    color: var(--app-text, #e0f2fe);
}

.deletable-notes-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.deletable-notes-head button,
.deletable-note-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 900;
    cursor: pointer;
    color: white;
}

.deletable-notes-head button {
    background: #14b8a6;
}

.deletable-note-delete-btn {
    background: #dc2626;
    min-width: 74px;
}

.deletable-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deletable-note-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.deletable-note-content strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 17px;
    margin-bottom: 6px;
}

.deletable-note-content p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.deletable-note-content small {
    color: var(--muted, #93c5fd);
}

/* Chat stabilizer safety */
body:not(.chat-active-final) #professionalChatMount,
body:not(.chat-active-final) #professionalChatMount2 {
    display: none !important;
}

/* Global floating messenger */
#forcedMessengerChat,
#professionalChatMount,
#professionalChatMount2 {
    display: none !important;
}

.global-chat-dock {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 99999;
    direction: rtl;
    font-family: inherit;
}

.global-chat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 18px 45px rgba(0,0,0,0.30);
}

.global-chat-panel {
    display: none;
    width: 430px;
    height: 640px;
    max-height: calc(100vh - 90px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}

.global-chat-dock.open .global-chat-toggle {
    display: none;
}

.global-chat-dock.open .global-chat-panel {
    display: flex;
    flex-direction: column;
}

.global-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(15, 23, 42, 0.9));
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.global-chat-header h3 {
    margin: 0;
    color: #e0f2fe;
    font-size: 20px;
    font-weight: 950;
}

.global-chat-header p {
    margin: 4px 0 0;
    color: #93c5fd;
    font-size: 12px;
}

.global-chat-head-actions {
    display: flex;
    gap: 8px;
}

.global-chat-head-actions button {
    border: 0;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    background: rgba(255,255,255,0.14);
    color: white;
    font-weight: 900;
    font-size: 18px;
}

.global-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(2, 6, 23, 0.35);
}

.global-chat-row {
    display: flex;
    width: 100%;
}

.global-chat-row.own {
    justify-content: flex-end;
}

.global-chat-row.incoming {
    justify-content: flex-start;
}

.global-chat-bubble {
    max-width: 82%;
    padding: 9px 11px;
    border-radius: 17px;
    color: #e5e7eb;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.global-chat-row.own .global-chat-bubble {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    border-bottom-right-radius: 5px;
}

.global-chat-row.incoming .global-chat-bubble {
    background: rgba(51, 65, 85, 0.92);
    border-bottom-left-radius: 5px;
}

.global-chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 11px;
    opacity: 0.85;
}

.global-chat-meta span {
    font-weight: 900;
}

.global-chat-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    direction: auto;
    text-align: start;
}

.global-chat-quoted {
    border-inline-start: 4px solid rgba(255,255,255,0.55);
    padding: 7px 9px;
    margin: 6px 0 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.global-chat-actions {
    display: flex;
    gap: 7px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.global-chat-bubble:hover .global-chat-actions {
    opacity: 1;
}

.global-chat-actions button {
    border: 0;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255,255,255,0.16);
    color: white;
}

.global-chat-image {
    display: block;
    max-width: 250px;
    max-height: 220px;
    border-radius: 13px;
    margin-top: 8px;
    object-fit: cover;
}

.global-chat-video {
    display: block;
    width: min(310px, 100%);
    max-height: 240px;
    border-radius: 13px;
    margin-top: 8px;
    background: black;
}

.global-chat-file-name,
.global-chat-document {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.14);
    color: white;
    text-decoration: none;
    font-weight: 800;
}

.global-chat-reply-preview,
.global-chat-attachment-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.88);
    color: #e0f2fe;
}

.global-chat-reply-preview p {
    margin: 3px 0 0;
    color: #bfdbfe;
}

.global-chat-reply-preview button,
.global-chat-attachment-preview button {
    border: 0;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 18px;
}

.global-chat-emoji-box {
    grid-template-columns: repeat(5, 38px);
    gap: 6px;
    padding: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.92);
}

.global-chat-emoji-box button {
    width: 38px;
    height: 35px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    font-size: 19px;
}

.global-chat-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.88);
}

.global-chat-form textarea {
    flex: 1;
    resize: none;
    max-height: 110px;
    min-height: 42px;
    border-radius: 15px;
    padding: 11px 12px;
    direction: auto;
}

.global-chat-icon-btn,
.global-chat-send-btn {
    border: 0;
    min-width: 42px;
    height: 42px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
}

.global-chat-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 19px;
}

.global-chat-send-btn {
    padding: 0 14px;
    background: #14b8a6;
    color: white;
}

@media (max-width: 700px) {
    .global-chat-dock {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .global-chat-panel {
        width: 100%;
        height: 78vh;
        max-height: 78vh;
    }

    .global-chat-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* FG shared calendar display repair */
.fg-shared-calendar-box {
    margin-top: 22px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
    direction: rtl;
}

.fg-shared-calendar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.fg-shared-calendar-head h2 {
    margin: 0 0 5px;
    color: var(--app-text, #e0f2fe);
}

.fg-shared-calendar-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.fg-shared-calendar-head button,
.fg-calendar-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    color: white;
    font-weight: 900;
    cursor: pointer;
}

.fg-shared-calendar-head button {
    background: #14b8a6;
}

.fg-calendar-delete-btn {
    background: #dc2626;
    min-width: 72px;
}

.fg-shared-calendar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fg-calendar-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.fg-calendar-event-card strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 17px;
    margin-bottom: 5px;
}

.fg-calendar-event-card p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.fg-calendar-event-card small,
.fg-calendar-event-card em {
    display: block;
    color: var(--muted, #93c5fd);
    font-style: normal;
}

/* FG calendar day title chips */
.fg-calendar-day-has-event {
    position: relative !important;
    overflow: hidden !important;
    box-shadow: inset 0 0 0 2px rgba(14, 165, 233, 0.55) !important;
}

.fg-calendar-events-in-day {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 5;
    pointer-events: none;
}

.fg-calendar-title-chip,
.fg-calendar-more-chip {
    width: 100%;
    border-radius: 8px;
    padding: 2px 5px;
    background: rgba(15, 23, 42, 0.76);
    color: #e0f2fe;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.18);
}

.fg-calendar-more-chip {
    background: rgba(20, 184, 166, 0.8);
    color: white;
}

/* Realtime UX toast */
.realtime-ux-toast {
    position: fixed;
    bottom: 92px;
    left: 28px;
    z-index: 100000;
    background: rgba(20, 184, 166, 0.96);
    color: white;
    font-weight: 950;
    padding: 11px 17px;
    border-radius: 999px;
    box-shadow: 0 16px 42px rgba(0,0,0,0.28);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.realtime-ux-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Safe action refresh toast */
.realtime-ux-toast {
    position: fixed;
    bottom: 92px;
    left: 28px;
    z-index: 100000;
    background: rgba(20, 184, 166, 0.96);
    color: white;
    font-weight: 950;
    padding: 11px 17px;
    border-radius: 999px;
    box-shadow: 0 16px 42px rgba(0,0,0,0.28);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.realtime-ux-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* SH attachments */
.sh-attachments-panel {
    margin-top: 22px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
    direction: rtl;
}

.sh-attachments-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.sh-attachments-head h2 {
    margin: 0 0 5px;
    color: var(--app-text, #e0f2fe);
}

.sh-attachments-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.sh-attachments-head button,
.sh-attachment-upload-btn,
.sh-attachment-delete-btn,
.export-sh-zip-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    color: white;
    font-weight: 900;
    cursor: pointer;
}

.sh-attachments-head button,
.sh-attachment-upload-btn,
.export-sh-zip-btn {
    background: #14b8a6;
}

.export-sh-zip-btn {
    margin-bottom: 14px;
    display: inline-flex;
}

.sh-attachment-delete-btn {
    background: #dc2626;
}

.sh-attachments-records {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sh-attachment-record-card {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.sh-attachment-record-main strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 17px;
    margin-bottom: 5px;
}

.sh-attachment-record-main small {
    display: block;
    color: var(--muted, #93c5fd);
}

.sh-attachment-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
    align-items: center;
}

.sh-attachment-file-input {
    max-width: 360px;
    color: var(--app-text, #e0f2fe);
}

.sh-attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sh-attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    padding: 10px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.28);
}

.sh-attachment-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
}

.sh-attachment-info {
    flex: 1;
    min-width: 0;
}

.sh-attachment-info a {
    display: block;
    color: #bae6fd;
    font-weight: 900;
    text-decoration: none;
    word-break: break-word;
}

.sh-attachment-info small,
.sh-attachment-empty {
    color: var(--muted, #93c5fd);
}

/* Refined SH UI */
#shAttachmentsPanel {
    display: none !important;
}

.refined-sh-forms-box {
    margin-top: 24px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(15, 23, 42, 0.18);
    direction: rtl;
}

.refined-sh-forms-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.refined-sh-forms-head h2 {
    margin: 0 0 6px;
    color: var(--app-text, #e0f2fe);
    font-size: 21px;
    font-weight: 950;
}

.refined-sh-forms-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.refined-sh-forms-head button,
.refined-sh-upload-btn,
.refined-sh-delete-attachment,
.export-sh-zip-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.refined-sh-forms-head button,
.refined-sh-upload-btn,
.export-sh-zip-btn {
    background: #14b8a6;
}

.refined-sh-delete-attachment {
    background: #dc2626;
}

.export-sh-zip-btn.refined-sh-listf-only {
    margin-bottom: 14px;
    display: inline-flex;
}

.refined-sh-forms-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.refined-sh-form-card {
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.045);
}

.refined-sh-form-top strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 18px;
    margin-bottom: 6px;
}

.refined-sh-form-top p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.refined-sh-form-top small {
    color: var(--muted, #93c5fd);
}

.refined-sh-attachment-area {
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px dashed rgba(148, 163, 184, 0.35);
}

.refined-sh-attachment-title {
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
    margin-bottom: 10px;
}

.refined-sh-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.refined-sh-file-input {
    max-width: 420px;
    color: var(--app-text, #e0f2fe);
}

.refined-sh-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.refined-sh-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.045);
}

.refined-sh-thumb,
.refined-sh-file-icon {
    width: 58px;
    height: 58px;
    border-radius: 13px;
    flex: 0 0 58px;
}

.refined-sh-thumb {
    object-fit: cover;
}

.refined-sh-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 25px;
}

.refined-sh-attachment-info {
    flex: 1;
    min-width: 0;
}

.refined-sh-attachment-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.refined-sh-attachment-info small,
.refined-sh-empty {
    color: var(--muted, #93c5fd);
}

/* Final SH inline attachment UI */
#shAttachmentsPanel,
#refinedSHFormsBox {
    display: none !important;
}

.final-sh-inline-box {
    margin: 22px 0;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.36);
    background: rgba(15, 23, 42, 0.20);
    direction: rtl;
}

.final-sh-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.final-sh-inline-head h2 {
    margin: 0 0 6px;
    color: var(--app-text, #e0f2fe);
    font-size: 22px;
    font-weight: 950;
}

.final-sh-inline-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.final-sh-inline-head button,
.final-sh-upload-btn,
.final-sh-att-delete,
.export-sh-zip-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.final-sh-inline-head button,
.final-sh-upload-btn,
.export-sh-zip-btn {
    background: #14b8a6;
}

.final-sh-att-delete {
    background: #dc2626;
}

.final-sh-forms-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.final-sh-form-card {
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: rgba(255, 255, 255, 0.045);
}

.final-sh-form-title strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 18px;
    margin-bottom: 6px;
}

.final-sh-form-title p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.final-sh-form-title small {
    color: var(--muted, #93c5fd);
}

.final-sh-attach-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
    padding: 12px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.36);
    background: rgba(15, 23, 42, 0.24);
}

.final-sh-file-input {
    max-width: 420px;
    color: var(--app-text, #e0f2fe);
}

.final-sh-att-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.final-sh-att-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.28);
}

.final-sh-thumb,
.final-sh-file-icon {
    width: 58px;
    height: 58px;
    border-radius: 13px;
    flex: 0 0 58px;
}

.final-sh-thumb {
    object-fit: cover;
}

.final-sh-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 25px;
}

.final-sh-att-info {
    flex: 1;
    min-width: 0;
}

.final-sh-att-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.final-sh-att-info small,
.final-sh-empty {
    color: var(--muted, #93c5fd);
}

.export-sh-zip-btn.final-sh-listf-only {
    margin-bottom: 14px;
    display: inline-flex;
}

/* Force SH attachments/submitted forms section centered under the main SH form */
#finalSHInlineAttachmentsBox.final-sh-centered-fixed,
#finalSHInlineAttachmentsBox {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin: 24px auto !important;
    display: block !important;
    clear: both !important;
    float: none !important;
    position: relative !important;
    right: auto !important;
    left: auto !important;
    grid-column: 1 / -1 !important;
    align-self: stretch !important;
}

#finalSHInlineAttachmentsBox .final-sh-forms-list {
    width: 100% !important;
}

#finalSHInlineAttachmentsBox .final-sh-form-card {
    width: 100% !important;
    box-sizing: border-box !important;
}

#finalSHInlineAttachmentsBox .final-sh-inline-head {
    text-align: right !important;
}

/* SH attachments separate tab */
#finalSHInlineAttachmentsBox,
#refinedSHFormsBox,
#shAttachmentsPanel {
    display: none !important;
}

.sh-attachments-tab-page {
    width: min(100%, 980px);
    margin: 0 auto;
    direction: rtl;
}

.sh-attachments-tab-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px;
    margin-bottom: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.20);
}

.sh-attachments-tab-head h1 {
    margin: 0 0 8px;
    color: var(--app-text, #e0f2fe);
    font-size: 28px;
    font-weight: 950;
}

.sh-attachments-tab-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.sh-attachments-tab-head button,
.sh-tab-upload-btn,
.sh-tab-att-delete {
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.sh-attachments-tab-head button,
.sh-tab-upload-btn {
    background: #14b8a6;
}

.sh-tab-att-delete {
    background: #dc2626;
}

.sh-attachments-tab-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sh-tab-form-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.045);
}

.sh-tab-form-title strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 20px;
    margin-bottom: 6px;
}

.sh-tab-form-title p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.sh-tab-form-title small,
.sh-tab-empty {
    color: var(--muted, #93c5fd);
}

.sh-tab-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 13px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.25);
}

.sh-tab-file-input {
    color: var(--app-text, #e0f2fe);
    max-width: 450px;
}

.sh-tab-att-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.sh-tab-att-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.28);
}

.sh-tab-thumb,
.sh-tab-file-icon {
    width: 60px;
    height: 60px;
    border-radius: 13px;
    flex: 0 0 60px;
}

.sh-tab-thumb {
    object-fit: cover;
}

.sh-tab-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 26px;
}

.sh-tab-att-info {
    flex: 1;
    min-width: 0;
}

.sh-tab-att-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.sh-tab-att-info small {
    display: block;
    color: var(--muted, #93c5fd);
}

/* Kill all old misplaced SH attachment panels */
#finalSHInlineAttachmentsBox,
#refinedSHFormsBox,
#shAttachmentsPanel,
#sh_attachments_tab {
    display: none !important;
}

/* Real SH attachments workspace tab */
#realSHAttachmentsWorkspaceTab {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 20px 24px 60px !important;
    box-sizing: border-box !important;
    direction: rtl !important;
    float: none !important;
    clear: both !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
}

.real-sh-att-page {
    width: min(100%, 1040px) !important;
    margin: 0 auto !important;
}

.real-sh-att-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
}

.real-sh-att-head h1 {
    margin: 0 0 8px;
    color: var(--app-text, #e0f2fe);
    font-size: 30px;
    font-weight: 950;
}

.real-sh-att-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.real-sh-att-head button,
.real-sh-upload-btn,
.real-sh-delete-att {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.real-sh-att-head button,
.real-sh-upload-btn {
    background: #14b8a6;
}

.real-sh-delete-att {
    background: #dc2626;
}

.real-sh-att-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.real-sh-form-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.045);
}

.real-sh-form-info strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 20px;
    margin-bottom: 6px;
}

.real-sh-form-info p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.real-sh-form-info small,
.real-sh-empty {
    color: var(--muted, #93c5fd);
}

.real-sh-empty-big {
    padding: 18px;
    border-radius: 18px;
    background: rgba(15,23,42,0.28);
    border: 1px solid rgba(148,163,184,0.28);
}

.real-sh-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 13px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.25);
}

.real-sh-file-input {
    color: var(--app-text, #e0f2fe);
    max-width: 460px;
}

.real-sh-card-attachments {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.real-sh-att-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.28);
}

.real-sh-thumb,
.real-sh-file-icon {
    width: 60px;
    height: 60px;
    border-radius: 13px;
    flex: 0 0 60px;
}

.real-sh-thumb {
    object-fit: cover;
}

.real-sh-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 26px;
}

.real-sh-att-info {
    flex: 1;
    min-width: 0;
}

.real-sh-att-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.real-sh-att-info small {
    display: block;
    color: var(--muted, #93c5fd);
}

.real-sh-att-nav-btn {
    width: 100%;
    margin-top: 10px;
}

/* Clean SH attachments tab reset */
#finalSHInlineAttachmentsBox,
#refinedSHFormsBox,
#shAttachmentsPanel,
#sh_attachments_tab,
#realSHAttachmentsWorkspaceTab {
    display: none !important;
}

.clean-sh-att-nav-btn {
    width: 100% !important;
    margin-top: 10px !important;
}

#cleanSHAttachmentsWorkspacePanel {
    width: 100% !important;
    max-width: none !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    direction: rtl !important;
    float: none !important;
    clear: both !important;
}

.clean-sh-att-page {
    width: min(100%, 1040px) !important;
    margin: 0 auto !important;
}

.clean-sh-att-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
}

.clean-sh-att-head h1 {
    margin: 0 0 8px;
    color: var(--app-text, #e0f2fe);
    font-size: 30px;
    font-weight: 950;
}

.clean-sh-att-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.clean-sh-att-head button,
.clean-sh-upload-btn,
.clean-sh-delete-att {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.clean-sh-att-head button,
.clean-sh-upload-btn {
    background: #14b8a6;
}

.clean-sh-delete-att {
    background: #dc2626;
}

.clean-sh-att-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.clean-sh-form-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.045);
}

.clean-sh-form-info strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 20px;
    margin-bottom: 6px;
}

.clean-sh-form-info p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.clean-sh-form-info small,
.clean-sh-empty {
    color: var(--muted, #93c5fd);
}

.clean-sh-empty-big {
    padding: 18px;
    border-radius: 18px;
    background: rgba(15,23,42,0.28);
    border: 1px solid rgba(148,163,184,0.28);
}

.clean-sh-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 13px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.25);
}

.clean-sh-file-input {
    color: var(--app-text, #e0f2fe);
    max-width: 460px;
}

.clean-sh-card-attachments {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.clean-sh-att-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.28);
}

.clean-sh-thumb,
.clean-sh-file-icon {
    width: 60px;
    height: 60px;
    border-radius: 13px;
    flex: 0 0 60px;
}

.clean-sh-thumb {
    object-fit: cover;
}

.clean-sh-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 26px;
}

.clean-sh-att-info {
    flex: 1;
    min-width: 0;
}

.clean-sh-att-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.clean-sh-att-info small {
    display: block;
    color: var(--muted, #93c5fd);
}

/* Final normal SH attachments tab */
#finalSHInlineAttachmentsBox,
#refinedSHFormsBox,
#shAttachmentsPanel,
#sh_attachments_tab,
#realSHAttachmentsWorkspaceTab,
#cleanSHAttachmentsWorkspacePanel {
    display: none !important;
}

.final-normal-sh-nav-btn {
    width: 100% !important;
    margin-top: 10px !important;
}

#finalNormalSHAttachmentsPanel {
    position: fixed !important;
    top: 66px !important;
    left: 0 !important;
    right: 205px !important;
    bottom: 0 !important;
    z-index: 5000 !important;
    overflow-y: auto !important;
    padding: 28px 24px 70px !important;
    box-sizing: border-box !important;
    background: var(--app-bg, #17170f) !important;
    direction: rtl !important;
}

.final-normal-sh-page {
    width: min(100%, 1040px) !important;
    margin: 0 auto !important;
}

.final-normal-sh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
}

.final-normal-sh-head h1 {
    margin: 0 0 8px;
    color: var(--app-text, #e0f2fe);
    font-size: 30px;
    font-weight: 950;
}

.final-normal-sh-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.final-normal-sh-head button,
.final-normal-sh-upload-btn,
.final-normal-sh-delete-att {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.final-normal-sh-head button,
.final-normal-sh-upload-btn {
    background: #14b8a6;
}

.final-normal-sh-delete-att {
    background: #dc2626;
}

.final-normal-sh-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.final-normal-sh-form-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.045);
}

.final-normal-sh-form-info strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 20px;
    margin-bottom: 6px;
}

.final-normal-sh-form-info p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.final-normal-sh-form-info small,
.final-normal-sh-empty {
    color: var(--muted, #93c5fd);
}

.final-normal-sh-empty-big {
    padding: 18px;
    border-radius: 18px;
    background: rgba(15,23,42,0.28);
    border: 1px solid rgba(148,163,184,0.28);
}

.final-normal-sh-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 13px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.25);
}

.final-normal-sh-file-input {
    color: var(--app-text, #e0f2fe);
    max-width: 460px;
}

.final-normal-sh-card-attachments {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.final-normal-sh-att-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.28);
}

.final-normal-sh-thumb,
.final-normal-sh-file-icon {
    width: 60px;
    height: 60px;
    border-radius: 13px;
    flex: 0 0 60px;
}

.final-normal-sh-thumb {
    object-fit: cover;
}

.final-normal-sh-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 26px;
}

.final-normal-sh-att-info {
    flex: 1;
    min-width: 0;
}

.final-normal-sh-att-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.final-normal-sh-att-info small {
    display: block;
    color: var(--muted, #93c5fd);
}

@media (max-width: 900px) {
    #finalNormalSHAttachmentsPanel {
        right: 0 !important;
        top: 60px !important;
    }
}

/* Final normal SH attachments tab */
#finalSHInlineAttachmentsBox,
#refinedSHFormsBox,
#shAttachmentsPanel,
#sh_attachments_tab,
#realSHAttachmentsWorkspaceTab,
#cleanSHAttachmentsWorkspacePanel {
    display: none !important;
}

.final-normal-sh-nav-btn {
    width: 100% !important;
    margin-top: 10px !important;
}

#finalNormalSHAttachmentsPanel {
    position: fixed !important;
    top: 66px !important;
    left: 0 !important;
    right: 205px !important;
    bottom: 0 !important;
    z-index: 5000 !important;
    overflow-y: auto !important;
    padding: 28px 24px 70px !important;
    box-sizing: border-box !important;
    background: var(--app-bg, #17170f) !important;
    direction: rtl !important;
}

.final-normal-sh-page {
    width: min(100%, 1040px) !important;
    margin: 0 auto !important;
}

.final-normal-sh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.22);
}

.final-normal-sh-head h1 {
    margin: 0 0 8px;
    color: var(--app-text, #e0f2fe);
    font-size: 30px;
    font-weight: 950;
}

.final-normal-sh-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.final-normal-sh-head button,
.final-normal-sh-upload-btn,
.final-normal-sh-delete-att {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.final-normal-sh-head button,
.final-normal-sh-upload-btn {
    background: #14b8a6;
}

.final-normal-sh-delete-att {
    background: #dc2626;
}

.final-normal-sh-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.final-normal-sh-form-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.045);
}

.final-normal-sh-form-info strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 20px;
    margin-bottom: 6px;
}

.final-normal-sh-form-info p {
    margin: 0 0 6px;
    color: var(--muted, #bfdbfe);
}

.final-normal-sh-form-info small,
.final-normal-sh-empty {
    color: var(--muted, #93c5fd);
}

.final-normal-sh-empty-big {
    padding: 18px;
    border-radius: 18px;
    background: rgba(15,23,42,0.28);
    border: 1px solid rgba(148,163,184,0.28);
}

.final-normal-sh-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 13px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.25);
}

.final-normal-sh-file-input {
    color: var(--app-text, #e0f2fe);
    max-width: 460px;
}

.final-normal-sh-card-attachments {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.final-normal-sh-att-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: 10px;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.28);
}

.final-normal-sh-thumb,
.final-normal-sh-file-icon {
    width: 60px;
    height: 60px;
    border-radius: 13px;
    flex: 0 0 60px;
}

.final-normal-sh-thumb {
    object-fit: cover;
}

.final-normal-sh-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.18);
    font-size: 26px;
}

.final-normal-sh-att-info {
    flex: 1;
    min-width: 0;
}

.final-normal-sh-att-info a {
    color: #bae6fd;
    text-decoration: none;
    font-weight: 950;
    word-break: break-word;
}

.final-normal-sh-att-info small {
    display: block;
    color: var(--muted, #93c5fd);
}

@media (max-width: 900px) {
    #finalNormalSHAttachmentsPanel {
        right: 0 !important;
        top: 60px !important;
    }
}

/* Final SH ZIP export button */
.export-sh-zip-final-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    margin-inline-start: 10px;
    background: #f59e0b;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.export-sh-zip-final-btn:hover {
    opacity: 0.92;
}

/* SH edit form button and modal */
.sh-edit-form-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #6366f1;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.sh-edit-form-btn:hover {
    opacity: 0.92;
}

.sh-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 120000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.58);
    direction: rtl;
}

.sh-edit-modal.show {
    display: flex;
}

.sh-edit-modal-card {
    width: min(100%, 1050px);
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 22px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

.sh-edit-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.sh-edit-modal-head h2 {
    margin: 0 0 6px;
    color: #e0f2fe;
    font-size: 26px;
    font-weight: 950;
}

.sh-edit-modal-head p {
    margin: 0;
    color: #93c5fd;
}

#shEditModalClose {
    border: 0;
    border-radius: 999px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.14);
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.sh-edit-title-row {
    margin-bottom: 14px;
}

.sh-edit-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.sh-edit-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sh-edit-field span {
    color: #bfdbfe;
    font-weight: 900;
}

.sh-edit-field input,
.sh-edit-field textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255,255,255,0.06);
    color: #e0f2fe;
    padding: 10px 12px;
    outline: none;
    font-family: inherit;
}

.sh-edit-field textarea {
    resize: vertical;
}

.sh-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: flex-start;
}

#shEditSaveBtn,
#shEditCancelBtn {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

#shEditSaveBtn {
    background: #14b8a6;
}

#shEditCancelBtn {
    background: #64748b;
}

.sh-edit-empty {
    color: #93c5fd;
}

@media (max-width: 800px) {
    .sh-edit-fields-grid {
        grid-template-columns: 1fr;
    }
}

/* Secure SH ZIP export UI */
.secure-sh-zip-box {
    margin: 14px 0 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(245, 158, 11, 0.38);
    background: rgba(245, 158, 11, 0.08);
    direction: rtl;
}

.secure-sh-zip-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.secure-sh-zip-title strong {
    color: #fde68a;
    font-size: 18px;
    font-weight: 950;
}

.secure-sh-zip-title span {
    color: #bfdbfe;
}

.secure-sh-zip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#secureSHZipPasswordInput {
    min-width: 260px;
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255,255,255,0.06);
    color: #e0f2fe;
    padding: 11px 14px;
    outline: none;
}

#secureSHZipGenerateBtn,
#secureSHZipCustomBtn,
#copySecureSHZipPassword {
    border: 0;
    border-radius: 999px;
    padding: 10px 15px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

#secureSHZipGenerateBtn {
    background: #f59e0b;
}

#secureSHZipCustomBtn {
    background: #14b8a6;
}

#copySecureSHZipPassword {
    background: #6366f1;
    margin-inline-start: 8px;
}

.secure-sh-zip-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.38);
    color: #e0f2fe;
}

.secure-sh-zip-result code {
    display: inline-block;
    direction: ltr;
    text-align: left;
    background: rgba(0,0,0,0.35);
    padding: 8px 10px;
    border-radius: 10px;
    color: #fde68a;
    font-weight: 950;
    letter-spacing: 0.5px;
}

.secure-sh-zip-warning {
    margin-top: 8px;
    color: #fca5a5;
    font-weight: 800;
}

/* Fast SH List F renderer */
.fast-sh-listf-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.20);
    direction: rtl;
}

.fast-sh-listf-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.fast-sh-listf-head h2 {
    margin: 0 0 5px;
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
}

.fast-sh-listf-head p,
.fast-sh-listf-status,
.fast-sh-listf-empty {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.fast-sh-listf-head button {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.fast-sh-listf-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.fast-sh-listf-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    color: var(--app-text, #e0f2fe);
}

.fast-sh-listf-table th,
.fast-sh-listf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.fast-sh-listf-table th {
    background: rgba(20, 184, 166, 0.22);
    font-weight: 950;
}

.fast-sh-listf-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.035);
}

/* Move fast SH List F table upward and make it feel part of export area */
.fast-sh-listf-box.fast-sh-listf-box-up {
    margin-top: 16px !important;
    margin-bottom: 18px !important;
}

.fast-sh-listf-box-up .fast-sh-listf-head {
    margin-bottom: 10px !important;
}

/* Admin SH List F reliable table */
.admin-sh-listf-box {
    margin: 16px 0 18px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.20);
    direction: rtl;
}

.admin-sh-listf-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.admin-sh-listf-head h2 {
    margin: 0 0 5px;
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
}

.admin-sh-listf-head p,
.admin-sh-listf-status,
.admin-sh-listf-empty {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.admin-sh-listf-head button {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.admin-sh-listf-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-sh-listf-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    color: var(--app-text, #e0f2fe);
}

.admin-sh-listf-table th,
.admin-sh-listf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.admin-sh-listf-table th {
    background: rgba(20, 184, 166, 0.22);
    font-weight: 950;
}

.admin-sh-listf-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.035);
}

.admin-sh-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

/* Force SH List F table renderer */
.force-sh-listf-mount {
    margin-top: 16px;
    direction: rtl;
}

.force-sh-listf-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.force-sh-listf-headline strong {
    display: block;
    color: var(--app-text, #e0f2fe);
    font-size: 19px;
    font-weight: 950;
}

.force-sh-listf-headline span,
.force-sh-listf-status,
.force-sh-listf-empty {
    color: var(--muted, #93c5fd);
}

#forceSHListFRefreshBtn {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.force-sh-listf-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.force-sh-listf-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    color: var(--app-text, #e0f2fe);
}

.force-sh-listf-table th,
.force-sh-listf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.force-sh-listf-table th {
    background: rgba(20, 184, 166, 0.22);
    font-weight: 950;
}

.force-sh-listf-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.035);
}

.force-sh-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.force-sh-listf-error {
    color: #fca5a5;
    padding: 14px;
    border-radius: 14px;
    background: rgba(127, 29, 29, 0.18);
}

/* Keep only one SH List F table */
#fastSHListFRendererBox,
#adminSHListFTableBox,
.fast-sh-listf-box,
.admin-sh-listf-box {
    display: none !important;
}

.unified-sh-listf-box {
    margin: 16px 0 18px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.20);
    direction: rtl;
}

.unified-sh-listf-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.unified-sh-listf-head h2 {
    margin: 0 0 5px;
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
}

.unified-sh-listf-head p,
.unified-sh-listf-status,
.unified-sh-empty {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.unified-sh-listf-head button {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.unified-sh-listf-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.unified-sh-listf-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    color: var(--app-text, #e0f2fe);
}

.unified-sh-listf-table th,
.unified-sh-listf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.unified-sh-listf-table th {
    background: rgba(20, 184, 166, 0.22);
    font-weight: 950;
}

.unified-sh-listf-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.035);
}

.unified-sh-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

/* Unified SH List F export controls */
.unified-sh-export-box {
    margin: 16px 0 18px;
    padding: 17px;
    border-radius: 20px;
    border: 1px solid rgba(20, 184, 166, 0.35);
    background: rgba(15, 23, 42, 0.22);
    direction: rtl;
}

.unified-sh-export-head {
    margin-bottom: 12px;
}

.unified-sh-export-head h2 {
    margin: 0 0 6px;
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
}

.unified-sh-export-head p {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.unified-sh-export-row,
.unified-sh-secure-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#unifiedSHExcelExportBtn,
#unifiedSHZipExportBtn,
#unifiedSHZipGeneratedBtn,
#unifiedSHZipCustomBtn,
#copyUnifiedSHZipPassword {
    border: 0;
    border-radius: 999px;
    padding: 10px 15px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

#unifiedSHExcelExportBtn {
    background: #14b8a6;
}

#unifiedSHZipExportBtn {
    background: #0ea5e9;
}

.unified-sh-secure-export {
    margin-top: 14px;
    padding: 14px;
    border-radius: 17px;
    border: 1px solid rgba(245, 158, 11, 0.36);
    background: rgba(245, 158, 11, 0.08);
}

.unified-sh-secure-export strong {
    display: block;
    color: #fde68a;
    font-size: 17px;
    font-weight: 950;
    margin-bottom: 4px;
}

.unified-sh-secure-export p {
    margin: 0 0 11px;
    color: #bfdbfe;
}

#unifiedSHZipPasswordInput {
    min-width: 260px;
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255,255,255,0.06);
    color: #e0f2fe;
    padding: 11px 14px;
    outline: none;
}

#unifiedSHZipGeneratedBtn {
    background: #f59e0b;
}

#unifiedSHZipCustomBtn {
    background: #14b8a6;
}

#copyUnifiedSHZipPassword {
    background: #6366f1;
    margin-inline-start: 8px;
}

.unified-sh-password-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.38);
    color: #e0f2fe;
}

.unified-sh-password-result code {
    display: inline-block;
    direction: ltr;
    text-align: left;
    background: rgba(0,0,0,0.35);
    padding: 8px 10px;
    border-radius: 10px;
    color: #fde68a;
    font-weight: 950;
    letter-spacing: 0.5px;
}

.unified-sh-password-warning {
    margin-top: 8px;
    color: #fca5a5;
    font-weight: 800;
}

/* FINAL: hide duplicate SH List F tables */
#fastSHListFRendererBox,
#adminSHListFTableBox,
#forceSHListFTableMount,
#unifiedSHListFTableBox,
.fast-sh-listf-box,
.admin-sh-listf-box,
.force-sh-listf-mount,
.unified-sh-listf-box {
    display: none !important;
}

.final-only-sh-listf-box {
    margin: 16px 0 18px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.20);
    direction: rtl;
}

.final-only-sh-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.final-only-sh-head h2 {
    margin: 0 0 5px;
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
}

.final-only-sh-head p,
.final-only-sh-status,
.final-only-sh-empty {
    margin: 0;
    color: var(--muted, #93c5fd);
}

#finalOnlySHRefresh {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

.final-only-sh-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.final-only-sh-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    color: var(--app-text, #e0f2fe);
}

.final-only-sh-table th,
.final-only-sh-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.final-only-sh-table th {
    background: rgba(20, 184, 166, 0.22);
    font-weight: 950;
}

.final-only-sh-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.035);
}

.final-only-sh-delete {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

/* SH List F widgets are hidden unless the PIN-scoped guard allows them */
.sh-listf-pin-hidden {
    display: none !important;
}

/* FINAL OWNER SH List F: hide all older widgets */
#secureSHZipBox,
#unifiedSHExportControlsBox,
#finalOnlySHListFTableBox,
#forceSHListFTableMount,
#unifiedSHListFTableBox,
#fastSHListFRendererBox,
#adminSHListFTableBox,
.secure-sh-zip-box,
.unified-sh-export-box,
.final-only-sh-listf-box,
.force-sh-listf-mount,
.unified-sh-listf-box,
.fast-sh-listf-box,
.admin-sh-listf-box {
    display: none !important;
}

#finalOwnerSHListFPanel {
    margin-top: 18px;
    direction: rtl;
}

.final-owner-pin-card,
.final-owner-export-box,
.final-owner-table-box {
    margin: 16px 0 18px;
    padding: 17px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.20);
}

.final-owner-pin-card h2,
.final-owner-export-box h2,
.final-owner-table-head h2 {
    margin: 0 0 6px;
    color: var(--app-text, #e0f2fe);
    font-weight: 950;
}

.final-owner-pin-card p,
.final-owner-export-box p,
.final-owner-table-head p,
.final-owner-status,
.final-owner-empty {
    margin: 0;
    color: var(--muted, #93c5fd);
}

.final-owner-pin-row,
.final-owner-export-row,
.final-owner-secure-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 13px;
}

#finalOwnerSHListFPinInput,
#finalOwnerSecurePassword {
    min-width: 260px;
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255,255,255,0.06);
    color: #e0f2fe;
    padding: 11px 14px;
    outline: none;
}

#finalOwnerSHListFPinBtn,
#finalOwnerExcelBtn,
#finalOwnerZipBtn,
#finalOwnerGeneratedZipBtn,
#finalOwnerCustomZipBtn,
#finalOwnerRefreshTable,
#finalOwnerCopyPassword {
    border: 0;
    border-radius: 999px;
    padding: 10px 15px;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

#finalOwnerSHListFPinBtn,
#finalOwnerExcelBtn,
#finalOwnerCustomZipBtn,
#finalOwnerRefreshTable {
    background: #14b8a6;
}

#finalOwnerZipBtn {
    background: #0ea5e9;
}

#finalOwnerGeneratedZipBtn {
    background: #f59e0b;
}

#finalOwnerCopyPassword {
    background: #6366f1;
}

.final-owner-secure-box {
    margin-top: 14px;
    padding: 14px;
    border-radius: 17px;
    border: 1px solid rgba(245, 158, 11, 0.36);
    background: rgba(245, 158, 11, 0.08);
}

.final-owner-secure-box strong {
    display: block;
    color: #fde68a;
    font-size: 17px;
    font-weight: 950;
    margin-bottom: 4px;
}

.final-owner-password-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.38);
    color: #e0f2fe;
}

.final-owner-password-result code {
    display: inline-block;
    direction: ltr;
    text-align: left;
    background: rgba(0,0,0,0.35);
    padding: 8px 10px;
    border-radius: 10px;
    color: #fde68a;
    font-weight: 950;
    letter-spacing: 0.5px;
}

.final-owner-password-warning,
.final-owner-pin-error {
    margin-top: 8px;
    color: #fca5a5;
    font-weight: 800;
}

.final-owner-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.final-owner-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.final-owner-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    color: var(--app-text, #e0f2fe);
}

.final-owner-table th,
.final-owner-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.final-owner-table th {
    background: rgba(20, 184, 166, 0.22);
    font-weight: 950;
}

.final-owner-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.035);
}

.final-owner-delete {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

/* Final restored Config Dataframe */
.cfg-restore-mount {
    margin-top: 18px;
    direction: ltr;
}

.cfg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 14px 0;
}

.cfg-toolbar button {
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    background: #14b8a6;
    color: white;
    font-weight: 900;
    cursor: pointer;
}

.cfg-count {
    color: #93c5fd;
    font-weight: 900;
}

.cfg-stat-section,
.cfg-table-section {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    background: rgba(15, 23, 42, 0.22);
}

.cfg-stat-section h3,
.cfg-table-section h3 {
    margin: 0 0 8px;
    color: #e0f2fe;
    font-size: 22px;
    font-weight: 950;
}

.cfg-stat-section p {
    margin: 0 0 12px;
    color: #93c5fd;
}

.cfg-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cfg-stat-card {
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.cfg-stat-title {
    color: #bfdbfe;
    font-weight: 950;
    margin-bottom: 7px;
}

.cfg-stat-line {
    color: #dbeafe;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cfg-table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.cfg-table {
    width: 100%;
    min-width: 1250px;
    border-collapse: collapse;
    color: #e0f2fe;
}

.cfg-table th,
.cfg-table td {
    padding: 9px 11px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: left;
    vertical-align: top;
}

.cfg-table th {
    position: sticky;
    top: 0;
    background: #1e3a8a;
    color: white;
    z-index: 2;
}

.cfg-config-cell {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: monospace;
}

.cfg-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
    font-size: 12px;
}

.cfg-available {
    background: rgba(20, 184, 166, 0.18);
    color: #5eead4;
}

.cfg-assigned {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.cfg-empty,
.cfg-loading {
    padding: 13px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.34);
    color: #93c5fd;
    font-weight: 850;
}

.cfg-error {
    padding: 13px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #fecaca;
    font-weight: 900;
}

@media (max-width: 900px) {
    .cfg-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Inline Config Dataframe restored into original section */
#configDataframeInlineMount {
    margin-top: 14px;
    direction: ltr;
}

#configStatsInlineMount {
    margin-top: 12px;
    direction: ltr;
}

.cfg-inline-count {
    color: #93c5fd;
    font-weight: 900;
    margin: 10px 0;
}

.cfg-inline-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cfg-inline-stat {
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #dbeafe;
}

.cfg-inline-stat b {
    display: block;
    color: #bfdbfe;
    margin-bottom: 6px;
}

.cfg-inline-table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    margin-top: 10px;
}

.cfg-inline-table {
    width: 100%;
    min-width: 1250px;
    border-collapse: collapse;
    color: #e0f2fe;
}

.cfg-inline-table th,
.cfg-inline-table td {
    padding: 9px 11px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: left;
    vertical-align: top;
}

.cfg-inline-table th {
    position: sticky;
    top: 0;
    background: #1e3a8a;
    color: white;
    z-index: 2;
}

.cfg-inline-config-cell {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: monospace;
}

.cfg-inline-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
    font-size: 12px;
}

.cfg-inline-available {
    background: rgba(20, 184, 166, 0.18);
    color: #5eead4;
}

.cfg-inline-assigned {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.cfg-inline-empty {
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.34);
    color: #93c5fd;
    font-weight: 850;
}

.cfg-inline-error {
    padding: 12px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #fecaca;
    font-weight: 900;
}

/* Config statistics grouped by FG and package */
.cfg-inline-fg-stats {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cfg-inline-fg-stat-block {
    border-radius: 16px;
    padding: 14px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.cfg-inline-fg-stat-block h4 {
    margin: 0 0 12px;
    color: #e0f2fe;
    font-size: 18px;
    font-weight: 950;
    direction: rtl;
    text-align: right;
}

.cfg-inline-package-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
}

.cfg-inline-package-stat {
    border-radius: 14px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.34);
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.cfg-inline-package-name {
    color: #7dd3fc;
    font-weight: 950;
    font-size: 16px;
    margin-bottom: 8px;
    text-align: left;
}

.cfg-inline-package-numbers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #dbeafe;
    font-size: 13px;
}

.cfg-inline-package-numbers b {
    color: #bfdbfe;
}

@media (max-width: 1100px) {
    .cfg-inline-package-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 650px) {
    .cfg-inline-package-grid {
        grid-template-columns: 1fr;
    }
}

/* Config Dataframe per-row delete */
.cfg-delete-col {
    text-align: center !important;
    white-space: nowrap !important;
}

.cfg-row-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #dc2626;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    font-family: inherit;
}

.cfg-row-delete-btn:hover {
    filter: brightness(1.12);
}

.cfg-row-delete-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Final config request result */
.final-config-request-result {
    margin-top: 14px;
    direction: rtl;
}

.final-config-status {
    padding: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.45);
    color: #bfdbfe;
    font-weight: 900;
}

.final-config-error {
    padding: 14px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    font-weight: 900;
}

.final-config-success {
    padding: 16px;
    border-radius: 16px;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.35);
    color: #dbeafe;
    font-weight: 900;
}

#finalConfigOutputBox {
    width: 100%;
    min-height: 110px;
    margin-top: 10px;
    direction: ltr;
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.65);
    color: #e0f2fe;
    padding: 12px;
    box-sizing: border-box;
    font-family: monospace;
}

#finalCopyConfigBtn {
    margin-top: 10px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #14b8a6;
    color: white;
    font-weight: 950;
    cursor: pointer;
}

/* Final config preview accept/decline */
.final-config-preview {
    margin-top: 14px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.35);
    color: #dbeafe;
    font-weight: 900;
    direction: rtl;
}

.final-config-preview-title {
    font-size: 20px;
    color: #ccfbf1;
    font-weight: 950;
    margin-bottom: 8px;
}

.final-config-preview-line {
    color: #bfdbfe;
    margin-bottom: 10px;
}

.final-config-preview p {
    color: #93c5fd;
    line-height: 1.9;
    margin: 10px 0 14px;
}

.final-config-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.final-config-meta-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.final-config-meta-grid span {
    color: #bfdbfe;
    font-weight: 950;
}

.final-config-meta-grid input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.60);
    color: #e0f2fe;
    padding: 11px 13px;
    box-sizing: border-box;
    font-family: inherit;
}

.final-config-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.final-config-preview-actions button,
.final-config-secondary {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: white;
    font-weight: 950;
    cursor: pointer;
    font-family: inherit;
}

#finalAcceptConfigBtn {
    background: #14b8a6;
}

#finalDeclineConfigBtn,
.final-config-secondary {
    background: #64748b;
}

@media (max-width: 700px) {
    .final-config-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* Keep config request result above reminder/event helper cards */
#finalConfigRequestPriorityHost {
    margin: 18px 0;
    direction: rtl;
}

#finalConfigRequestPriorityHost #finalConfigRequestResult {
    margin-top: 0;
}

.config-request-helper-card {
    margin-top: 18px !important;
}

/* Final safety: reminder/event helper widgets are controlled by tab-widget-scope-cleaner.js */
[data-tab-scope-cleaner="reminders-only"],
[data-tab-scope-cleaner="calendar-events-only"] {
    transition: none !important;
}

/* Final: make Config Dataframe scroll inside its own chart/table box */
#configDataframeInlineMount {
    max-width: 100% !important;
    overflow: hidden !important;
}

#configDataframeInlineMount .cfg-inline-table-wrap {
    max-height: 520px !important;
    overflow: auto !important;
    border-radius: 16px !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    background: rgba(15, 23, 42, 0.20) !important;
}

/* Keep table header visible while scrolling inside the table */
#configDataframeInlineMount .cfg-inline-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: #1e3a8a !important;
}

/* Keep delete column visible a bit better */
#configDataframeInlineMount .cfg-inline-table th:first-child,
#configDataframeInlineMount .cfg-inline-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 9 !important;
}

#configDataframeInlineMount .cfg-inline-table th:first-child {
    z-index: 12 !important;
    background: #1e3a8a !important;
}

#configDataframeInlineMount .cfg-inline-table td:first-child {
    background: rgba(20, 24, 18, 0.98) !important;
}

/* Make the table compact enough for many configs */
#configDataframeInlineMount .cfg-inline-table th,
#configDataframeInlineMount .cfg-inline-table td {
    padding: 8px 10px !important;
    line-height: 1.35 !important;
}

/* Avoid raw config columns making the whole page too wide */
#configDataframeInlineMount .cfg-inline-config-cell {
    max-width: 420px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* On larger screens allow a taller internal table, but still not infinite */
@media (min-height: 900px) {
    #configDataframeInlineMount .cfg-inline-table-wrap {
        max-height: 650px !important;
    }
}

@media (max-height: 760px) {
    #configDataframeInlineMount .cfg-inline-table-wrap {
        max-height: 430px !important;
    }
}

/* Final unified app layer for owner-managed tabs */
#finalLayerBackdrop {
    display: none;
}

.final-owned-layer-panel {
    background: var(--final-layer-panel-bg, rgba(15, 23, 42, 0.985)) !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    border-radius: 24px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34) !important;
}

/* Make inner final cards fit naturally inside the unified panel */
.final-owned-layer-panel > .unit-sheet-card,
.final-owned-layer-panel .unit-sheet-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto 32px !important;
}

/* SH final panel safety if its own CSS uses transparency */
.final-owned-layer-panel .sh-final-card,
.final-owned-layer-panel .sh-card,
.final-owned-layer-panel .final-sh-card {
    background: rgba(15, 23, 42, 0.78) !important;
}

/* Prevent old page from visually bleeding through while final layer is open */
body.final-owned-layer-active #finalLayerBackdrop {
    display: block;
}

/* Keep sidebar and top bar above normal page, but below final panels if needed */
body.final-owned-layer-active .sidebar,
body.final-owned-layer-active aside,
body.final-owned-layer-active nav {
    isolation: isolate;
}

/* Final Config Excel Import */
.config-excel-import-box {
    margin: 18px 0;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    background: rgba(15, 23, 42, 0.28);
    color: #e0f2fe;
}

.config-excel-import-box h3 {
    margin: 0 0 8px;
    color: #e0f2fe;
    font-size: 23px;
    font-weight: 950;
}

.config-excel-import-box p {
    margin: 0 0 14px;
    color: #93c5fd;
}

.config-excel-import-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.config-excel-import-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-excel-import-grid span,
.config-excel-skip-label span {
    color: #bfdbfe;
    font-weight: 900;
}

.config-excel-import-grid select,
#configExcelFile {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.65);
    color: #e0f2fe;
    padding: 10px 12px;
    font-family: inherit;
}

.config-excel-import-grid select option {
    color: #111827;
}

.config-excel-import-file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.config-excel-skip-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#configExcelImportBtn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #14b8a6;
    color: #fff;
    font-weight: 950;
    cursor: pointer;
}

.config-excel-import-result {
    margin-top: 12px;
}

.config-excel-success,
.config-excel-loading,
.config-excel-error {
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 900;
}

.config-excel-success {
    background: rgba(20, 184, 166, 0.14);
    color: #ccfbf1;
    border: 1px solid rgba(20, 184, 166, 0.35);
}

.config-excel-loading {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.config-excel-error {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

@media (max-width: 900px) {
    .config-excel-import-grid {
        grid-template-columns: 1fr;
    }
}

/* Unified final-tab stage: prevents old/default tab content mixing with owner tabs */
main.layout > section.content,
section.content {
    position: relative;
}

#workspaceUnifiedStage {
    display: none;
    width: 100%;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
}

/* When a final owner tab is active, only the unified stage should be visible in main content */
body.workspace-owner-tab-active main.layout > section.content > :not(#workspaceUnifiedStage),
body.workspace-owner-tab-active section.content > :not(#workspaceUnifiedStage) {
    display: none !important;
}

body.workspace-owner-tab-active #workspaceUnifiedStage {
    display: block !important;
}

/* Owner panels are no longer floating body overlays; they become normal content */
body.workspace-owner-tab-active #workspaceUnifiedStage > #shFinalOwnerV2Panel,
body.workspace-owner-tab-active #workspaceUnifiedStage > #unitSheetsOwnerPanel {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    z-index: 1 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Make final cards use the available main workspace width cleanly */
body.workspace-owner-tab-active #workspaceUnifiedStage .sh-final-card,
body.workspace-owner-tab-active #workspaceUnifiedStage .unit-sheet-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 28px 0 !important;
}

/* Remove leftover backdrop from the failed controller if it exists */
#finalLayerBackdrop {
    display: none !important;
}

/* Final owner-tab isolation */
[data-owner-panel-hidden="1"] {
    display: none !important;
}

body.workspace-owner-tab-active [data-owner-default-hidden="1"] {
    display: none !important;
}

#workspaceUnifiedStage > #dailyScheduleOwnerPanel,
#workspaceUnifiedStage > #unitSheetsOwnerPanel,
#workspaceUnifiedStage > #shFinalOwnerV2Panel,
#workspaceUnifiedStage > #configRequestStagePanel {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    position: relative !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Safe hard switch: hidden owner panels must stay hidden */
[data-hard-hidden-panel="1"] {
    display: none !important;
}

/* Fixed manual config append box */
.config-manual-fixed-card {
    overflow: visible !important;
}

.config-manual-fixed {
    width: 100%;
    box-sizing: border-box;
}

.config-manual-fixed-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.config-manual-fixed-head h2 {
    margin: 0 0 6px;
    color: #e0f2fe;
    font-size: 24px;
    font-weight: 950;
}

.config-manual-fixed-head p {
    margin: 0;
    color: #9fb6d8;
}

.config-manual-fixed button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    font-weight: 950;
    cursor: pointer;
    font-family: inherit;
}

.config-manual-fixed button.secondary {
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.30);
}

.config-manual-fixed button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.config-manual-fixed-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.config-manual-fixed-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #dbeafe;
    font-weight: 900;
}

.config-manual-fixed-controls select,
#configManualConfigsBox {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.68);
    color: #e0f2fe;
    padding: 10px 12px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.config-manual-fixed-controls select option {
    background: #0f172a;
    color: #e0f2fe;
}

#configManualConfigsBox {
    min-height: 210px;
    resize: vertical;
    direction: ltr;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre;
}

.config-manual-fixed-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.config-manual-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bfdbfe;
    font-weight: 900;
}

.config-manual-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.config-manual-result {
    margin-top: 12px;
    min-height: 20px;
    color: #bfdbfe;
    font-weight: 900;
}

.config-manual-result.success {
    color: #bbf7d0;
}

.config-manual-result.error {
    color: #fecaca;
}

.config-manual-result.info {
    color: #bfdbfe;
}

@media (max-width: 900px) {
    .config-manual-fixed-controls {
        grid-template-columns: 1fr;
    }

    .config-manual-fixed-head {
        flex-direction: column;
    }
}

/* Add Configs layout repair */
.config-export-excel-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    margin-inline-start: 10px;
    background: #22c55e;
    color: white;
    font-weight: 950;
    cursor: pointer;
    font-family: inherit;
}

.config-export-excel-btn:hover {
    filter: brightness(1.08);
}

.config-manual-safe-result {
    margin-top: 12px;
    min-height: 22px;
    color: #bfdbfe;
    font-weight: 900;
}

.config-manual-safe-result.success {
    color: #bbf7d0;
}

.config-manual-safe-result.error {
    color: #fecaca;
}

.config-manual-safe-result.info {
    color: #bfdbfe;
}

body.add-configs-layout-repaired select {
    min-height: 34px;
}

body.add-configs-layout-repaired select option {
    background: #0f172a;
    color: #e0f2fe;
}

/* Undo visual side-effects from the disabled aggressive manual append script */
.config-manual-fixed-card {
    overflow: visible !important;
}

/* SH submit safety message */
.sh-submit-safety-message {
    display: none;
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    font-weight: 950;
    line-height: 1.8;
}

/* Add Configs owner panel */
#addConfigsOwnerPanel {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.add-configs-owner-card {
    direction: ltr;
    text-align: left;
    color: #e5f0ff;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.24);
}

.add-configs-owner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 16px;
}

.add-configs-owner-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    color: #e0f2fe;
    font-weight: 950;
}

.add-configs-owner-header p {
    margin: 0;
    color: #9fb6d8;
}

.add-configs-owner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-configs-owner-card button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #3b82f6;
    color: #fff;
    font-weight: 950;
    cursor: pointer;
    font-family: inherit;
}

.add-configs-owner-card button:hover {
    filter: brightness(1.08);
}

.add-configs-owner-danger {
    background: #dc2626 !important;
}

.add-configs-owner-note {
    margin: 10px 0 16px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    font-weight: 900;
}

.add-configs-owner-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.2fr) minmax(280px, .8fr);
    gap: 16px;
    margin-bottom: 16px;
}

.add-configs-owner-box {
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    padding: 16px;
}

.add-configs-owner-box h2 {
    margin: 0 0 12px;
    color: #e0f2fe;
    font-size: 20px;
    font-weight: 950;
}

.add-configs-owner-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.add-configs-owner-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #bfdbfe;
    font-weight: 900;
}

.add-configs-owner-card select,
.add-configs-owner-card input[type="file"],
.add-configs-owner-card textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.78);
    color: #e0f2fe;
    padding: 10px 12px;
    outline: none;
    font-family: inherit;
}

.add-configs-owner-card select option {
    background: #0f172a;
    color: #e0f2fe;
}

#acManualConfigs {
    min-height: 210px;
    resize: vertical;
    direction: ltr;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre;
}

.add-configs-owner-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.add-configs-owner-check {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #bfdbfe;
    font-weight: 900;
    margin: 10px 0;
}

.add-configs-owner-result {
    margin-top: 10px;
    min-height: 22px;
    color: #bfdbfe;
    font-weight: 900;
}

.add-configs-owner-result.success {
    color: #bbf7d0;
}

.add-configs-owner-result.error,
.add-configs-owner-error {
    color: #fecaca;
}

.add-configs-owner-result.info {
    color: #bfdbfe;
}

.add-configs-owner-dataframe {
    margin-top: 8px;
}

.add-configs-owner-dataframe-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.add-configs-owner-stats {
    color: #bfdbfe;
    font-weight: 950;
}

.add-configs-owner-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 420px);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.add-configs-owner-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.add-configs-owner-table th,
.add-configs-owner-table td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-inline-end: 1px solid rgba(148, 163, 184, 0.12);
    padding: 8px 10px;
    vertical-align: top;
    white-space: nowrap;
}

.add-configs-owner-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #1e3a8a;
    color: white;
    font-weight: 950;
}

.add-configs-owner-table td {
    color: #dbeafe;
}

.add-configs-owner-empty {
    padding: 20px;
    color: #bfdbfe;
    font-weight: 900;
}

@media (max-width: 1000px) {
    .add-configs-owner-grid,
    .add-configs-owner-controls {
        grid-template-columns: 1fr;
    }

    .add-configs-owner-header {
        flex-direction: column;
    }
}

/* Admin Add Configs lite repair */
.admin-add-configs-lite-result {
    margin-top: 12px;
    min-height: 22px;
    color: #bfdbfe;
    font-weight: 900;
}

.admin-add-configs-lite-result.success {
    color: #bbf7d0;
}

.admin-add-configs-lite-result.error,
.admin-config-stats-lite-error {
    color: #fecaca;
}

.admin-add-configs-lite-result.info {
    color: #bfdbfe;
}

.admin-config-stats-lite-box {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-config-stats-lite-total {
    color: #bfdbfe;
    font-weight: 950;
    margin-bottom: 12px;
}

.admin-config-stats-lite-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.admin-config-stats-lite-group {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.48);
}

.admin-config-stats-lite-group h3 {
    margin: 0 0 8px;
    color: #e0f2fe;
    font-size: 16px;
}

.admin-config-stats-lite-packages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #bfdbfe;
    font-size: 13px;
}

.admin-config-stats-lite-packages span {
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.10);
    padding: 6px 8px;
}

/* Safe append-only Add Configs look */
.append-config-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.append-config-hero {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 18px;
    align-items: stretch;
}

.append-config-hero > div:first-child,
.append-config-stats {
    background: linear-gradient(135deg, var(--topbar-bg, #0f172a), var(--accent, #2563eb));
    color: #ffffff;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.append-config-hero h2 {
    margin: 12px 0 8px;
    font-size: 30px;
}

.append-config-hero p,
.append-config-stats span {
    color: #dbeafe;
    line-height: 1.9;
}

.append-config-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b, var(--accent-2, #1d4ed8));
}

.append-config-stats strong {
    font-size: 23px;
    margin-bottom: 10px;
}

.append-config-card {
    background: var(--card-bg, #ffffff);
    color: var(--app-text, #0f172a);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 14px 34px var(--shadow, rgba(15, 23, 42, 0.08));
}

.append-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.append-card-head h2 {
    margin: 0 0 8px;
}

.append-card-head p {
    margin: 0;
    color: var(--muted, #64748b);
}

.append-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.nice-select {
    height: 48px !important;
    border-radius: 16px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--card-bg, #fff) 88%, var(--accent, #2563eb)), var(--input-bg, #fff)) !important;
    border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 35%, var(--input-border, #cbd5e1)) !important;
    color: var(--app-text, #0f172a) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 22px rgba(15,23,42,0.08);
    cursor: pointer;
}

.nice-select:focus {
    outline: 3px solid color-mix(in srgb, var(--accent, #2563eb) 28%, transparent) !important;
}

.append-links-area {
    min-height: 230px !important;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    line-height: 1.7 !important;
    border-radius: 18px !important;
}

.append-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.append-main-btn {
    min-width: 180px;
    font-weight: 900 !important;
    border-radius: 16px !important;
    padding: 13px 20px !important;
}

.append-result {
    margin-top: 12px;
    font-weight: 800;
}

@media (max-width: 1000px) {
    .append-config-hero,
    .append-control-grid {
        grid-template-columns: 1fr;
    }
}

/* SUB Link explanation and tutorial videos */
.sub-tutorial-box {
    margin-top: 18px;
    background: var(--card-bg, #ffffff);
    color: var(--app-text, #0f172a);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(15, 23, 42, 0.08));
}

.sub-tutorial-head {
    background: linear-gradient(135deg, var(--topbar-bg, #0f172a), var(--accent, #2563eb));
    color: #ffffff;
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 18px;
}

.sub-tutorial-head h2 {
    margin: 12px 0 0;
    font-size: 24px;
}

.sub-tutorial-text {
    background: var(--card-soft, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 18px;
    padding: 18px;
    line-height: 2.1;
    font-size: 15px;
}

.sub-tutorial-text p {
    margin: 0 0 14px;
}

.sub-app-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.sub-app-list span {
    background: color-mix(in srgb, var(--accent, #2563eb) 18%, var(--card-bg, #fff));
    border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 45%, var(--border, #e2e8f0));
    color: var(--app-text, #0f172a);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.sub-admin-upload {
    margin-top: 18px;
    background: var(--card-soft, #f8fafc);
    border: 1px dashed var(--accent, #2563eb);
    border-radius: 18px;
    padding: 18px;
}

.sub-admin-upload h3 {
    margin: 0 0 8px;
}

.sub-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.sub-upload-row input {
    padding: 12px;
    border-radius: 14px;
}

.sub-video-section {
    margin-top: 20px;
}

.sub-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.sub-video-card {
    background: var(--card-soft, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 18px;
    padding: 14px;
}

.sub-video-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.sub-video-title span {
    color: var(--muted, #64748b);
    font-size: 12px;
    direction: ltr;
    text-align: left;
}

.sub-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.sub-video-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sub-video-actions a {
    background: var(--accent, #2563eb);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .sub-upload-row {
        grid-template-columns: 1fr;
    }
}

/* Fix SUB tutorial panel placement and visibility */
#subTutorialBox {
    max-width: 980px;
    margin: 18px auto 40px;
}

#subTutorialBox.hidden {
    display: none !important;
}

.sub-tutorial-box {
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid var(--border, #334155);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(0, 0, 0, 0.30));
}

.sub-tutorial-head {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: #ffffff;
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 18px;
}

.sub-tutorial-head h2 {
    margin: 12px 0 0;
    font-size: 24px;
}

.sub-tutorial-text {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 18px;
    line-height: 2.1;
    font-size: 15px;
}

.sub-tutorial-text p {
    margin: 0 0 14px;
}

.sub-app-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.sub-app-list span {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.45);
    color: var(--app-text, #e5e7eb);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.sub-admin-upload {
    margin-top: 18px;
    background: var(--card-soft, #0f172a);
    border: 1px dashed var(--accent, #3b82f6);
    border-radius: 18px;
    padding: 18px;
}

.sub-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.sub-video-section {
    margin-top: 20px;
}

.sub-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.sub-video-card {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 14px;
}

.sub-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.sub-video-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sub-video-actions a {
    background: var(--accent, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .sub-upload-row {
        grid-template-columns: 1fr;
    }
}

/* Static SUB tutorial panel - no jumping */
#subTutorialStaticBox.hidden {
    display: none !important;
}

.sub-tutorial-static-box {
    max-width: 980px;
    margin: 18px auto 44px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid var(--border, #334155);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(0, 0, 0, 0.30));
}

.sub-static-head {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: #ffffff;
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 18px;
}

.sub-static-head h2 {
    margin: 12px 0 0;
    font-size: 24px;
}

.sub-static-text {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 18px;
    line-height: 2.1;
    font-size: 15px;
}

.sub-static-text p {
    margin: 0 0 14px;
}

.sub-static-apps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.sub-static-apps span {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.45);
    color: var(--app-text, #e5e7eb);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.sub-static-upload {
    margin-top: 18px;
    background: var(--card-soft, #0f172a);
    border: 1px dashed var(--accent, #3b82f6);
    border-radius: 18px;
    padding: 18px;
}

.sub-static-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.sub-static-video-section {
    margin-top: 20px;
}

.sub-static-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.sub-video-placeholder,
.sub-static-video-card {
    min-height: 250px;
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 16px;
}

.sub-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    border-style: dashed;
    opacity: 0.92;
}

.placeholder-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 22px;
    font-weight: 900;
}

.sub-video-placeholder span {
    color: var(--muted, #94a3b8);
}

.sub-static-video-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.sub-static-video-title span {
    color: var(--muted, #94a3b8);
    font-size: 12px;
    direction: ltr;
    text-align: left;
}

.sub-static-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.sub-static-video-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sub-static-video-actions a {
    background: var(--accent, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .sub-static-upload-row {
        grid-template-columns: 1fr;
    }
}

.upload-ok {
    color: #22c55e !important;
    font-weight: 900;
}

.upload-error {
    color: #f87171 !important;
    font-weight: 900;
}

/* SUB + STATUS append layout */
.append-link-pair-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.provided-status-link-box {
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.55), rgba(21, 128, 61, 0.25));
    border: 1px solid rgba(34, 197, 94, 0.45);
    border-radius: 18px;
    padding: 18px;
    color: var(--app-text, #e5e7eb);
}

.provided-status-link-box h3 {
    margin: 0 0 8px;
}

.provided-status-link-box p {
    margin: 0 0 12px;
    color: var(--muted, #94a3b8);
}

.provided-status-link-box textarea {
    width: 100%;
    min-height: 80px;
    direction: ltr;
    text-align: left;
    font-family: Consolas, Monaco, monospace;
    border-radius: 14px;
}

.status-copy-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.status-copy-row button {
    border-radius: 14px;
    font-weight: 900;
}

@media (max-width: 900px) {
    .append-link-pair-grid {
        grid-template-columns: 1fr;
    }
}

/* STATUS link widget for provided configs */
.status-link-widget {
    margin-top: 16px;
    background: rgba(37, 99, 235, 0.10);
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 18px;
    padding: 16px;
}

.status-link-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.status-link-title strong {
    color: var(--app-text, #e5e7eb);
    font-size: 16px;
}

.status-link-title span {
    color: var(--muted, #94a3b8);
    font-size: 13px;
}

.status-link-textarea {
    width: 100%;
    min-height: 78px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    border-radius: 14px !important;
    resize: vertical;
}

.status-link-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.status-link-actions button {
    border-radius: 14px !important;
    padding: 10px 16px !important;
    font-weight: 900 !important;
}

/* Auto-generated STATUS link widget */
.auto-status-widget {
    margin-top: 16px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.50);
    border-radius: 18px;
    padding: 16px;
}

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

.auto-status-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.auto-status-title strong {
    color: var(--app-text, #e5e7eb);
    font-size: 16px;
}

.auto-status-title span {
    color: var(--muted, #94a3b8);
    font-size: 13px;
}

.auto-status-widget textarea {
    width: 100%;
    min-height: 82px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    border-radius: 14px !important;
    resize: vertical;
}

.auto-status-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.auto-status-actions button {
    border-radius: 14px !important;
    padding: 10px 16px !important;
    font-weight: 900 !important;
}

.final-auto-status-widget {
    margin-top: 16px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.50);
    border-radius: 18px;
    padding: 16px;
}

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

.final-status-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.final-status-title strong {
    color: var(--app-text, #e5e7eb);
    font-size: 16px;
}

.final-status-title span {
    color: var(--muted, #94a3b8);
    font-size: 13px;
}

.final-auto-status-widget textarea {
    width: 100%;
    min-height: 82px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    border-radius: 14px !important;
    resize: vertical;
}

.final-status-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.final-status-actions button {
    border-radius: 14px !important;
    padding: 10px 16px !important;
    font-weight: 900 !important;
}

/* Direct STATUS widget under received config */
.direct-status-widget {
    margin-top: 14px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 16px;
    padding: 14px;
}

.direct-status-head {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.direct-status-head strong {
    color: var(--app-text, #e5e7eb);
    font-size: 16px;
}

.direct-status-head span {
    color: var(--muted, #94a3b8);
    font-size: 13px;
}

.direct-status-widget textarea {
    width: 100%;
    min-height: 74px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    border-radius: 14px !important;
    resize: vertical;
}

.direct-status-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.direct-status-actions button {
    border-radius: 14px !important;
    padding: 10px 16px !important;
    font-weight: 900 !important;
}

/* Bigger and clearer copy buttons for config + STATUS */
.direct-status-widget {
    margin-top: 18px !important;
    padding: 18px !important;
    border-radius: 18px !important;
}

.direct-status-head strong {
    font-size: 18px !important;
    font-weight: 900 !important;
}

.direct-status-head span {
    font-size: 14px !important;
    line-height: 2 !important;
    color: var(--app-text, #e5e7eb) !important;
    opacity: 0.92;
}

.direct-status-widget textarea {
    min-height: 86px !important;
    font-size: 14px !important;
    padding: 14px !important;
}

.direct-status-actions button,
.final-status-actions button,
.auto-status-actions button,
.status-link-actions button {
    min-width: 170px !important;
    min-height: 46px !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    border-radius: 16px !important;
    padding: 13px 20px !important;
}

/* Existing "copy config" button in the received config box */
.config-result button,
[id*="config"][id*="result"] button,
[class*="config"][class*="result"] button {
    min-width: 150px !important;
    min-height: 44px !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    border-radius: 16px !important;
    padding: 12px 18px !important;
}

/* Make the STATUS action row breathe */
.direct-status-actions,
.final-status-actions,
.auto-status-actions,
.status-link-actions {
    margin-top: 14px !important;
}

/* Prevent SUB tutorial box from flashing in the wrong narrow area on first login */
#subTutorialStaticBox:not(.sub-placement-ready) {
    display: none !important;
}

#subTutorialStaticBox.sub-placement-ready {
    display: block;
    width: min(980px, calc(100% - 24px)) !important;
    max-width: 980px !important;
    margin: 18px auto 44px !important;
    clear: both;
}

/* Hide older duplicate tutorial box if an old script creates it */
#subTutorialBox {
    display: none !important;
}

/* Force SUB guide/videos into central content area */
#subTutorialStaticBox.sub-central-view {
    width: min(980px, calc(100% - 24px)) !important;
    max-width: 980px !important;
    margin: 18px auto 44px !important;
    clear: both !important;
}

#subTutorialStaticBox.sub-central-view .sub-static-head h2 {
    font-size: 26px !important;
    line-height: 1.35 !important;
}

#subTutorialStaticBox.sub-central-view .sub-static-text {
    font-size: 15px !important;
    line-height: 2.1 !important;
}

.slot-title-input {
    width: 100%;
    background: rgba(59, 130, 246, 0.10) !important;
    border: 1px solid rgba(96, 165, 250, 0.45) !important;
    color: var(--app-text, #e5e7eb) !important;
    border-radius: 12px !important;
    padding: 9px 11px !important;
    font-weight: 900 !important;
    text-align: center !important;
    font-family: inherit !important;
}

.slot-title-input:focus {
    outline: 3px solid rgba(96, 165, 250, 0.35) !important;
}

.slot-title-saved {
    background: rgba(34, 197, 94, 0.20) !important;
    border-color: rgba(34, 197, 94, 0.65) !important;
}

/* Old duplicate guide should stay hidden if it appears */
#subTutorialBox {
    display: none !important;
}

/* Final central SUB guide. Old side/narrow boxes are hidden. */
#subTutorialStaticBox,
#subTutorialBox {
    display: none !important;
}

#centralSubGuideBox.hidden {
    display: none !important;
}

.central-sub-guide {
    width: min(980px, calc(100% - 24px)) !important;
    max-width: 980px !important;
    margin: 18px auto 44px !important;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid var(--border, #334155);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(0,0,0,0.30));
    clear: both;
}

.central-sub-head {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 18px;
}

.central-sub-head h2 {
    margin: 12px 0 0;
    font-size: 28px;
    line-height: 1.35;
}

.central-sub-text {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 20px;
    line-height: 2.1;
    font-size: 15px;
}

.central-sub-text p {
    margin: 0 0 14px;
}

.central-sub-apps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.central-sub-apps span {
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    color: var(--app-text, #e5e7eb);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.central-sub-upload {
    margin-top: 18px;
    background: var(--card-soft, #0f172a);
    border: 1px dashed var(--accent, #3b82f6);
    border-radius: 18px;
    padding: 18px;
}

.central-sub-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.central-sub-video-section {
    margin-top: 20px;
}

.central-sub-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.central-video-placeholder,
.central-video-card {
    min-height: 250px;
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 16px;
}

.central-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    border-style: dashed;
}

.central-placeholder-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 22px;
    font-weight: 900;
}

.central-slot-title-input {
    width: 100%;
    background: rgba(59,130,246,0.10) !important;
    border: 1px solid rgba(96,165,250,0.45) !important;
    color: var(--app-text, #e5e7eb) !important;
    border-radius: 12px !important;
    padding: 9px 11px !important;
    font-weight: 900 !important;
    text-align: center !important;
    font-family: inherit !important;
}

.central-slot-title-input:focus {
    outline: 3px solid rgba(96,165,250,0.35) !important;
}

.central-slot-saved {
    background: rgba(34,197,94,0.20) !important;
    border-color: rgba(34,197,94,0.65) !important;
}

.central-video-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.central-video-title span,
.central-video-placeholder span {
    color: var(--muted, #94a3b8);
    font-size: 12px;
    direction: ltr;
}

.central-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.central-video-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.central-video-actions a {
    background: var(--accent, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .central-sub-upload-row {
        grid-template-columns: 1fr;
    }
}

/* Stop old SUB guide boxes from appearing/moving */
#subTutorialStaticBox,
#subTutorialBox,
#centralSubGuideBox {
    display: none !important;
}

#stableSubGuideBox.hidden {
    display: none !important;
}

.stable-sub-guide {
    width: min(980px, calc(100% - 24px)) !important;
    max-width: 980px !important;
    margin: 18px auto 44px !important;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid var(--border, #334155);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(0,0,0,0.30));
    clear: both;
    position: relative !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
}

.stable-sub-head {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 18px;
}

.stable-sub-head h2 {
    margin: 12px 0 0;
    font-size: 28px;
    line-height: 1.35;
}

.stable-sub-text {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 20px;
    line-height: 2.1;
    font-size: 15px;
}

.stable-sub-text p {
    margin: 0 0 14px;
}

.stable-sub-apps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.stable-sub-apps span {
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    color: var(--app-text, #e5e7eb);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.stable-sub-upload {
    margin-top: 18px;
    background: var(--card-soft, #0f172a);
    border: 1px dashed var(--accent, #3b82f6);
    border-radius: 18px;
    padding: 18px;
}

.stable-sub-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.stable-sub-video-section {
    margin-top: 20px;
}

.stable-sub-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.stable-video-placeholder,
.stable-video-card {
    min-height: 250px;
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 16px;
}

.stable-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    border-style: dashed;
}

.stable-placeholder-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 22px;
    font-weight: 900;
}

.stable-slot-title-input {
    width: 100%;
    background: rgba(59,130,246,0.10) !important;
    border: 1px solid rgba(96,165,250,0.45) !important;
    color: var(--app-text, #e5e7eb) !important;
    border-radius: 12px !important;
    padding: 9px 11px !important;
    font-weight: 900 !important;
    text-align: center !important;
    font-family: inherit !important;
}

.stable-slot-title-input:focus {
    outline: 3px solid rgba(96,165,250,0.35) !important;
}

.stable-slot-saved {
    background: rgba(34,197,94,0.20) !important;
    border-color: rgba(34,197,94,0.65) !important;
}

.stable-video-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.stable-video-title span,
.stable-video-placeholder span {
    color: var(--muted, #94a3b8);
    font-size: 12px;
    direction: ltr;
}

.stable-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.stable-video-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.stable-video-actions a {
    background: var(--accent, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .stable-sub-upload-row {
        grid-template-columns: 1fr;
    }
}

/* Hide every old side/narrow SUB guide box */
#subTutorialStaticBox,
#subTutorialBox,
#centralSubGuideBox,
#stableSubGuideBox {
    display: none !important;
}

/* Final fixed central SUB guide */
#fixedCentralSubGuideBox.hidden {
    display: none !important;
}

.fixed-central-sub-guide {
    width: min(980px, calc(100% - 24px)) !important;
    max-width: 980px !important;
    margin: 18px auto 44px !important;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid var(--border, #334155);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(0,0,0,0.30));
    clear: both;
    position: relative !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
}

.fixed-sub-head {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 18px;
}

.fixed-sub-head h2 {
    margin: 12px 0 0;
    font-size: 28px;
    line-height: 1.35;
}

.fixed-sub-text {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 20px;
    line-height: 2.1;
    font-size: 15px;
}

.fixed-sub-text p {
    margin: 0 0 14px;
}

.fixed-sub-apps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.fixed-sub-apps span {
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    color: var(--app-text, #e5e7eb);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.fixed-sub-upload {
    margin-top: 18px;
    background: var(--card-soft, #0f172a);
    border: 1px dashed var(--accent, #3b82f6);
    border-radius: 18px;
    padding: 18px;
}

.fixed-sub-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.fixed-sub-video-section {
    margin-top: 20px;
}

.fixed-sub-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.fixed-video-placeholder,
.fixed-video-card {
    min-height: 250px;
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 16px;
}

.fixed-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    border-style: dashed;
}

.fixed-placeholder-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 22px;
    font-weight: 900;
}

.fixed-slot-title-input {
    width: 100%;
    background: rgba(59,130,246,0.10) !important;
    border: 1px solid rgba(96,165,250,0.45) !important;
    color: var(--app-text, #e5e7eb) !important;
    border-radius: 12px !important;
    padding: 9px 11px !important;
    font-weight: 900 !important;
    text-align: center !important;
    font-family: inherit !important;
}

.fixed-slot-title-input:focus {
    outline: 3px solid rgba(96,165,250,0.35) !important;
}

.fixed-slot-saved {
    background: rgba(34,197,94,0.20) !important;
    border-color: rgba(34,197,94,0.65) !important;
}

.fixed-video-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.fixed-video-title span,
.fixed-video-placeholder span {
    color: var(--muted, #94a3b8);
    font-size: 12px;
    direction: ltr;
}

.fixed-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.fixed-video-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.fixed-video-actions a {
    background: var(--accent, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .fixed-sub-upload-row {
        grid-template-columns: 1fr;
    }
}

/* Hide old fighting SUB guide boxes */
#subTutorialStaticBox,
#subTutorialBox,
#centralSubGuideBox,
#stableSubGuideBox,
#fixedCentralSubGuideBox {
    display: none !important;
}

/* Final clean central SUB guide */
#cleanSubGuideBox.hidden {
    display: none !important;
}

.clean-sub-guide {
    width: min(980px, calc(100% - 24px)) !important;
    max-width: 980px !important;
    margin: 18px auto 44px !important;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid var(--border, #334155);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px var(--shadow, rgba(0,0,0,0.30));
    clear: both;
    position: relative !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
}

.clean-sub-head {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 18px;
}

.clean-sub-head h2 {
    margin: 12px 0 0;
    font-size: 28px;
    line-height: 1.35;
}

.clean-sub-text {
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 20px;
    line-height: 2.1;
    font-size: 15px;
}

.clean-sub-text p {
    margin: 0 0 14px;
}

.clean-sub-apps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

.clean-sub-apps span {
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    color: var(--app-text, #e5e7eb);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 900;
    direction: ltr;
}

.clean-sub-upload {
    margin-top: 18px;
    background: var(--card-soft, #0f172a);
    border: 1px dashed var(--accent, #3b82f6);
    border-radius: 18px;
    padding: 18px;
}

.clean-sub-upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.clean-sub-video-section {
    margin-top: 20px;
}

.clean-sub-video-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.clean-video-placeholder,
.clean-video-card {
    min-height: 250px;
    background: var(--card-soft, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 18px;
    padding: 16px;
}

.clean-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    border-style: dashed;
}

.clean-placeholder-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(96,165,250,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 22px;
    font-weight: 900;
}

.clean-slot-title-input {
    width: 100%;
    background: rgba(59,130,246,0.10) !important;
    border: 1px solid rgba(96,165,250,0.45) !important;
    color: var(--app-text, #e5e7eb) !important;
    border-radius: 12px !important;
    padding: 9px 11px !important;
    font-weight: 900 !important;
    text-align: center !important;
    font-family: inherit !important;
}

.clean-slot-saved {
    background: rgba(34,197,94,0.20) !important;
    border-color: rgba(34,197,94,0.65) !important;
}

.clean-video-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.clean-video-title span,
.clean-video-placeholder span {
    color: var(--muted, #94a3b8);
    font-size: 12px;
    direction: ltr;
}

.clean-video-card video {
    width: 100%;
    max-height: 240px;
    border-radius: 14px;
    background: #000;
}

.clean-video-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.clean-video-actions a {
    background: var(--accent, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 12px;
    font-weight: 800;
}

/* Final STATUS widget */
.clean-status-widget {
    margin-top: 16px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 16px;
    padding: 16px;
}

.clean-status-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.clean-status-head strong {
    font-size: 18px;
    font-weight: 900;
}

.clean-status-head span {
    font-size: 14px;
    line-height: 2;
    color: var(--app-text, #e5e7eb);
    opacity: 0.92;
}

.clean-status-widget textarea {
    width: 100%;
    min-height: 86px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    border-radius: 14px !important;
    padding: 14px !important;
    resize: vertical;
}

.clean-status-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.clean-status-actions button,
.config-result button,
[id*="config"][id*="result"] button,
[class*="config"][class*="result"] button {
    min-width: 160px !important;
    min-height: 46px !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    border-radius: 16px !important;
    padding: 12px 18px !important;
}

@media (max-width: 760px) {
    .clean-sub-upload-row {
        grid-template-columns: 1fr;
    }
}

/* Ultimate visible STATUS widget under received SUB link */
.ultimate-status-widget {
    margin-top: 16px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 18px;
    padding: 16px;
}

.ultimate-status-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.ultimate-status-head strong {
    font-size: 18px;
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.ultimate-status-head span {
    font-size: 14px;
    line-height: 2;
    color: var(--app-text, #e5e7eb);
    opacity: 0.94;
}

.ultimate-status-widget textarea {
    width: 100%;
    min-height: 86px;
    direction: ltr !important;
    text-align: left !important;
    font-family: Consolas, Monaco, monospace !important;
    border-radius: 14px !important;
    padding: 14px !important;
    resize: vertical;
}

.ultimate-status-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.ultimate-status-actions button {
    min-width: 180px !important;
    min-height: 48px !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    border-radius: 16px !important;
    padding: 12px 18px !important;
}

/* Optional Radio Fields section inside SH */
.radio-sh-section {
    margin: 18px 0;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}

.radio-sh-section.hidden {
    display: none !important;
}

.radio-sh-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: #ffffff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 18px;
}

.radio-sh-head h2 {
    margin: 10px 0 6px;
    font-size: 24px;
}

.radio-sh-head p {
    margin: 0;
    line-height: 1.8;
    color: #dbeafe;
}

.radio-sh-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 12px 14px;
    font-weight: 900;
    white-space: nowrap;
}

.radio-sh-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent, #3b82f6);
}

.radio-sh-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.radio-sh-fields.disabled {
    opacity: 0.48;
    filter: grayscale(0.3);
}

.radio-sh-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.radio-sh-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.radio-sh-field input,
.radio-sh-field select,
.radio-sh-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.radio-sh-field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.9;
}

.radio-sh-field-wide {
    grid-column: 1 / -1;
}

.radio-sh-highlight-row {
    background: rgba(34, 197, 94, 0.14) !important;
    outline: 2px solid rgba(34, 197, 94, 0.35);
}

@media (max-width: 820px) {
    .radio-sh-head,
    .radio-sh-fields {
        grid-template-columns: 1fr;
    }

    .radio-sh-toggle {
        white-space: normal;
    }
}

/* Force-visible optional Radio Fields section */
#forceRadioShSection.hidden {
    display: none !important;
}

.force-radio-section {
    margin: 18px 0 22px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.38);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}

.force-radio-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: #ffffff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 18px;
}

.force-radio-head h2 {
    margin: 10px 0 6px;
    font-size: 24px;
}

.force-radio-head p {
    margin: 0;
    line-height: 1.8;
    color: #dbeafe;
}

.force-radio-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 12px 14px;
    font-weight: 900;
    white-space: nowrap;
}

.force-radio-toggle input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent, #3b82f6);
}

.force-radio-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.force-radio-fields.disabled {
    opacity: 0.48;
    filter: grayscale(0.25);
}

.force-radio-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.force-radio-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.force-radio-field input,
.force-radio-field select,
.force-radio-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.force-radio-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.force-radio-wide {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .force-radio-head,
    .force-radio-fields {
        grid-template-columns: 1fr;
    }

    .force-radio-toggle {
        white-space: normal;
    }
}

/* Final SH radio dropdown section */
#radioFinalSection.hidden,
#radioFinalFieldsWrap.hidden {
    display: none !important;
}

.radio-final-section {
    margin: 18px 0 24px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.38);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

.radio-final-main-field {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
}

.radio-final-main-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.radio-final-main-field select {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-weight: 900;
}

.radio-final-title {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.radio-final-title h2 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.radio-final-title p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.8;
}

.radio-final-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.radio-final-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.radio-final-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.radio-final-field input,
.radio-final-field select,
.radio-final-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.radio-final-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.radio-final-wide {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .radio-final-main-field,
    .radio-final-grid {
        grid-template-columns: 1fr;
    }
}

/* Ultra final SH radio dropdown */
#ultraRadioSection.hidden,
#ultraRadioFieldsWrap.hidden {
    display: none !important;
}

#ultraRadioSection {
    display: block;
}

.ultra-radio-section {
    margin: 18px 0 24px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

.ultra-radio-main-row {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
}

.ultra-radio-main-row label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.ultra-radio-main-row select {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-weight: 900;
}

.ultra-radio-title {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.ultra-radio-title h2 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.ultra-radio-title p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.8;
}

.ultra-radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.ultra-radio-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ultra-radio-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.ultra-radio-field input,
.ultra-radio-field select,
.ultra-radio-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.ultra-radio-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.ultra-radio-wide {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .ultra-radio-main-row,
    .ultra-radio-grid {
        grid-template-columns: 1fr;
    }
}

/* Ultra final SH radio dropdown */
#ultraRadioSection.hidden,
#ultraRadioFieldsWrap.hidden {
    display: none !important;
}

#ultraRadioSection {
    display: block;
}

.ultra-radio-section {
    margin: 18px 0 24px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

.ultra-radio-main-row {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
}

.ultra-radio-main-row label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.ultra-radio-main-row select {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-weight: 900;
}

.ultra-radio-title {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.ultra-radio-title h2 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.ultra-radio-title p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.8;
}

.ultra-radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.ultra-radio-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ultra-radio-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.ultra-radio-field input,
.ultra-radio-field select,
.ultra-radio-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.ultra-radio-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.ultra-radio-wide {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .ultra-radio-main-row,
    .ultra-radio-grid {
        grid-template-columns: 1fr;
    }
}

/* Radio UI cleanup: ردیف is export-only, not visible in SH form */
[data-ultra-radio="radio_row"],
[data-radio-final="radio_row"],
[data-force-radio="radio_row"],
[data-radio-sh-field="radio_row"],
[name="radio_row"] {
    display: none !important;
}

/* Hide old Radio frontend attempts */
#ultraRadioSection,
#radioFinalSection,
#forceRadioShSection,
#radioShOptionalSection {
    display: none !important;
}

/* Single-owner SH Radio section */
#rsRadioSection.hidden,
#rsFieldsWrap.hidden {
    display: none !important;
}

.rs-section {
    margin: 18px 0 24px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

.rs-main-row {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
}

.rs-main-row label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.rs-main-row select {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-weight: 900;
}

.rs-title {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.rs-title h2 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.rs-title p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.8;
}

.rs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.rs-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rs-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.rs-field input,
.rs-field select,
.rs-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.rs-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.rs-wide {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .rs-main-row,
    .rs-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide all older Radio attempts */
#ultraRadioSection,
#radioFinalSection,
#forceRadioShSection,
#radioShOptionalSection,
#rsRadioSection {
    display: none !important;
}

/* Final SH Radio section */
#shrMainRadioSection,
#shrModalRadioSection {
    display: block;
}

.shr-section {
    margin: 18px 0 24px;
    background: var(--card-bg, #111827);
    color: var(--app-text, #e5e7eb);
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

.shr-main-row {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
}

.shr-main-row label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.shr-main-row select {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-weight: 900;
}

.shr-fields-wrap.hidden {
    display: none !important;
}

.shr-title {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.shr-title h2 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.shr-title p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.8;
}

.shr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.shr-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.shr-field label {
    font-weight: 900;
    color: var(--app-text, #e5e7eb);
}

.shr-field input,
.shr-field select,
.shr-field textarea {
    background: var(--input-bg, #0f172a) !important;
    color: var(--app-text, #e5e7eb) !important;
    border: 1px solid var(--input-border, #475569) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
}

.shr-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.9;
}

.shr-wide {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .shr-main-row,
    .shr-grid {
        grid-template-columns: 1fr;
    }
}

/* SH Radio fields always visible inside the real SH form */
.sh-radio-always-box {
    grid-column: 1 / -1;
    margin: 18px 0 8px;
    background: var(--card-bg, #111827);
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

.sh-radio-always-title {
    background: linear-gradient(135deg, var(--topbar-bg, #020617), var(--accent, #3b82f6));
    color: #ffffff;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.sh-radio-always-title h2 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.sh-radio-always-title p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.8;
}

.sh-radio-always-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.sh-radio-always-grid .sh-final-field {
    margin: 0;
}

@media (max-width: 820px) {
    .sh-radio-always-grid {
        grid-template-columns: 1fr;
    }
}
