/**
 * MailPRO — Design System
 * Tema: azul petróleo (#0f4c5c) + coral accent (#e36414)
 */

/* ============================================================
   CSS Variables — Light / Dark
   ============================================================ */

:root,
[data-bs-theme="light"] {
    --mp-primary: #0f4c5c;
    --mp-primary-dark: #0a3642;
    --mp-primary-light: #1a6b7d;
    --mp-accent: #e36414;
    --mp-accent-hover: #c9560f;
    --mp-accent-soft: rgba(227, 100, 20, 0.12);

    --mp-admin-bg: #0b132b;
    --mp-admin-accent: #5bc0be;
    --mp-admin-accent-soft: rgba(91, 192, 190, 0.15);

    --mp-body-bg: #f4f7f9;
    --mp-body-bg-gradient: linear-gradient(160deg, #eef4f6 0%, #f8fafb 40%, #f0f4f8 100%);
    --mp-surface: #ffffff;
    --mp-surface-raised: #ffffff;
    --mp-surface-hover: #f0f5f7;
    --mp-border: rgba(15, 76, 92, 0.12);
    --mp-border-strong: rgba(15, 76, 92, 0.22);

    --mp-text: #1a2b32;
    --mp-text-muted: #5a7179;
    --mp-text-inverse: #ffffff;

    --mp-sidebar-width: 260px;
    --mp-sidebar-collapsed: 72px;
    --mp-topbar-height: 64px;
    --mp-radius: 12px;
    --mp-radius-sm: 8px;
    --mp-radius-lg: 16px;
    --mp-shadow: 0 1px 3px rgba(15, 76, 92, 0.08), 0 4px 16px rgba(15, 76, 92, 0.06);
    --mp-shadow-lg: 0 8px 32px rgba(15, 76, 92, 0.12);

    --mp-font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
    --mp-font-display: "Fraunces", Georgia, serif;

    --mp-success: #2a9d8f;
    --mp-danger: #d62828;
    --mp-warning: #f4a261;
    --mp-info: #457b9d;

    --mp-transition: 0.2s ease;
}

[data-bs-theme="dark"] {
    --mp-body-bg: #0d1419;
    --mp-body-bg-gradient: linear-gradient(160deg, #0a1014 0%, #111a20 50%, #0d1419 100%);
    --mp-surface: #151e24;
    --mp-surface-raised: #1a252d;
    --mp-surface-hover: #1f2d36;
    --mp-border: rgba(255, 255, 255, 0.08);
    --mp-border-strong: rgba(255, 255, 255, 0.15);
    --mp-text: #e8eef1;
    --mp-text-muted: #8fa3ad;
    --mp-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
    --mp-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --mp-accent-soft: rgba(227, 100, 20, 0.2);
}

/* ============================================================
   Base
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--mp-font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--mp-text);
    background: var(--mp-body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--mp-font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--mp-text);
}

.text-accent {
    color: var(--mp-accent) !important;
}

.text-primary-brand {
    color: var(--mp-primary) !important;
}

a {
    color: var(--mp-primary-light);
    text-decoration: none;
    transition: color var(--mp-transition);
}

a:hover {
    color: var(--mp-accent);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    font-weight: 500;
    border-radius: var(--mp-radius-sm);
    transition: all var(--mp-transition);
}

.btn-primary {
    --bs-btn-bg: var(--mp-primary);
    --bs-btn-border-color: var(--mp-primary);
    --bs-btn-hover-bg: var(--mp-primary-dark);
    --bs-btn-hover-border-color: var(--mp-primary-dark);
    --bs-btn-active-bg: var(--mp-primary-dark);
    --bs-btn-active-border-color: var(--mp-primary-dark);
    --bs-btn-focus-shadow-rgb: 15, 76, 92;
}

.btn-accent,
.btn-accent:hover,
.btn-accent:focus {
    background: var(--mp-accent);
    border-color: var(--mp-accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--mp-accent-hover);
    border-color: var(--mp-accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 100, 20, 0.35);
}

.btn-outline-primary {
    --bs-btn-color: var(--mp-primary);
    --bs-btn-border-color: var(--mp-primary);
    --bs-btn-hover-bg: var(--mp-primary);
    --bs-btn-hover-border-color: var(--mp-primary);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--mp-text-muted);
    border-radius: var(--mp-radius-sm);
    transition: all var(--mp-transition);
}

.btn-icon:hover {
    background: var(--mp-surface-hover);
    color: var(--mp-text);
}

/* ============================================================
   Forms
   ============================================================ */

.form-control,
.form-select {
    border-radius: var(--mp-radius-sm);
    border-color: var(--mp-border-strong);
    background: var(--mp-surface);
    color: var(--mp-text);
    padding: 0.625rem 0.875rem;
    transition: border-color var(--mp-transition), box-shadow var(--mp-transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mp-primary-light);
    box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.15);
    background: var(--mp-surface);
    color: var(--mp-text);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--mp-text);
    margin-bottom: 0.375rem;
}

.form-text {
    color: var(--mp-text-muted);
    font-size: 0.8125rem;
}

.input-group-text {
    background: var(--mp-surface-hover);
    border-color: var(--mp-border-strong);
    color: var(--mp-text-muted);
}

.form-check-input:checked {
    background-color: var(--mp-primary);
    border-color: var(--mp-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.15);
}

.invalid-feedback {
    font-size: 0.8125rem;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow);
    transition: box-shadow var(--mp-transition);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mp-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--mp-border);
    padding: 1rem 1.25rem;
}

.card-hover:hover {
    box-shadow: var(--mp-shadow-lg);
    transform: translateY(-2px);
    transition: all var(--mp-transition);
}

.stat-card {
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 1.25rem;
    box-shadow: var(--mp-shadow);
}

.stat-card__label {
    font-size: 0.8125rem;
    color: var(--mp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-card__value {
    font-family: var(--mp-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mp-text);
    line-height: 1.2;
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--mp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--mp-accent-soft);
    color: var(--mp-accent);
}

.stat-card__icon--primary {
    background: rgba(15, 76, 92, 0.1);
    color: var(--mp-primary);
}

/* ============================================================
   Tables
   ============================================================ */

.table-responsive {
    border-radius: var(--mp-radius);
    border: 1px solid var(--mp-border);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    color: var(--mp-text);
    --bs-table-bg: var(--mp-surface);
    --bs-table-hover-bg: var(--mp-surface-hover);
    --bs-table-border-color: var(--mp-border);
}

.table thead th {
    background: var(--mp-surface-hover);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mp-text-muted);
    border-bottom: 1px solid var(--mp-border);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--mp-border);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

/* ============================================================
   Badges & Alerts
   ============================================================ */

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.badge-status-active { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.badge-status-pending { background: rgba(244, 162, 97, 0.15); color: #c97b2e; }
.badge-status-suspended { background: rgba(214, 40, 40, 0.15); color: #d62828; }
.badge-status-draft { background: rgba(90, 113, 121, 0.15); color: var(--mp-text-muted); }

.alert {
    border-radius: var(--mp-radius-sm);
    border: none;
    font-size: 0.875rem;
}

/* ============================================================
   Pagination
   ============================================================ */

.mailpro-pagination .page-link {
    border-color: var(--mp-border);
    color: var(--mp-text);
    background: var(--mp-surface);
    border-radius: var(--mp-radius-sm);
    margin: 0 2px;
    min-width: 36px;
    text-align: center;
}

.mailpro-pagination .page-item.active .page-link {
    background: var(--mp-primary);
    border-color: var(--mp-primary);
    color: #fff;
}

.mailpro-pagination .page-link:hover {
    background: var(--mp-surface-hover);
    color: var(--mp-primary);
}

/* ============================================================
   Page Header (App)
   ============================================================ */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header__title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.page-header__subtitle {
    color: var(--mp-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ============================================================
   Editor Full Height
   ============================================================ */

.editor-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--mp-topbar-height) - 3rem);
    min-height: 500px;
    margin: -0.5rem -0.25rem 0;
}

.editor-page__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius) var(--mp-radius) 0 0;
    flex-shrink: 0;
}

.editor-page__body {
    flex: 1;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--mp-border);
    border-top: none;
    border-radius: 0 0 var(--mp-radius) var(--mp-radius);
    background: var(--mp-surface);
}

.editor-page__sidebar {
    width: 280px;
    border-right: 1px solid var(--mp-border);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 1rem;
}

.editor-page__canvas {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
    background: var(--mp-body-bg);
}

.editor-page__preview {
    flex: 1;
    overflow: auto;
    background: #fff;
}

/* ============================================================
   Impersonation Bar
   ============================================================ */

.impersonation-bar {
    background: linear-gradient(90deg, #f4a261, #e9c46a);
    color: #1a2b32;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   Guest Layout
   ============================================================ */

.layout-guest {
    min-height: 100vh;
    background: var(--mp-body-bg-gradient);
    position: relative;
    overflow-x: hidden;
}

.guest-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.guest-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.guest-bg__orb--1 {
    width: 500px;
    height: 500px;
    background: rgba(15, 76, 92, 0.25);
    top: -150px;
    right: -100px;
}

.guest-bg__orb--2 {
    width: 400px;
    height: 400px;
    background: rgba(227, 100, 20, 0.15);
    bottom: -100px;
    left: -100px;
}

.guest-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 76, 92, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 76, 92, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

.guest-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.guest-header {
    padding: 1.5rem 1rem;
    text-align: center;
}

.guest-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mp-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mp-text);
    text-decoration: none;
}

.guest-brand__icon {
    width: 40px;
    height: 40px;
    background: var(--mp-primary);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.guest-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.guest-card {
    width: 100%;
    max-width: 440px;
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius-lg);
    box-shadow: var(--mp-shadow-lg);
    overflow: hidden;
}

.guest-card__header {
    padding: 2rem 2rem 0;
    text-align: center;
}

.guest-card__title {
    font-size: 1.375rem;
    margin: 0;
}

.guest-card__body {
    padding: 2rem;
}

.guest-footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--mp-text-muted);
    font-size: 0.8125rem;
}

.guest-footer p {
    margin: 0;
}

/* ============================================================
   Error Pages
   ============================================================ */

.error-page {
    text-align: center;
    padding: 2rem 0;
}

.error-page__code {
    font-family: var(--mp-font-display);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--mp-primary);
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.error-page__code--warning { color: var(--mp-warning); }
.error-page__code--danger { color: var(--mp-danger); }

.error-page__title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.error-page__message {
    color: var(--mp-text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ============================================================
   Public / Landing Layout
   ============================================================ */

.layout-public {
    background: var(--mp-body-bg);
}

.public-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--mp-border);
    padding: 0.75rem 0;
    transition: background var(--mp-transition);
}

[data-bs-theme="dark"] .public-nav {
    background: rgba(13, 20, 25, 0.9);
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mp-font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--mp-text) !important;
    text-decoration: none;
}

.public-brand__icon {
    width: 36px;
    height: 36px;
    background: var(--mp-primary);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.public-nav-link {
    font-weight: 500;
    color: var(--mp-text-muted) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--mp-radius-sm);
    transition: all var(--mp-transition);
}

.public-nav-link:hover,
.public-nav-link.active {
    color: var(--mp-primary) !important;
    background: rgba(15, 76, 92, 0.06);
}

.public-main {
    padding-top: 76px;
}

.public-footer {
    background: var(--mp-surface);
    border-top: 1px solid var(--mp-border);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.public-footer__title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mp-text-muted);
    margin-bottom: 1rem;
}

.public-footer__links a {
    display: block;
    color: var(--mp-text-muted);
    padding: 0.25rem 0;
    font-size: 0.875rem;
    transition: color var(--mp-transition);
}

.public-footer__links a:hover {
    color: var(--mp-accent);
}

/* Landing Hero */
.landing-hero {
    position: relative;
    padding: 5rem 0 6rem;
    overflow: hidden;
}

.landing-hero__atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.landing-hero__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(15, 76, 92, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(227, 100, 20, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 60% 80%, rgba(26, 107, 125, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, rgba(244, 247, 249, 0) 0%, var(--mp-body-bg) 100%);
}

.landing-hero__mesh {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(15, 76, 92, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(227, 100, 20, 0.03) 0%, transparent 50%);
}

.landing-hero__content {
    position: relative;
    z-index: 1;
}

.landing-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: var(--mp-accent-soft);
    color: var(--mp-accent);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.landing-hero__title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.15;
    margin-bottom: 1.25rem;
    max-width: 720px;
}

.landing-hero__subtitle {
    font-size: 1.125rem;
    color: var(--mp-text-muted);
    max-width: 540px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.landing-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.landing-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.landing-hero__stat-value {
    font-family: var(--mp-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mp-primary);
}

.landing-hero__stat-label {
    font-size: 0.8125rem;
    color: var(--mp-text-muted);
}

.landing-section {
    padding: 4rem 0;
}

.landing-section__title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.landing-section__subtitle {
    text-align: center;
    color: var(--mp-text-muted);
    max-width: 560px;
    margin: 0 auto 3rem;
}

.feature-card {
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 1.75rem;
    height: 100%;
    transition: all var(--mp-transition);
}

.feature-card:hover {
    border-color: var(--mp-primary-light);
    box-shadow: var(--mp-shadow-lg);
    transform: translateY(-4px);
}

.feature-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--mp-radius-sm);
    background: rgba(15, 76, 92, 0.1);
    color: var(--mp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
}

.feature-card__title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-card__text {
    color: var(--mp-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.pricing-card {
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius-lg);
    padding: 2rem;
    height: 100%;
    position: relative;
    transition: all var(--mp-transition);
}

.pricing-card--featured {
    border-color: var(--mp-accent);
    box-shadow: 0 8px 32px rgba(227, 100, 20, 0.15);
    transform: scale(1.02);
}

.pricing-card__badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mp-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.875rem;
    border-radius: 999px;
}

.pricing-card__price {
    font-family: var(--mp-font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--mp-text);
}

.pricing-card__period {
    color: var(--mp-text-muted);
    font-size: 0.875rem;
}

/* ============================================================
   App Layout — Sidebar & Topbar
   ============================================================ */

.layout-app {
    background: var(--mp-body-bg-gradient);
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--mp-sidebar-width);
    background: var(--mp-surface);
    border-right: 1px solid var(--mp-border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--mp-transition), transform var(--mp-transition);
    overflow: hidden;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: var(--mp-sidebar-collapsed);
}

.app-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--mp-border);
    min-height: var(--mp-topbar-height);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--mp-font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mp-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.app-brand__icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--mp-primary);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-shell.sidebar-collapsed .app-brand__text {
    opacity: 0;
    width: 0;
}

.app-sidebar__close {
    background: none;
    border: none;
    color: var(--mp-text-muted);
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
}

.app-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.5rem;
}

.app-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-menu__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--mp-radius-sm);
    color: var(--mp-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--mp-transition);
    white-space: nowrap;
    margin-bottom: 2px;
}

.app-menu__link:hover {
    background: var(--mp-surface-hover);
    color: var(--mp-text);
}

.app-menu__link.active {
    background: rgba(15, 76, 92, 0.1);
    color: var(--mp-primary);
}

.app-menu__link.active .app-menu__icon {
    color: var(--mp-accent);
}

.app-menu__icon {
    font-size: 1.125rem;
    min-width: 1.25rem;
    text-align: center;
}

.app-shell.sidebar-collapsed .app-menu__label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.app-shell.sidebar-collapsed .app-menu__link {
    justify-content: center;
    padding: 0.625rem;
}

.app-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid var(--mp-border);
}

.app-sidebar__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: none;
    border: none;
    border-radius: var(--mp-radius-sm);
    color: var(--mp-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--mp-transition);
}

.app-sidebar__toggle:hover {
    background: var(--mp-surface-hover);
    color: var(--mp-text);
}

.app-shell.sidebar-collapsed .app-sidebar__toggle .app-menu__label {
    display: none;
}

.app-shell.sidebar-collapsed .app-sidebar__toggle {
    justify-content: center;
}

.app-main {
    flex: 1;
    margin-left: var(--mp-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--mp-transition);
}

.app-shell.sidebar-collapsed .app-main {
    margin-left: var(--mp-sidebar-collapsed);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    height: var(--mp-topbar-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--mp-border);
}

[data-bs-theme="dark"] .app-topbar {
    background: rgba(21, 30, 36, 0.9);
}

.app-topbar__left,
.app-topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-topbar__tenant-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mp-text-muted);
    line-height: 1;
}

.app-topbar__tenant-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--mp-text);
}

.app-topbar__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--mp-accent);
    border-radius: 50%;
    font-size: 0;
}

.app-user-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    background: var(--mp-surface-hover);
    border: 1px solid var(--mp-border);
    border-radius: 999px;
    color: var(--mp-text);
    transition: all var(--mp-transition);
}

.app-user-btn:hover {
    border-color: var(--mp-border-strong);
    background: var(--mp-surface);
}

.app-user-btn__avatar,
.app-user-btn__initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.app-user-btn__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mp-primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

.app-user-btn__info {
    text-align: left;
    line-height: 1.2;
}

.app-user-btn__name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
}

.app-user-btn__email {
    display: block;
    font-size: 0.6875rem;
    color: var(--mp-text-muted);
}

.app-dropdown {
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
    background: var(--mp-surface);
}

.app-dropdown--notifications {
    min-width: 320px;
}

.app-dropdown .dropdown-item {
    border-radius: var(--mp-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.app-dropdown .dropdown-item:hover {
    background: var(--mp-surface-hover);
}

.app-content {
    flex: 1;
    padding: 1.5rem;
}

.app-content__inner {
    max-width: 1400px;
    margin: 0 auto;
}

.app-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

.app-sidebar-backdrop.show {
    display: block;
}

/* ============================================================
   Admin Layout
   ============================================================ */

.layout-admin {
    background: #0d1117;
    min-height: 100vh;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--mp-sidebar-width);
    background: var(--mp-admin-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--mp-transition), transform var(--mp-transition);
    overflow: hidden;
}

.admin-shell.sidebar-collapsed .admin-sidebar {
    width: var(--mp-sidebar-collapsed);
}

.admin-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: var(--mp-topbar-height);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.admin-brand__icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--mp-admin-accent);
    color: var(--mp-admin-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.admin-brand__title {
    display: block;
    font-family: var(--mp-font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.admin-brand__subtitle {
    display: block;
    font-size: 0.6875rem;
    color: var(--mp-admin-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-shell.sidebar-collapsed .admin-brand__text {
    opacity: 0;
    width: 0;
}

.admin-sidebar__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
}

.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.admin-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-menu__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--mp-radius-sm);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--mp-transition);
    white-space: nowrap;
    margin-bottom: 2px;
}

.admin-menu__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-menu__link.active {
    background: var(--mp-admin-accent-soft);
    color: var(--mp-admin-accent);
}

.admin-menu__icon {
    font-size: 1.125rem;
    min-width: 1.25rem;
    text-align: center;
}

.admin-shell.sidebar-collapsed .admin-menu__label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.admin-shell.sidebar-collapsed .admin-menu__link {
    justify-content: center;
    padding: 0.625rem;
}

.admin-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-sidebar__back {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
    text-decoration: none;
    border-radius: var(--mp-radius-sm);
    transition: all var(--mp-transition);
    white-space: nowrap;
}

.admin-sidebar__back:hover {
    color: var(--mp-admin-accent);
    background: rgba(255, 255, 255, 0.04);
}

.admin-shell.sidebar-collapsed .admin-sidebar__back span {
    display: none;
}

.admin-sidebar__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: none;
    border: none;
    border-radius: var(--mp-radius-sm);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--mp-transition);
}

.admin-sidebar__toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-shell.sidebar-collapsed .admin-sidebar__toggle .admin-menu__label {
    display: none;
}

.admin-shell.sidebar-collapsed .admin-sidebar__toggle {
    justify-content: center;
}

.admin-main {
    flex: 1;
    margin-left: var(--mp-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--mp-transition);
}

.admin-shell.sidebar-collapsed .admin-main {
    margin-left: var(--mp-sidebar-collapsed);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    height: var(--mp-topbar-height);
    background: rgba(11, 19, 43, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-topbar__left,
.admin-topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-topbar__title {
    font-size: 1.125rem;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.admin-topbar__subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.admin-btn-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.admin-btn-icon:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

.admin-user-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #fff;
    font-size: 0.875rem;
}

.admin-user-btn__initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mp-admin-accent);
    color: var(--mp-admin-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
}

.admin-dropdown {
    background: #151e35;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--mp-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
    min-width: 200px;
}

.admin-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--mp-radius-sm);
    font-size: 0.875rem;
}

.admin-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-dropdown .dropdown-header {
    color: #fff;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
}

.admin-content__inner {
    max-width: 1400px;
    margin: 0 auto;
}

.layout-admin .card {
    background: #151e35;
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.layout-admin .card-header {
    border-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.layout-admin .table {
    --bs-table-bg: #151e35;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.layout-admin .table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.5);
}

.layout-admin .form-control,
.layout-admin .form-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.layout-admin .form-control:focus,
.layout-admin .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--mp-admin-accent);
    box-shadow: 0 0 0 3px var(--mp-admin-accent-soft);
    color: #fff;
}

.layout-admin .page-header__subtitle {
    color: rgba(255, 255, 255, 0.5);
}

.layout-admin h1,
.layout-admin h2,
.layout-admin h3,
.layout-admin .page-header__title {
    color: #fff;
}

/* ============================================================
   Toast Overrides
   ============================================================ */

.toast {
    border-radius: var(--mp-radius-sm);
    border: 1px solid var(--mp-border);
    box-shadow: var(--mp-shadow-lg);
}

.toast-header {
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================================
   Utilities
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--mp-text-muted);
}

.empty-state__icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state__title {
    font-size: 1.125rem;
    color: var(--mp-text);
    margin-bottom: 0.5rem;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 991.98px) {
    .app-sidebar,
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show,
    .admin-sidebar.show {
        transform: translateX(0);
    }

    .app-main,
    .admin-main {
        margin-left: 0 !important;
    }

    .app-shell.sidebar-collapsed .app-main,
    .admin-shell.sidebar-collapsed .admin-main {
        margin-left: 0 !important;
    }

    .app-content,
    .admin-content {
        padding: 1rem;
    }

    .editor-page {
        height: calc(100vh - var(--mp-topbar-height) - 2rem);
    }

    .editor-page__sidebar {
        display: none;
    }

    .landing-hero {
        padding: 3rem 0 4rem;
    }

    .pricing-card--featured {
        transform: none;
    }
}

@media (max-width: 575.98px) {
    .guest-card__body {
        padding: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .landing-hero__actions {
        flex-direction: column;
    }

    .landing-hero__actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
