:root {
    --positivo-navy: #283760;
    --positivo-navy-dark: #17243f;
    --positivo-accent: #2f80ed;
    --positivo-bg: #fbfcfe;

    /* Studio colours */
    --positivo-purple: #7350c4;
    --positivo-teal: #2e7d88;

    /* Shell (header / footer / home) */
    --p-shell-text: #26304f;
    --p-shell-muted: #5c6580;
    --p-shell-nav: #4a5370;
    --p-shell-border: #dde2ef;
    --p-shell-divider: #eef0f6;
    --p-shell-pill: #e8ebf4;
    --p-shell-chip: #f2f4f9;

    --p-table-head-bg: #fafbfd;
    --p-table-border: #eef0f6;
    --p-table-head-border: #eef0f6;
    --p-table-hover: #f8f9fc;
    --p-table-group-bg: #fbfcfe;

    --p-text: #26304f;
    --p-heading: #26304f;
    --p-muted: #5c6580;
    --p-faint: #7a839e;
    --p-disabled: #9aa3bc;

    --p-card-border: #dde2ef;
    --p-card-shadow: 0 4px 14px rgba(38, 48, 79, 0.05);

    /* Status colours */
    --p-green: #2f8a63;
    --p-green-bg: #e4f4ec;
    --p-amber: #b26b12;
    --p-amber-bg: #fdf2e1;
    --p-red: #c2453d;
    --p-red-bg: #fcebea;
    --p-grey-bg: #f2f4f8;
}

/* Ensure full height for sticky footer */
html, body {
    height: 100%;
    margin: 0;
    font-family: "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.wrapper {
    background-color: var(--positivo-bg);
}

.content {
    flex: 1;
}

/* Navbar (login / MFA pages) */
.navbar.bg-dark {
    background-color: var(--positivo-navy) !important;
}

.navbar-logo {
    height: 32px;
    width: auto;
    display: block;
}

/* ============================================================
   App header (header.html, eheader.html, seheader.html)
   ============================================================ */

.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--p-shell-divider);
    padding: 0;
    min-height: 64px;
}

.app-header .app-header-inner {
    max-width: 1280px;
    padding: 0 32px;
}

.app-header .app-logo {
    height: 30px;
    width: auto;
    display: block;
}

.app-header .navbar-brand {
    padding: 0;
    margin-right: 12px;
}

.app-header .navbar-toggler {
    border-color: var(--p-shell-border);
    padding: 4px 8px;
}

.app-header .navbar-toggler:focus {
    box-shadow: none;
}

.app-header .app-nav {
    gap: 2px;
}

.app-header .app-nav .nav-link {
    height: 36px;
    padding: 0 14px !important;
    border-radius: 10px;
    color: var(--p-shell-nav);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.app-header .app-nav .nav-link:hover {
    color: var(--positivo-teal);
}

.app-header .app-nav .nav-link.active {
    background: var(--p-shell-pill);
    color: var(--positivo-navy);
    font-weight: 600;
}

.app-header .app-header-right {
    gap: 12px;
}

.studios-button {
    height: 36px;
    padding: 0 14px 0 10px;
    border: 1px solid var(--p-shell-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--positivo-navy);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.studios-button:hover,
.studios-button:focus,
.studios-button.show {
    background: var(--p-shell-chip);
    color: var(--positivo-navy);
    border-color: var(--p-shell-border);
}

.studios-button::after,
.account-chip::after {
    display: none;
}

.studio-swatches {
    display: flex;
    gap: 2px;
}

.studio-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.studio-swatch.sms,
.studio-menu-icon.sms { background: var(--positivo-purple); }
.studio-swatch.mobileweb,
.studio-menu-icon.mobileweb { background: var(--positivo-teal); }
.studio-swatch.journey,
.studio-menu-icon.journey { background: var(--positivo-navy); }

.studio-menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.app-header .dropdown-menu {
    border: 1px solid var(--p-shell-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(38, 48, 79, 0.12);
    padding: 6px;
    font-size: 14px;
}

.app-header .dropdown-item {
    border-radius: 8px;
    color: var(--p-shell-text);
    padding: 8px 10px;
    display: flex;
    align-items: center;
}

.app-header .dropdown-item i {
    margin-right: 8px;
}

.account-chip {
    height: 40px;
    padding: 0 8px 0 4px;
    border: 0;
    border-radius: 999px;
    background: var(--p-shell-chip);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--p-shell-nav);
}

.account-chip:hover,
.account-chip:focus,
.account-chip.show {
    background: var(--p-shell-pill);
    color: var(--p-shell-nav);
}

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--positivo-teal);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}

.account-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--p-shell-text);
}

.account-sub {
    font-size: 11px;
    color: var(--p-shell-muted);
}

.account-chip .bi-gear {
    font-size: 17px;
    margin: 0 4px;
}

@media (max-width: 991.98px) {
    .app-header .app-header-inner {
        padding: 10px 16px;
    }

    .app-header .navbar-collapse {
        padding: 8px 0 4px;
    }

    .app-header .navbar-brand {
        margin-right: auto;
    }

    .app-header .app-header-right {
        margin-top: 8px;
        flex-wrap: wrap;
    }
}

/* Login card */
.login-container {
    max-width: 420px;
    margin: 110px auto 48px;
    padding: 32px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--p-card-border);
    box-shadow: 0 12px 32px rgba(38, 48, 79, 0.08);
    color: var(--p-text);
}

/* (The login page's header isn't fixed, so it needs less space above the card) */
.app-header + .content .login-container {
    margin-top: 72px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--p-heading);
    margin: 0;
}

.login-subtitle {
    font-size: 13.5px;
    color: var(--p-muted);
    margin: 4px 0 24px;
}

.login-container .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text);
    margin-bottom: 6px;
}

.login-container .form-control {
    height: 44px;
    border: 1px solid var(--p-card-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--p-text);
}

.login-container .form-control:focus {
    border-color: var(--positivo-teal);
    box-shadow: 0 0 0 3px rgba(46, 125, 136, 0.15);
}

.login-container .btn-primary {
    height: 44px;
    font-size: 14px;
}

.login-container .alert {
    border: 0;
    border-radius: 10px;
    font-size: 13.5px;
    padding: 10px 14px;
}

.login-container .alert-danger {
    background: var(--p-red-bg);
    color: #a83a33;
}

.login-container .alert-success {
    background: var(--p-green-bg);
    color: var(--p-green);
}

/* MFA pages (same card) */
.login-container p,
.login-container li {
    font-size: 14px;
    color: var(--p-shell-nav);
}

.login-container a:not(.btn),
.login-container .btn-link {
    color: var(--positivo-navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.login-container a:not(.btn):hover,
.login-container .btn-link:hover {
    color: var(--positivo-teal);
}

.login-container .btn-secondary,
.login-container .btn-outline-secondary {
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: var(--p-shell-chip);
    color: var(--positivo-navy);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-container .btn-secondary:hover,
.login-container .btn-outline-secondary:hover {
    background: var(--p-shell-pill);
    color: var(--positivo-navy);
}

.login-container details {
    border-top: 1px solid var(--p-shell-divider);
    padding-top: 16px;
}

.login-container summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--positivo-navy);
    cursor: pointer;
}

.login-container summary:hover {
    color: var(--positivo-teal);
}

.login-container code {
    color: var(--positivo-navy);
    background: var(--p-shell-chip);
    border-radius: 6px;
    padding: 2px 6px;
}

.login-container ol.font-monospace {
    background: var(--p-table-head-bg);
    border: 1px solid var(--p-card-border);
    border-radius: 10px;
    padding: 12px 12px 12px 40px;
}

/* Primary button */
.btn-primary {
    background-color: var(--positivo-navy) !important;
    border-color: var(--positivo-navy) !important;
    font-weight: 700;
    border-radius: 10px;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--positivo-navy-dark) !important;
    border-color: var(--positivo-navy-dark) !important;
}

/* Page-header action buttons (e.g. "+ New Journey") */
.btn-page-action {
    height: 40px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-page-action.btn-outline-danger {
    border-radius: 10px;
    font-weight: 700;
    --bs-btn-bg: #ffffff;
}

/* Footer */
.footer {
    background-color: var(--positivo-navy);
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    font-size: 12px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
}

/* ============================================================
   Page layout / modern list pages
   ============================================================ */

/* (Same width as the app header) */
.page-shell {
    max-width: 1280px;
    padding: 32px 32px 48px;
    color: var(--p-text);
}

.page-header {
    margin-top: 0;
    margin-bottom: 20px;
    gap: 16px;
}

.page-tabs + .page-header {
    margin-top: 24px;
}

.page-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #3d7682;
    margin-bottom: 4px;
}

.page-title {
    color: var(--p-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-subtitle {
    color: var(--p-muted);
    font-size: 13.5px;
    margin: 4px 0 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-card {
    background: #ffffff;
    border: 1px solid var(--p-card-border);
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: var(--p-card-shadow);
}

.table-card {
    background: #ffffff;
    border: 1px solid var(--p-card-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--p-card-shadow);
}

@media (max-width: 700px) {
    .page-shell {
        padding: 24px 16px 40px;
    }
}

/* ============================================================
   Tabs
   ============================================================ */

.nav-tabs {
    margin-top: 1rem;
    border-bottom-color: #dbe4f0;
}

.nav-tabs .nav-link {
    color: #52627a;
    font-weight: 600;
}

.nav-tabs .nav-link.active {
    color: var(--positivo-navy);
    font-weight: 700;
}

.page-tabs {
    margin-top: 0;
    border-bottom: 1px solid var(--p-card-border);
    gap: 4px;
}

.page-tabs .nav-link {
    border: none !important;
    background: transparent !important;
    color: var(--p-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    position: relative;
}

.page-tabs .nav-link:hover {
    color: var(--positivo-teal);
}

.page-tabs .nav-link.active {
    color: var(--positivo-navy);
    background: transparent !important;
    font-weight: 700;
}

.page-tabs .nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--positivo-navy);
}

/* ============================================================
   Tables
   ============================================================ */

.no-borders,
.no-borders td,
.no-borders th {
    border: none !important;
}

.no-row-lines tr {
    border-bottom: none !important;
}

.p-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    --bs-table-color: var(--p-text);
    --bs-table-hover-color: var(--p-text);
    --bs-table-hover-bg: var(--p-table-hover);
}

.p-table thead th {
    background: var(--p-table-head-bg);
    border-bottom: 1px solid var(--p-table-head-border) !important;
    color: var(--p-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

.p-table td,
.p-table th {
    border-color: var(--p-table-border) !important;
    padding-left: 12px;
    padding-right: 12px;
}

.p-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.p-table th:first-child,
.p-table td:first-child {
    padding-left: 20px;
}

.p-table th:last-child,
.p-table td:last-child {
    padding-right: 20px;
}

.p-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Primary link in a row (e.g. the item name) */
.p-table a.text-primary,
.p-table a.p-row-link {
    color: var(--positivo-navy) !important;
    font-weight: 600;
    text-decoration: none;
}

.p-table a.text-primary:hover,
.p-table a.p-row-link:hover {
    color: var(--positivo-teal) !important;
}

/* Name cell with an icon tile and an optional second line */
.p-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.p-name-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--p-shell-pill);
    color: var(--positivo-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.p-name-icon.disabled {
    background: var(--p-grey-bg);
    color: var(--p-disabled);
}

.p-name-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.p-name-sub {
    font-size: 12px;
    color: var(--p-faint);
}

.p-table .text-faint {
    color: var(--p-disabled);
}

.p-table .col-desc {
    color: var(--p-shell-nav);
}

/* Status badges */
.p-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px 0 8px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--p-grey-bg);
    color: var(--p-faint);
}

.p-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a6aec4;
}

.p-status.running { background: var(--p-green-bg); color: var(--p-green); }
.p-status.running::before { background: var(--p-green); }
.p-status.paused { background: var(--p-amber-bg); color: var(--p-amber); }
.p-status.paused::before { background: var(--p-amber); }

/* Small icon button next to a status (pause / resume) */
.p-icon-button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--p-shell-nav);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.p-icon-button:hover {
    background: var(--p-shell-chip);
    color: var(--positivo-navy);
}

.p-table tbody tr:hover {
    background: var(--p-table-hover);
}

.p-table .col-icon {
    width: 46px;
    text-align: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.p-table .col-num,
.p-table .col-date,
.p-table .col-time {
    text-align: right;
    white-space: nowrap;
    width: 1%;
    font-variant-numeric: tabular-nums;
    min-width: 4.5rem;
}

.p-table .col-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.p-table .col-wrap {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 420px;
}

.p-table .group-row td {
    background: var(--p-table-group-bg);
    font-weight: 600;
}

.p-table .sub-name {
    padding-left: 1.25rem !important;
    color: var(--p-muted);
}

/* ============================================================
   Action pills
   ============================================================ */

.action-pill,
.p-table .action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.action-primary,
.p-table .action-primary {
    background: var(--p-shell-chip);
    color: var(--positivo-navy);
}

.action-primary:hover,
.p-table .action-primary:hover {
    background: var(--p-shell-pill);
    color: var(--positivo-navy);
}

.action-danger,
.p-table .action-danger {
    background: var(--p-red-bg);
    color: var(--p-red);
}

.action-danger:hover,
.p-table .action-danger:hover {
    background: #f8dcda;
    color: #a83a33;
}

.action-disabled,
.p-table .action-disabled {
    background: var(--p-grey-bg);
    color: var(--p-disabled);
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================================
   Bootstrap card tuning
   ============================================================ */

.card {
    border: 1px solid #e6ecf5;
    border-radius: 14px;
}

.card-footer {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

/* ============================================================
   Backwards compatibility: campaign-table
   ============================================================ */

.campaign-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    --bs-table-color: var(--p-text);
    --bs-table-hover-color: var(--p-text);
    --bs-table-hover-bg: var(--p-table-hover);
}

.campaign-table thead th {
    background: var(--p-table-head-bg);
    border-bottom: 1px solid var(--p-table-head-border) !important;
    color: var(--p-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

.campaign-table td,
.campaign-table th {
    border-color: var(--p-table-border) !important;
    padding-left: 12px;
    padding-right: 12px;
}

.campaign-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.campaign-table th:first-child,
.campaign-table td:first-child {
    padding-left: 20px;
}

.campaign-table th:last-child,
.campaign-table td:last-child {
    padding-right: 20px;
}

.campaign-table a.text-primary {
    color: var(--positivo-navy) !important;
    font-weight: 600;
}

.campaign-table a.text-primary:hover {
    color: var(--positivo-teal) !important;
}

.campaign-table tbody tr:hover {
    background: var(--p-table-hover);
}

.campaign-table .col-icon {
    width: 46px;
    text-align: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.campaign-table .col-num,
.campaign-table .col-date,
.campaign-table .col-time {
    text-align: right;
    white-space: nowrap;
    width: 1%;
    font-variant-numeric: tabular-nums;
    min-width: 4.5rem;
}

.campaign-table .col-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.campaign-table .campaign-row td {
    background: var(--p-table-group-bg);
    font-weight: 600;
}

.campaign-table .action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
}

.campaign-table .action-send {
    background: var(--p-shell-chip);
    color: var(--positivo-navy);
}

.campaign-table .action-send:hover {
    background: var(--p-shell-pill);
}

.campaign-table .action-delete {
    background: var(--p-red-bg);
    color: var(--p-red);
}

.campaign-table .sub-name {
    padding-left: 1.25rem !important;
    color: var(--p-muted);
}
