/* ==========================================================
   EXLABESA CORE - APP GLOBAL BASE
   Loaded on internal/logged-in platform pages only.
   Auth pages should use auth-styles.css instead.
   ========================================================== */
html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-primary);
    background-color: var(--surface-app-bg);
    background-image: none !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    color: var(--text-primary);
    font-family: inherit;
    line-height: 1.15;
}

h1 { font-weight: 700; }
h2, h3 { font-weight: 650; }
h4, h5, h6 { font-weight: 600; }

p {
    margin-top: 0;
}

/* Generic internal app building blocks */
.app-page {
    min-height: 100vh;
    padding: 28px 32px 36px;
    box-sizing: border-box;
    background: var(--surface-app-bg);
}

.app-section {
    display: grid;
    gap: 18px;
}

.app-grid {
    display: grid;
    gap: 18px;
}

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

.app-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.app-subtitle {
    margin: 0;
    color: var(--text-secondary);
}

.app-surface {
    background: var(--surface-card-bg);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(var(--text-primary-rgb), 0.06), 0 2px 8px rgba(var(--text-primary-rgb), 0.04);
}

.app-card-compact { padding: 16px; }
.app-card-comfortable { padding: 20px; }
.app-card-spacious { padding: 24px; }

.app-text-muted { color: var(--text-muted); }
.app-text-secondary { color: var(--text-secondary); }

.app-heading-soft { font-weight: 600 !important; }
.app-heading-standard { font-weight: 650 !important; }
.app-heading-strong { font-weight: 700 !important; }

@media (max-width: 900px) {
    .app-page { padding: 22px 18px; }
    .app-grid-2,
    .app-grid-3,
    .app-grid-4 { grid-template-columns: 1fr; }
}


.admin-page {
    min-height: 100vh;
    padding: 28px 32px 36px;
    box-sizing: border-box;
    background: var(--surface-app-bg);
}

.app-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.app-page-header h1 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.app-page-header p {
    margin: 0;
    color: var(--text-secondary);
}

.app-breadcrumb {
    margin-bottom: 12px !important;
    color: var(--text-muted) !important;
    font-size: 13px;
}

.app-card {
    background: var(--surface-card-bg);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(var(--text-primary-rgb), 0.06), 0 2px 8px rgba(var(--text-primary-rgb), 0.04);
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 20px 14px;
}

.app-card-header h2,
.app-card-header h3 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
}

.app-card-header p,
.permission-matrix-header p,
.role-assignment-panel p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.app-button {
    min-height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 8px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.app-button-primary {
    color: var(--surface-card-bg);
    background: var(--button-primary-bg);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(var(--state-info-text-rgb), 0.22);
}

.app-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.app-alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}

.app-alert-success {
    color: var(--state-success-text);
    background: var(--state-success-bg);
    border: 1px solid var(--state-success-border);
}

.app-alert-error {
    color: var(--state-error-text);
    background: var(--state-error-bg);
    border: 1px solid var(--state-error-border);
}

.admin-user-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    margin-bottom: 22px;
}

.app-search {
    position: relative;
    width: min(100%, 280px);
}

.app-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.app-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    box-sizing: border-box;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 8px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    outline: none;
}

.app-search input:focus {
    border-color: var(--state-info-text);
    box-shadow: 0 0 0 4px rgba(var(--state-info-text-rgb), 0.10);
}

.app-table-wrap {
    width: 100%;
    overflow-x: auto;
    padding: 0 12px 16px;
    box-sizing: border-box;
}

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

.app-table th {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.28);
    color: var(--text-secondary);
    text-align: left;
    font-weight: 800;
}

.app-table td {
    padding: 13px 10px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.18);
    color: var(--text-primary);
    vertical-align: middle;
}

.app-table tr.is-selected {
    background: rgba(var(--state-info-text-rgb), 0.08);
    outline: 1px solid rgba(var(--state-info-text-rgb), 0.32);
}

.app-table-actions {
    text-align: right;
    white-space: nowrap;
}

.app-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
}

.app-icon-button:hover {
    color: var(--state-info-text);
    background: rgba(var(--state-info-text-rgb), 0.08);
}

.app-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    margin: 2px 3px 2px 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.app-pill-success {
    color: var(--state-success-text);
    background: var(--state-success-bg);
}

.app-pill-muted {
    color: var(--text-secondary);
    background: var(--border-default);
}

.app-pill-info {
    color: var(--state-info-text);
    background: var(--state-info-bg);
}

.app-muted {
    color: var(--text-muted);
}

.app-detail-list {
    padding: 0 20px 20px;
    margin: 0;
}

.app-detail-list dt {
    margin-top: 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.app-detail-list dd {
    margin: 4px 0 0;
    color: var(--text-secondary);
}

.app-empty-state {
    padding: 0 20px 20px;
    color: var(--text-muted);
}

.permissions-card {
    padding-bottom: 18px;
}

.permissions-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    padding: 0 20px 20px;
}

.role-assignment-panel,
.permission-matrix-panel {
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 10px;
    background: var(--surface-card-bg);
}

.role-assignment-panel {
    padding: 18px;
}

.role-assignment-panel h3,
.permission-matrix-header h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.app-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 8px -8px;
    padding: 0 8px;
    border-radius: 8px;
    cursor: pointer;
}

.app-check-row:hover {
    background: rgba(var(--state-info-text-rgb), 0.06);
}

.app-check-row input {
    width: 16px;
    height: 16px;
}

.role-assignment-panel .app-button {
    width: 100%;
    margin-top: 18px;
}

.permission-matrix-panel {
    min-width: 0;
}

.permission-matrix-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 18px 6px;
}

.permission-matrix-table code {
    padding: 3px 6px;
    border-radius: 5px;
    color: var(--text-secondary);
    background: var(--surface-card-subtle);
}

.app-table-check {
    color: var(--state-info-text);
}

@media (max-width: 1100px) {
    .admin-user-layout,
    .permissions-layout {
        grid-template-columns: 1fr;
    }

    .admin-user-detail-card {
        order: -1;
    }
}

@media (max-width: 760px) {
    .admin-page {
        padding: 22px 18px;
    }

    .app-page-header,
    .app-card-header,
    .permission-matrix-header {
        flex-direction: column;
    }

    .app-search {
        width: 100%;
    }
}


/* ==========================================================
   EXLABESA CORE - ADMIN USER MANAGEMENT EXTENSIONS
   Features: modals, editable permissions, role chips, user flags
   ========================================================== */

.app-pill-danger {
    color: var(--state-error-text);
    background: var(--state-error-bg);
}

.app-pill-purple {
    color: var(--brand-accent);
    background: var(--state-warning-bg);
}

.app-button-warning {
    color: var(--state-warning-text);
    background: var(--state-warning-bg);
    border-color: var(--state-warning-border);
}

.app-button-danger {
    color: var(--surface-card-bg);
    background: linear-gradient(135deg, var(--state-error-text), var(--state-error-text));
    border-color: transparent;
}

.role-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 12px;
}

.role-chip {
    min-height: 32px;
    padding: 0 10px;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    border: 1px solid rgba(var(--brand-primary-rgb), 0.28);
    border-radius: 999px;

    color: var(--text-primary);
    background: var(--surface-card-bg);

    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.role-chip:hover {
    color: var(--state-info-text);
    background: var(--state-info-bg);
    border-color: rgba(var(--state-info-text-rgb), 0.35);
}

.matrix-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 18px 18px;
}

.matrix-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.matrix-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.matrix-check span {
    width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(var(--brand-primary-rgb), 0.5);
    border-radius: 5px;
    background: var(--surface-card-bg);
}

.matrix-check input:checked + span {
    border-color: var(--state-info-text);
    background: var(--state-info-text);
}

.matrix-check input:checked + span::after {
    content: "✓";
    color: var(--surface-card-bg);
    font-size: 12px;
    font-weight: 900;
}

/* Modal shell */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 200;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;
    box-sizing: border-box;
}

.app-modal.is-open {
    display: flex;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(var(--text-primary-rgb), 0.55);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.app-modal-panel {
    position: relative;
    z-index: 1;

    width: min(96vw, 720px);
    max-height: 92vh;
    overflow-y: auto;

    background: var(--surface-card-bg);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
    border-radius: 16px;
    box-shadow: 0 30px 90px rgba(var(--text-primary-rgb), 0.35);
}

.app-modal-panel-small {
    width: min(96vw, 520px);
}

.app-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.18);
}

.app-modal-header h2 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 800;
}

.app-modal-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.app-modal-close {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    color: var(--text-secondary);
    background: var(--surface-card-subtle);
    cursor: pointer;
}

.app-modal-close:hover {
    color: var(--text-primary);
    background: var(--border-subtle);
}

.app-modal-body {
    padding: 20px 24px 24px;
}

.app-modal-section {
    border-top: 1px solid rgba(var(--brand-primary-rgb), 0.18);
}

.app-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.app-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.app-form-grid input[type="text"],
.app-form-grid input[type="email"],
.app-form-grid input[type="password"],
.app-form-grid textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    box-sizing: border-box;

    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 8px;

    color: var(--text-primary);
    background: var(--surface-card-bg);
    outline: none;

    font-size: 14px;
    font-weight: 400;
}

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

.app-form-grid input:focus,
.app-form-grid textarea:focus {
    border-color: var(--state-info-text);
    box-shadow: 0 0 0 4px rgba(var(--state-info-text-rgb), 0.10);
}

.app-check-row-inline {
    flex-direction: row !important;
    align-items: center;
    font-weight: 700 !important;
}

.app-modal-actions {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 4px;
}

@media (max-width: 760px) {
    .app-form-grid {
        grid-template-columns: 1fr;
    }

    .app-modal-actions {
        justify-content: stretch;
    }

    .app-modal-actions .app-button {
        flex: 1;
    }
}
/* ==========================================================
   EXLABESA CORE - NAVIGATION MANAGEMENT
   Add to: app-styles.css
   ========================================================== */

.admin-nav-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
}

.admin-nav-groups {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}

.admin-nav-group-card {
    width: 100%;
    padding: 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    border: 1px solid rgba(var(--brand-primary-rgb), 0.24);
    border-radius: 10px;

    color: var(--text-primary);
    background: var(--surface-card-bg);
    text-align: left;
    cursor: pointer;
}

.admin-nav-group-card:hover {
    border-color: rgba(var(--state-info-text-rgb), 0.35);
    background: rgba(var(--state-info-text-rgb), 0.04);
}

.admin-nav-group-card strong {
    display: block;
    margin-bottom: 3px;
}

.admin-nav-group-card small {
    color: var(--text-muted);
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.app-icon-danger:hover {
    color: var(--state-error-text);
    background: rgba(var(--state-error-text-rgb), 0.08);
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 22px;
}

.app-modal.is-open {
    display: flex;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(var(--text-primary-rgb), 0.48);
    backdrop-filter: blur(4px);
}

.app-modal-panel {
    position: relative;
    z-index: 1;

    width: min(760px, 96vw);
    max-height: 92vh;
    overflow-y: auto;

    background: var(--surface-card-bg);
    border-radius: 14px;
    box-shadow: 0 26px 90px rgba(var(--text-primary-rgb), 0.34);
}

.app-modal-small {
    width: min(520px, 96vw);
}

.app-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding: 22px 22px 14px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.22);
}

.app-modal-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.app-modal-header p {
    margin: 0;
    color: var(--text-secondary);
}

.app-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;

    padding: 22px;
}

.app-form-grid label {
    display: grid;
    gap: 7px;

    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.app-form-grid input,
.app-form-grid select {
    min-height: 40px;
    padding: 0 11px;

    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 8px;

    color: var(--text-primary);
    background: var(--surface-card-bg);
    font: inherit;
    font-weight: 400;
}

.app-form-grid input:focus,
.app-form-grid select:focus {
    outline: none;
    border-color: var(--state-info-text);
    box-shadow: 0 0 0 4px rgba(var(--state-info-text-rgb), 0.10);
}

.app-check-row-compact {
    align-self: end;
    min-height: 40px;
}

.app-modal-actions {
    grid-column: 1 / -1;

    display: flex;
    justify-content: flex-end;
    gap: 10px;

    padding-top: 8px;
}

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

@media (max-width: 720px) {
    .app-form-grid {
        grid-template-columns: 1fr;
    }
}
.body{
    background-image:none !important;
}

/* ==========================================================
   EXLABESA CORE - CORE DASHBOARD
   Logged-in dashboard layout independent from auth-styles.css
   ========================================================== */
.dashboard-shell {
    min-height: 100vh;
    box-sizing: border-box;
    background:
        linear-gradient(90deg, rgba(var(--surface-card-bg-rgb), .94), rgba(var(--surface-card-bg-rgb), .80)),
        var(--surface-app-bg);
}

.dashboard-page {
    padding: 28px 32px 36px;
    box-sizing: border-box;
}

.dashboard-hero {
    min-height: 126px;
    padding: 28px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.dashboard-hero h1 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.dashboard-hero p:not(.app-breadcrumb) {
    margin: 0;
    max-width: 720px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.45;
}

.dashboard-user-card {
    min-width: 230px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 14px;
    background: rgba(var(--surface-card-bg-rgb), .72);
}

.dashboard-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--surface-card-bg);
    background: var(--button-primary-bg);
    font-weight: 700;
}

.dashboard-user-card strong,
.dashboard-user-card span {
    display: block;
}

.dashboard-user-card strong {
    font-weight: 650;
}

.dashboard-user-card span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 13px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
}

.dashboard-main-column,
.dashboard-side-column {
    display: grid;
    gap: 22px;
    align-content: start;
}

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

.dashboard-module-card {
    position: relative;
    min-height: 150px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 14px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.dashboard-module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--state-info-text-rgb), 0.34);
    box-shadow: 0 18px 36px rgba(var(--text-primary-rgb), 0.10);
}

.dashboard-module-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 18px;
    background: var(--state-info-bg);
    color: var(--state-info-text);
}

.dashboard-module-warning .dashboard-module-icon { color: var(--state-warning-text); background: var(--state-warning-bg); }
.dashboard-module-green .dashboard-module-icon { color: var(--state-success-text); background: var(--state-success-bg); }
.dashboard-module-purple .dashboard-module-icon { color: var(--brand-accent); background: var(--state-warning-bg); }
.dashboard-module-neutral .dashboard-module-icon { color: var(--text-secondary); background: var(--surface-card-subtle); }

.dashboard-module-title {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 650;
}

.dashboard-module-description {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-module-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    min-height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--state-info-text);
    background: var(--state-info-bg);
    font-size: 12px;
    font-weight: 600;
}

.dashboard-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 20px 20px;
}

.dashboard-action-card {
    min-height: 70px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 12px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    text-decoration: none;
    font-weight: 650;
}

.dashboard-action-card i {
    color: var(--state-info-text);
}

.dashboard-notice-list,
.dashboard-help-card {
    padding: 0 20px 20px;
}

.dashboard-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid rgba(var(--brand-primary-rgb), 0.16);
}

.dashboard-notice:first-child {
    border-top: 0;
    padding-top: 0;
}

.dashboard-notice-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--state-info-text);
    background: var(--state-info-bg);
}

.dashboard-notice strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-weight: 650;
}

.dashboard-notice p,
.dashboard-help-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-help-card .app-button {
    width: auto;
    min-width: 180px;
    margin-top: 16px;
}

.dashboard-help-card {
    display: grid;
    justify-items: start;
}

.dashboard-news {
    margin-top: 22px;
    min-height: 220px;
    padding: 26px;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: contain;
}

.dashboard-news > div {
    max-width: 620px;
}

.dashboard-news-label {
    color: var(--state-info-text);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.dashboard-news h2 {
    margin: 8px 0 4px;
    font-size: 24px;
    font-weight: 650;
}

.dashboard-news h3 {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.platform-status-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(var(--text-primary-rgb), 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.platform-status-card {
    width: min(92vw, 480px);
    padding: 34px 34px 30px;
    border-radius: 18px;
    background: var(--surface-card-bg);
    border: 1px solid var(--border-default);
    box-shadow: 0 24px 70px rgba(var(--text-primary-rgb), 0.28);
    text-align: center;
}

.platform-status-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--surface-card-bg);
    background: var(--state-error);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

/* Typography tone-down for logged-in pages */
body {
    font-family: var(--font-family-base);
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6,
.app-page-header h1,
.app-card-header h2,
.app-card-header h3,
.dashboard-hero h1,
.dashboard-module-title,
.dashboard-action-card,
.dashboard-notice strong {
    font-family: inherit;
}

.app-page-header h1,
.dashboard-hero h1 {
    font-weight: 700 !important;
}

.app-card-header h2,
.app-card-header h3 {
    font-weight: 650 !important;
}

.app-button,
.app-pill {
    font-weight: 600 !important;
}

/* Safety net: logged-in app pages should never inherit auth background imagery/overlay. */
body:not(.auth-page) {
    background-image: none !important;
}
body:not(.auth-page)::before {
    content: none !important;
}

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

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

@media (max-width: 760px) {
    .dashboard-page {
        padding: 20px 16px;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .dashboard-user-card {
        width: 100%;
        box-sizing: border-box;
    }

    .dashboard-module-grid,
    .dashboard-action-row {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   EXLABESA CORE - GLOBAL TYPOGRAPHY NORMALISATION
   Keeps internal platform pages clean without relying on auth CSS.
   ========================================================== */
.app-page-header h1,
.dashboard-hero h1 {
    font-family: inherit;
    font-weight: 700 !important;
    letter-spacing: -0.035em;
}

.app-card-header h2,
.app-card-header h3,
.dashboard-module-title,
.dashboard-notice strong,
.dashboard-help-card strong,
.dashboard-action-card {
    font-family: inherit;
    font-weight: 600 !important;
}

.dashboard-hero p:not(.app-breadcrumb),
.dashboard-module-description,
.dashboard-notice p,
.dashboard-help-card p {
    font-weight: 400;
}

.app-button {
    font-weight: 600 !important;
}

.dashboard-help-card .app-button {
    width: auto !important;
    min-width: 180px;
    max-width: 100%;
}

body:not(.auth-page),
body:not(.auth-page)::before,
body:not(.auth-page)::after {
    background-image: none !important;
}

body:not(.auth-page)::before,
body:not(.auth-page)::after {
    content: none !important;
}


/* ==========================================================
   Core dashboard header refinement
   Header sits directly on the page, not inside a card.
   ========================================================== */
.dashboard-hero {
    min-height: auto;
    padding: 0;
    margin: 0 0 22px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.dashboard-hero h1 {
    font-size: clamp(26px, 2.8vw, 36px);
    font-weight: 650;
}

.dashboard-user-card {
    background: var(--surface-card-bg);
    box-shadow: 0 10px 24px rgba(var(--text-primary-rgb), 0.04);
}

.dashboard-help-card .app-button {
    width: auto;
    min-width: 170px;
    align-self: flex-start;
}

@media (max-width: 760px) {
    .dashboard-help-card .app-button {
        width: 100%;
    }
}


/* ==========================================================
   EXLABESA CORE - ADMIN PAGES FINAL POLISH
   Global admin styling loaded through app-styles.css.
   Keep page files focused on structure/function; page-specific CSS lives here.
   ========================================================== */

.app-main.admin-page,
.main-content.admin-page,
.admin-page {
    min-height: 100vh;
    padding: 28px 32px 36px;
    background: var(--surface-app-bg);
}

.app-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.app-card {
    overflow: hidden;
}

.app-card-header {
    min-height: 70px;
}

.app-table-wrap {
    padding: 0 18px 18px;
}

.app-table {
    min-width: 760px;
}

.app-table tbody tr {
    transition: background 140ms ease, box-shadow 140ms ease;
}

.app-table tbody tr:hover {
    background: rgba(var(--state-info-text-rgb), 0.035);
}

.app-table code,
.app-confirm-box code,
.admin-nav-group-card small {
    font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
}

.app-table code {
    display: inline-block;
    max-width: 340px;
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--text-secondary);
    background: var(--surface-card-subtle);
    white-space: normal;
    word-break: break-word;
}

.app-icon-button {
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.app-icon-button:focus-visible,
.app-button:focus-visible,
.app-search input:focus-visible,
.app-form-grid input:focus-visible,
.app-form-grid select:focus-visible,
.app-form-grid textarea:focus-visible,
.user-admin-form-grid input:focus-visible,
.user-admin-field input:focus-visible,
.user-admin-field textarea:focus-visible {
    outline: none;
    border-color: var(--state-info-text);
    box-shadow: 0 0 0 4px rgba(var(--state-info-text-rgb), 0.12);
}

.admin-user-layout,
.admin-nav-layout {
    align-items: start;
}

.admin-users-card .app-table {
    min-width: 1180px;
}

.admin-groups-card {
    position: sticky;
    top: 24px;
    padding: 20px;
}

.admin-groups-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 650;
}

.admin-groups-card > p {
    margin: 0 0 14px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.admin-groups-notice {
    display: grid;
    gap: 6px;
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    background: var(--surface-card-subtle);
    color: var(--text-secondary);
    font-size: 13px;
}

.admin-groups-notice strong {
    color: var(--text-primary);
    font-weight: 650;
}

.admin-groups-notice .app-button,
.admin-groups-notice a.app-button {
    width: 100%;
    margin-top: 8px;
}

.admin-groups-notice-ad {
    border-color: rgba(var(--state-info-text-rgb), 0.24);
    background: var(--state-info-bg);
}

.admin-groups-notice-local {
    border-color: rgba(var(--state-success-text-rgb), 0.22);
    background: var(--state-success-bg);
}

.admin-groups-notice-empty {
    border-color: rgba(var(--state-warning-text-rgb), 0.25);
    background: var(--state-warning-bg);
}

.app-check-row.is-disabled,
.app-check-row:has(input:disabled) {
    opacity: 0.58;
    cursor: not-allowed;
}

.admin-groups-card .app-check-row {
    margin-left: 0;
    margin-right: 0;
}

.admin-groups-card > .app-button {
    width: 100%;
    margin-top: 10px;
}

.permissions-card {
    margin-top: 22px;
}

.permission-create-button {
    margin: 0 20px 16px;
}

.permissions-layout-matrix-only {
    grid-template-columns: 1fr !important;
    padding-top: 0;
}

.permission-matrix-panel {
    overflow: hidden;
}

.permission-matrix-scroll {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
}

.permission-matrix-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.16);
}

.role-chip-bar {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.12);
    background: var(--surface-card-subtle);
}

.permission-matrix-table {
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
}

.permission-matrix-table th,
.permission-matrix-table td {
    min-width: 104px;
    width: 104px;
}

.permission-matrix-table th:nth-child(1),
.permission-matrix-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 150px;
    width: 150px;
    max-width: 150px;
    background: var(--surface-card-bg);
    box-shadow: 1px 0 0 rgba(var(--brand-primary-rgb), 0.10);
}

.permission-matrix-table th:nth-child(2),
.permission-matrix-table td:nth-child(2) {
    position: sticky;
    left: 150px;
    z-index: 4;
    min-width: 230px;
    width: 230px;
    max-width: 230px;
    background: var(--surface-card-bg);
    box-shadow: 1px 0 0 rgba(var(--brand-primary-rgb), 0.10);
}

.permission-matrix-table th:nth-child(3),
.permission-matrix-table td:nth-child(3) {
    position: sticky;
    left: 380px;
    z-index: 4;
    min-width: 92px;
    width: 92px;
    max-width: 92px;
    background: var(--surface-card-bg);
    box-shadow: 6px 0 12px rgba(15, 23, 42, 0.08);
}

.permission-matrix-table thead th {
    z-index: 5;
    background: var(--surface-card-subtle);
}

.permission-matrix-table thead th:nth-child(1),
.permission-matrix-table thead th:nth-child(2),
.permission-matrix-table thead th:nth-child(3) {
    z-index: 7;
    background: var(--surface-card-subtle);
}

.permission-matrix-table td:nth-child(1),
.permission-matrix-table td:nth-child(2),
.permission-matrix-table td:nth-child(3) {
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.permission-matrix-table code {
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.permission-matrix-table th:not(:first-child),
.permission-matrix-table td:not(:first-child) {
    text-align: center;
}

.permission-matrix-table th:first-child,
.permission-matrix-table td:first-child,
.permission-matrix-table th:nth-child(2),
.permission-matrix-table td:nth-child(2) {
    text-align: left;
}

.permission-row-actions {
    width: 84px;
    white-space: nowrap;
}

.matrix-actions {
    border-top: 1px solid rgba(var(--brand-primary-rgb), 0.14);
    background: var(--surface-card-bg);
}

.app-confirm-box {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(var(--state-error-text-rgb), 0.22);
    border-radius: 10px;
    color: var(--state-error-text);
    background: var(--state-error-bg);
}

.app-confirm-box strong {
    color: var(--state-error-text);
}

/* Shared modal and form reset */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app-modal.is-open {
    display: flex;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(var(--text-primary-rgb), 0.52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.app-modal-panel,
.app-modal-panel-small,
.app-modal-small {
    position: relative;
    z-index: 1;
    width: min(760px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
    border-radius: 16px;
    background: var(--surface-card-bg);
    box-shadow: 0 30px 90px rgba(var(--text-primary-rgb), 0.35);
}

.app-modal-panel-small,
.app-modal-small {
    width: min(520px, 96vw);
}

.app-modal-header {
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.18);
}

.app-modal-body,
.app-form-grid {
    padding: 20px 24px 24px;
}

.app-form-grid input[type="text"],
.app-form-grid input[type="email"],
.app-form-grid input[type="password"],
.app-form-grid input[type="number"],
.app-form-grid select,
.app-form-grid textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 9px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    font: inherit;
    font-weight: 400;
}

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

/* User edit modal */
.user-admin-modal-panel {
    width: min(980px, 96vw);
    max-height: 92vh;
    background: var(--surface-card-subtle);
}

.user-admin-modal-header {
    background: var(--surface-card-bg);
}

.user-admin-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-admin-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--surface-card-bg);
    background: var(--button-primary-bg);
    font-size: 18px;
    font-weight: 800;
}

.user-admin-modal-content {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.user-admin-section {
    padding: 18px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.20);
    border-radius: 14px;
    background: var(--surface-card-bg);
}

.user-admin-section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.user-admin-section-title h3 {
    margin: 0 0 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 650;
}

.user-admin-section-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.user-admin-form-grid,
.user-admin-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.user-admin-form-grid label,
.user-admin-field {
    display: grid;
    gap: 7px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.user-admin-form-grid input,
.user-admin-field input,
.user-admin-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 9px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    font: inherit;
    font-weight: 400;
}

.user-admin-field textarea {
    min-height: 86px;
    padding-top: 10px;
    resize: vertical;
}

.user-admin-flags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.user-admin-toggle {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 12px;
    background: var(--surface-card-subtle);
    cursor: pointer;
}

.user-admin-toggle:hover {
    border-color: rgba(var(--state-info-text-rgb), 0.30);
    background: var(--state-info-bg);
}

.user-admin-toggle input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
}

.user-admin-toggle strong,
.user-admin-toggle small {
    display: block;
}

.user-admin-toggle strong {
    color: var(--text-primary);
    font-weight: 650;
}

.user-admin-toggle small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.user-admin-toggle-danger {
    border-color: rgba(var(--state-error-text-rgb), 0.22);
    background: var(--state-error-bg);
}

.user-admin-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.user-admin-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.user-admin-danger-section {
    border-color: rgba(var(--state-error-text-rgb), 0.18);
}

/* AD mapping/navigation admin side panels */
.admin-nav-layout > aside.app-card .app-detail-list dd,
.admin-nav-layout > aside.app-card .app-detail-list dt {
    word-break: break-word;
}

@media (max-width: 1180px) {
    .admin-groups-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .app-main.admin-page,
    .main-content.admin-page,
    .admin-page {
        padding: 22px 18px;
    }

    .app-page-actions,
    .app-page-header {
        align-items: stretch;
    }

    .app-page-actions .app-button {
        width: 100%;
    }

    .user-admin-form-grid,
    .user-admin-two-col,
    .user-admin-flags {
        grid-template-columns: 1fr;
    }

    .user-admin-section-title {
        flex-direction: column;
    }

    .user-admin-section-title .app-button,
    .user-admin-actions .app-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .app-modal {
        align-items: flex-start;
        padding: 12px;
    }

    .app-modal-panel,
    .app-modal-panel-small,
    .app-modal-small,
    .user-admin-modal-panel {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 14px;
    }

    .app-modal-body,
    .app-form-grid,
    .user-admin-modal-content {
        padding: 16px;
    }

    .user-admin-password-row {
        grid-template-columns: 1fr;
    }
}
/* ==========================================================
   EXLABESA CORE - DASHBOARD V2
   Append to app-styles.css or load after app-styles.css.
   ========================================================== */

.dashboard-v2-shell {
    background:
        radial-gradient(circle at 20% 0%, rgba(var(--state-info-text-rgb), 0.08), transparent 28%),
        var(--surface-app-bg);
}

.dashboard-v2-page {
    display: grid;
    gap: 22px;
}

.dashboard-v2-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-v2-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.dashboard-v2-hero p:not(.app-breadcrumb) {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.dashboard-status-dot {
    width: 9px;
    height: 9px;
    display: inline-flex;
    border-radius: 50%;
    background: var(--state-success-text);
    box-shadow: 0 0 0 4px rgba(var(--state-success-text-rgb), 0.12);
}

.dashboard-status-dot.is-beta {
    background: var(--state-warning-text);
    box-shadow: 0 0 0 4px rgba(var(--state-warning-text-rgb), 0.15);
}

.dashboard-status-dot.is-closed {
    background: var(--state-error-text);
    box-shadow: 0 0 0 4px rgba(var(--state-error-text-rgb), 0.15);
}

.dashboard-beta-banner {
    padding: 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    border-color: rgba(var(--brand-accent-rgb), 0.22);
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--brand-accent-rgb), 0.10), transparent 36%),
        var(--surface-card-bg);
}

.dashboard-beta-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--brand-accent);
    background: var(--state-warning-bg);
    font-size: 24px;
}

.dashboard-beta-copy h2 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 700;
}

.dashboard-beta-copy p {
    margin: 0;
    color: var(--text-secondary);
}

.dashboard-beta-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-v2-top-grid,
.dashboard-v2-main-grid {
    display: grid;
    gap: 22px;
}

.dashboard-v2-top-grid {
    grid-template-columns: minmax(340px, 0.9fr) minmax(480px, 1.25fr);
}

.dashboard-v2-main-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
}

.dashboard-v2-main-column,
.dashboard-v2-side-column {
    display: grid;
    gap: 22px;
    align-content: start;
}

.dashboard-section .app-card-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.dashboard-section .app-card-header h2 i {
    color: var(--state-info-text);
    font-size: 15px;
}

.dashboard-v2-actions {
    padding: 0 20px 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-v2-action {
    min-height: 74px;
    padding: 14px 12px;
    display: grid;
    place-items: center;
    gap: 8px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.24);
    border-radius: 12px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    text-decoration: none;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: center;
    cursor: pointer;
}

.dashboard-v2-action:hover {
    border-color: rgba(var(--state-info-text-rgb), 0.32);
    background: var(--surface-card-subtle);
    color: var(--state-info-text);
}

.dashboard-v2-action i {
    font-size: 20px;
    color: var(--state-info-text);
}

.dashboard-help-strip {
    margin: 0 20px 20px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    background: var(--state-info-bg);
    color: var(--text-secondary);
    font-size: 13px;
}

.dashboard-help-strip a {
    color: var(--state-info-text);
    font-weight: 700;
    text-decoration: none;
}

.dashboard-site-clock-grid {
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
}

.dashboard-site-clock {
    min-height: 142px;
    padding: 14px;
    display: grid;
    gap: 4px;
    align-content: start;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 12px;
    background: var(--surface-card-bg);
}

.dashboard-site-flag {
    font-size: 24px;
    line-height: 1;
}

.dashboard-site-clock strong {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-site-clock small,
.dashboard-site-date {
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-site-time {
    margin-top: 8px;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.dashboard-v2-module-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-v2-module-card {
    min-height: 168px;
}

.dashboard-attention-grid {
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-attention-card {
    min-height: 118px;
    padding: 16px;
    display: grid;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.18);
    background: var(--surface-card-subtle);
    color: var(--text-primary);
    text-decoration: none;
}

.dashboard-attention-card i {
    justify-self: end;
    font-size: 18px;
}

.dashboard-attention-card strong {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
}

.dashboard-attention-card span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 650;
}

.dashboard-attention-card.is-purple {
    background: var(--surface-card-subtle);
    color: var(--brand-accent);
}

.dashboard-attention-card.is-green {
    background: var(--state-success-bg);
    color: var(--state-success-text);
}

.dashboard-attention-card.is-orange {
    background: var(--state-warning-bg);
    color: var(--brand-accent);
}

.dashboard-news-list-v2 {
    padding: 0 20px 20px;
    display: grid;
    gap: 10px;
}

.dashboard-news-item-v2 {
    position: relative;
    padding: 15px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.18);
    border-radius: 12px;
    background: var(--surface-card-bg);
}

.dashboard-news-item-v2.is-featured {
    padding: 18px;
    background: var(--surface-card-subtle);
}

.dashboard-news-item-v2.is-important {
    border-color: rgba(var(--state-error-text-rgb), 0.20);
    background: var(--state-error-bg);
    box-shadow: inset 3px 0 0 var(--state-error-text);
}

.dashboard-news-category {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    margin-bottom: 9px;
    border-radius: 999px;
    color: var(--state-info-text);
    background: var(--state-info-bg);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-news-item-v2.is-important .dashboard-news-category {
    color: var(--state-error-text);
    background: var(--state-error-bg);
}

.dashboard-news-item-v2 h3 {
    margin: 0 0 7px;
    font-size: 15px;
    font-weight: 750;
}

.dashboard-news-item-v2 p {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-news-item-v2 small {
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-news-item-v2 a {
    float: right;
    color: var(--state-info-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-empty-news {
    padding: 28px 18px;
    display: grid;
    justify-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}

.dashboard-empty-news i {
    font-size: 28px;
    color: var(--state-info-text);
}

.dashboard-empty-news strong {
    color: var(--text-primary);
}

@media (max-width: 1280px) {
    .dashboard-v2-top-grid,
    .dashboard-v2-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-site-clock-grid {
        grid-template-columns: repeat(4, minmax(110px, 1fr));
    }
}

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

    .dashboard-site-clock-grid,
    .dashboard-attention-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-beta-banner {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .dashboard-beta-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .dashboard-beta-actions .app-button {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .dashboard-v2-page {
        gap: 16px;
    }

    .dashboard-v2-actions,
    .dashboard-v2-module-grid,
    .dashboard-site-clock-grid,
    .dashboard-attention-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-v2-hero h1 {
        font-size: 28px;
    }

    .dashboard-beta-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .dashboard-beta-icon {
        margin: 0 auto;
    }
}

/* ==========================================================
   EXLABESA CORE - CORPORATE NEWS MANAGEMENT
   Controller: /site-pages/controllers/admin-tools/news-management.php
   ========================================================== */
.news-admin-page {
    display: grid;
    gap: 22px;
}

.news-admin-header {
    margin-bottom: 0;
}

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

.news-stat-card {
    min-height: 112px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "icon value"
        "icon label";
    gap: 4px 14px;
    align-items: center;
}

.news-stat-card span {
    grid-area: icon;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--state-info-text);
    background: var(--state-info-bg);
    font-size: 18px;
}

.news-stat-card strong {
    grid-area: value;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.news-stat-card small {
    grid-area: label;
    color: var(--text-muted);
    font-size: 13px;
}

.news-editor-card,
.news-list-card {
    overflow: hidden;
}

.news-editor-form {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 16px;
    padding: 0 20px 20px;
}

.news-field {
    display: grid;
    gap: 7px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.news-field span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.news-field input,
.news-field textarea,
.news-filter-bar input,
.news-filter-bar select,
.news-filter-bar textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 10px;
    color: var(--text-primary);
    background: var(--surface-card-bg);
    font: inherit;
    font-weight: 400;
    outline: none;
}

.news-field textarea {
    padding-top: 11px;
    resize: vertical;
}

.news-field input:focus,
.news-field textarea:focus,
.news-filter-bar input:focus,
.news-filter-bar select:focus {
    border-color: var(--state-info-text);
    box-shadow: 0 0 0 4px rgba(var(--state-info-text-rgb), 0.10);
}

.news-field-title,
.news-field-summary,
.news-field-body {
    grid-column: 1 / -1;
}

.news-field-body textarea {
    min-height: 190px;
}

.news-toggle-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.news-toggle-card {
    min-height: 80px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
    border-radius: 13px;
    background: var(--surface-card-subtle);
    cursor: pointer;
}

.news-toggle-card:hover {
    border-color: rgba(var(--state-info-text-rgb), 0.30);
    background: var(--state-info-bg);
}

.news-toggle-card input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.news-toggle-card strong,
.news-toggle-card small {
    display: block;
}

.news-toggle-card strong {
    font-weight: 700;
}

.news-toggle-card small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.news-editor-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.news-filter-bar {
    display: grid;
    grid-template-columns: 180px 220px minmax(240px, 1fr) 120px auto;
    gap: 12px;
    align-items: end;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.16);
}

.news-filter-bar label {
    display: grid;
    gap: 7px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.news-table-wrap {
    padding-top: 0;
}

.news-table {
    min-width: 980px;
}

.news-table-title,
.news-table-summary {
    display: block;
}

.news-table-title {
    margin-bottom: 5px;
    font-weight: 750;
}

.news-table-summary {
    max-width: 620px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.news-empty-row {
    padding: 34px !important;
    color: var(--text-muted) !important;
    text-align: center;
}

.news-empty-row i,
.news-empty-row strong,
.news-empty-row span {
    display: block;
}

.news-empty-row i {
    margin-bottom: 10px;
    color: var(--state-info-text);
    font-size: 28px;
}

.news-empty-row strong {
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 16px;
}

@media (max-width: 1250px) {
    .news-admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-editor-form,
    .news-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .news-filter-bar .app-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .news-admin-stats,
    .news-editor-form,
    .news-toggle-group,
    .news-filter-bar {
        grid-template-columns: 1fr;
    }

    .news-editor-actions {
        flex-direction: column-reverse;
    }

    .news-editor-actions .app-button {
        width: 100%;
    }
}

/* ==========================================================
   EXLABESA CORE - DASHBOARD WIDGET RUNTIME GRID
   Used by DashboardWidgetFunctions::renderDashboard()
   ========================================================== */

.dashboard-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    width: 100%;
}

.dashboard-widget-shell {
    min-width: 0;
}

.dashboard-widget-span-1 {
    grid-column: span 1;
}

.dashboard-widget-span-2 {
    grid-column: span 2;
}

.dashboard-widget-span-3 {
    grid-column: span 3;
}

.dashboard-widget-span-4 {
    grid-column: span 4;
}

.dashboard-widget-rowspan-1 {
    min-height: 0;
}

.dashboard-widget-rowspan-2 {
    min-height: 220px;
}

.dashboard-widget-rowspan-3 {
    min-height: 340px;
}

.dashboard-widget-rowspan-4 {
    min-height: 460px;
}

.dashboard-widget-shell > .app-card,
.dashboard-widget-shell > .app-surface,
.dashboard-widget-shell > .ec-widget {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .dashboard-widget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-widget-span-3,
    .dashboard-widget-span-4 {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .dashboard-widget-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-widget-span-1,
    .dashboard-widget-span-2,
    .dashboard-widget-span-3,
    .dashboard-widget-span-4 {
        grid-column: span 1;
    }
}
/* ==========================================================
   EXLABESA CORE - GLOBAL DASHBOARD WIDGETS
   Shared widget markup used by dashboard widgets.
   ========================================================== */

.dashboard-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    width: 100%;
}

.dashboard-widget-shell {
    min-width: 0;
}

.dashboard-widget-span-1 {
    grid-column: span 1;
}

.dashboard-widget-span-2 {
    grid-column: span 2;
}

.dashboard-widget-span-3 {
    grid-column: span 3;
}

.dashboard-widget-span-4 {
    grid-column: span 4;
}

.dashboard-widget-rowspan-1 {
    min-height: 0;
}

.dashboard-widget-rowspan-2 {
    min-height: 220px;
}

.dashboard-widget-rowspan-3 {
    min-height: 340px;
}

.dashboard-widget-rowspan-4 {
    min-height: 460px;
}

.widget-card {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.widget-head {
    min-height: 70px;
    padding: 18px 20px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.widget-head h3 {
    margin: 0 0 5px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.widget-head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.widget-kicker {
    margin: 0 0 5px !important;
    color: var(--state-info-text) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.widget-head-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 8px;
}

.widget-body {
    padding: 0 20px 20px;
}

.widget-body-flush {
    padding: 0;
}

.widget-body-compact {
    padding: 0 14px 14px;
}

.widget-body-scroll {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
}

.widget-body-scroll::-webkit-scrollbar {
    width: 6px;
}

.widget-body-scroll::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
}

.widget-empty,
.widget-loading,
.widget-error {
    padding: 18px;
    border: 1px dashed rgba(var(--brand-primary-rgb), 0.35);
    border-radius: 12px;
    color: var(--text-muted);
    background: var(--surface-card-subtle);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.widget-error {
    color: var(--state-error-text);
    background: var(--state-error-bg);
    border-color: var(--state-error-border);
}

.widget-tabs {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border: 1px solid var(--state-info-bg);
    border-radius: 999px;
    background: var(--state-info-bg);
}

.widget-tab {
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    color: var(--text-muted);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.widget-tab.is-active {
    color: var(--surface-card-bg);
    background: var(--state-info-text);
    box-shadow: 0 8px 18px rgba(var(--state-info-text-rgb), 0.22);
}

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

.widget-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.20);
    border-radius: 12px;
    background: var(--surface-card-bg);
}

.widget-row-main {
    min-width: 0;
}

.widget-row-title {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-row-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.widget-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--state-info-text);
    background: var(--state-info-bg);
}

@media (max-width: 1200px) {
    .dashboard-widget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-widget-span-3,
    .dashboard-widget-span-4 {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .dashboard-widget-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-widget-span-1,
    .dashboard-widget-span-2,
    .dashboard-widget-span-3,
    .dashboard-widget-span-4 {
        grid-column: span 1;
    }

    .widget-head {
        flex-direction: column;
    }

    .widget-head-actions,
    .widget-tabs {
        width: 100%;
    }

    .widget-tab {
        flex: 1;
    }
}

/* Support the sidebar hide/show toggle from navigation.php. */
.app-main,
.main-content,
.page-content,
.dashboard-content {
    transition: margin-left 190ms ease, width 190ms ease;
}

body.app-nav-hidden .app-main,
body.app-nav-hidden .main-content,
body.app-nav-hidden .page-content,
body.app-nav-hidden .dashboard-content {
    margin-left: 0 !important;
    width: 100%;
}


/* Stronger fallback for nav hidden fullscreen layout. */
html.app-nav-hidden .app-main,
html.app-nav-hidden .main-content,
html.app-nav-hidden .page-content,
html.app-nav-hidden .dashboard-content,
html.app-nav-hidden .app-sidebar + *,
body.app-nav-hidden .app-main,
body.app-nav-hidden .main-content,
body.app-nav-hidden .page-content,
body.app-nav-hidden .dashboard-content,
body.app-nav-hidden .app-sidebar + * {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Admin platform refinements */
.user-admin-help-flow {
    display: grid;
    gap: 12px;
    margin: 14px 0;
}

.user-admin-help-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(var(--border-strong-rgb), 0.22);
    border-radius: 14px;
    background: rgba(var(--surface-card-subtle-rgb), 0.82);
}

.user-admin-help-step strong:first-child {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--surface-card-bg);
    background: var(--state-info-text);
    font-size: 13px;
}

.user-admin-help-step h3,
.user-admin-help-step p {
    margin: 0;
}

.user-admin-help-step h3 {
    font-size: 14px;
    color: var(--text-primary);
}

.user-admin-help-step p {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.site-config-status-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--state-info-text-rgb), 0.18);
    border-radius: 14px;
    color: var(--state-info-text);
    background: rgba(var(--state-info-bg-rgb), 0.82);
    font-size: 13px;
    line-height: 1.45;
}

.site-config-checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.site-config-mini-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid rgba(var(--border-strong-rgb), 0.2);
    border-radius: 12px;
    background: rgba(var(--surface-card-subtle-rgb), 0.76);
    font-size: 13px;
}

.site-config-mini-check input {
    margin-top: 2px;
}

.site-config-mini-check code {
    margin-left: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

@media (max-width: 780px) {
    .site-config-checkbox-list {
        grid-template-columns: 1fr;
    }
}

.user-admin-help-flow article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(var(--border-strong-rgb), 0.22);
    border-radius: 14px;
    background: rgba(var(--surface-card-subtle-rgb), 0.82);
}

.user-admin-help-flow article > span:first-child {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--surface-card-bg);
    background: var(--state-info-text);
    font-size: 13px;
    font-weight: 850;
}

.user-admin-help-flow article h3,
.user-admin-help-flow article p {
    margin: 0;
}

.user-admin-help-flow article h3 {
    font-size: 14px;
    color: var(--text-primary);
}

.user-admin-help-flow article p {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

/* ==========================================================
   Theme-token app overrides
   Core colours come from head.php variables generated from DB/theme tokens.
   ========================================================== */
html,
body,
.app-main,
.main-content,
.page-content,
.dashboard-content {
    font-family: var(--font-family-base, "Montserrat", Arial, sans-serif);
    color: var(--text-primary);
}

body:not(.auth-body),
.app-main,
.main-content,
.page-content,
.dashboard-content {
    background: var(--page-bg);
}

h1, h2, h3, h4, h5, h6,
.app-page-header h1,
.dashboard-hero h1,
.dashboard-v2-hero h1,
.page-title {
    font-family: var(--font-family-heading, var(--font-family-base, "Montserrat", Arial, sans-serif));
    color: var(--page-title-color);
}

.app-page-header p,
.dashboard-hero p:not(.app-breadcrumb),
.dashboard-v2-hero p:not(.app-breadcrumb),
.page-subtitle {
    color: var(--page-subtitle-color);
}

.app-breadcrumb,
.breadcrumb,
.breadcrumb a {
    color: var(--breadcrumb-color);
}

.app-card,
.dashboard-card,
.widget-card,
.core-card,
.admin-card,
.app-panel,
.news-card,
.quick-link-card {
    background: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: var(--card-shadow, var(--shadow-card, 0 14px 32px rgba(var(--text-primary-rgb), 0.08)));
}

.app-card h2,
.app-card h3,
.dashboard-card h2,
.dashboard-card h3,
.widget-card h2,
.widget-card h3,
.core-card h2,
.core-card h3,
.card-title,
.widget-title {
    color: var(--card-title-color);
}

.card-subtitle,
.widget-subtitle,
.app-card small,
.dashboard-card small,
.widget-card small {
    color: var(--card-subtitle-color);
}

.app-button,
.btn-primary,
.button-primary,
.app-btn-primary,
button[type="submit"]:not(.nav-status-badge):not(.nav-role-badge):not(.nav-user-button) {
    color: var(--button-primary-text);
    background: var(--button-primary-bg);
    border-color: var(--button-primary-bg);
}

.app-button:hover,
.btn-primary:hover,
.button-primary:hover,
.app-btn-primary:hover,
button[type="submit"]:not(.nav-status-badge):not(.nav-role-badge):not(.nav-user-button):hover {
    background: var(--button-primary-hover-bg);
    border-color: var(--button-primary-hover-bg);
}

.btn-secondary,
.button-secondary,
.app-btn-secondary,
.app-button-secondary {
    color: var(--button-secondary-text);
    background: var(--button-secondary-bg);
    border-color: var(--button-secondary-border);
}

.btn-secondary:hover,
.button-secondary:hover,
.app-btn-secondary:hover,
.app-button-secondary:hover {
    background: var(--button-secondary-hover-bg);
}

label,
.form-label,
.app-form label span {
    color: var(--form-label-color);
    font-weight: var(--form-label-weight, 600);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea,
.form-control,
.app-input {
    color: var(--form-input-text);
    background: var(--form-input-bg);
    border-color: var(--form-input-border);
    font-family: var(--font-family-base, "Montserrat", Arial, sans-serif);
}

input::placeholder,
textarea::placeholder {
    color: var(--form-input-placeholder);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.app-input:focus {
    border-color: var(--form-input-focus-border);
    box-shadow: var(--form-input-focus-shadow, 0 0 0 3px rgba(var(--brand-primary-rgb), 0.16));
}

.help-text,
.form-help,
.form-hint {
    color: var(--form-help-text);
}

.help-block,
.form-error,
.error-text {
    color: var(--form-error-text);
}

.app-modal-panel,
.modal-content,
.dialog-panel,
.nav-modal-panel {
    background: var(--modal-bg);
    border-color: var(--modal-border);
    box-shadow: var(--modal-shadow, 0 24px 70px rgba(var(--text-primary-rgb), 0.22));
}

.app-modal-backdrop,
.modal-backdrop,
.nav-modal-backdrop {
    background: var(--modal-backdrop);
}

.app-modal-panel h2,
.modal-content h2,
.dialog-panel h2,
.nav-modal-panel h2 {
    color: var(--modal-title-color);
}

.app-modal-panel p,
.modal-content p,
.dialog-panel p,
.nav-modal-panel p {
    color: var(--modal-text-color);
}

.app-modal-close,
.modal-close,
.nav-modal-close {
    color: var(--modal-close-color);
    background: var(--modal-close-bg);
}

.app-modal-close:hover,
.modal-close:hover,
.nav-modal-close:hover {
    background: var(--modal-close-hover-bg);
}

.app-table thead th,
table thead th {
    background: var(--surface-table-header-bg);
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.app-alert-info,
.alert-info {
    background: var(--state-info-bg);
    color: var(--state-info-text);
    border-color: var(--state-info-border);
}

.app-alert-success,
.alert-success {
    background: var(--state-success-bg);
    color: var(--state-success-text);
    border-color: var(--state-success-border);
}

.app-alert-warning,
.alert-warning {
    background: var(--state-warning-bg);
    color: var(--state-warning-text);
    border-color: var(--state-warning-border);
}

.app-alert-error,
.alert-error,
.alert-danger {
    background: var(--state-error-bg);
    color: var(--state-error-text);
    border-color: var(--state-error-border);
}

/* ==========================================================
   EXLABESA CORE - ADMIN NOTIFICATION SENDER
   ========================================================== */
.notifications-admin-page {
    display: grid;
    gap: 18px;
}

.notifications-admin-card {
    display: grid;
    gap: 16px;
}

.notifications-admin-form,
.notifications-admin-grid {
    display: grid;
    gap: 16px;
}

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

.notifications-admin-wide {
    grid-column: 1 / -1;
}

.notifications-admin-form label,
.notifications-target-panel label {
    display: grid;
    gap: 7px;
    color: var(--form-label-color, var(--text-primary));
    font-size: var(--font-size-sm, 12px);
    font-weight: var(--form-label-weight, var(--font-weight-semibold, 600));
}

.notifications-admin-form input,
.notifications-admin-form select,
.notifications-admin-form textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--form-input-border, var(--border-default));
    border-radius: var(--radius-sm, 6px);
    color: var(--form-input-text, var(--text-primary));
    background: var(--form-input-bg, var(--surface-card-bg));
    font: inherit;
}

.notifications-admin-form textarea {
    padding-top: 10px;
    resize: vertical;
}

.notifications-admin-form select[multiple] {
    min-height: 180px;
    padding: 8px;
}

.notifications-admin-form input:focus,
.notifications-admin-form select:focus,
.notifications-admin-form textarea:focus {
    outline: none;
    border-color: var(--form-input-focus-border, var(--border-focus));
    box-shadow: var(--form-input-focus-shadow, 0 0 0 3px rgba(var(--brand-primary-rgb), .16));
}

.notifications-target-panel {
    margin: 0;
    padding: 16px;
    display: grid;
    gap: 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md, 10px);
    background: var(--surface-card-subtle, var(--surface-card-bg));
}

.notifications-target-panel legend {
    padding: 0 8px;
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold, 600);
}

.notifications-target-option {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}

.notifications-target-option input {
    width: auto;
    min-height: auto;
}

.notifications-target-block {
    margin-top: 4px;
}

.notifications-admin-actions {
    display: flex;
    justify-content: flex-end;
}

.notifications-admin-page .app-table td strong,
.notifications-admin-page .app-table td small {
    display: block;
}

.notifications-admin-page .app-table td small {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: var(--font-size-xs, 11px);
}

@media (max-width: 760px) {
    .notifications-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================================================
   Shared form controls
   ----------------------------------------------------------------------
   Common input styling promoted from module-level forms so every Core
   module receives the same field sizing, borders and focus treatment.
   ====================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="week"],
input[type="datetime-local"],
select,
textarea,
.form-control,
.app-input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 12px;
    color: var(--form-input-text, var(--text-primary, #141414));
    background: var(--form-input-bg, #ffffff);
    border: 1px solid var(--form-input-border, rgba(129, 133, 141, 0.35));
    border-radius: 9px;
    font-family: var(--font-family-base, "Montserrat", Arial, sans-serif);
    font-size: 14px;
    line-height: 1.35;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

textarea,
textarea.form-control,
textarea.app-input {
    min-height: 104px;
    resize: vertical;
}

select {
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: var(--form-input-placeholder, #8a94a5);
    opacity: 1;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus,
.form-control:focus,
.app-input:focus {
    outline: none;
    border-color: var(--form-input-focus-border, #2563eb);
    box-shadow: var(--form-input-focus-shadow, 0 0 0 4px rgba(37, 99, 235, 0.10));
}

input:disabled,
select:disabled,
textarea:disabled,
.form-control:disabled,
.app-input:disabled,
input[readonly],
textarea[readonly] {
    color: var(--text-muted, #64748b);
    background: var(--surface-muted, #f4f6f8);
    cursor: not-allowed;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.form-control.is-invalid,
.app-input.is-invalid {
    border-color: var(--form-error-text, #dc2626);
}
