/* ============================================================
   Maintenance Tracker - Custom Styles
   Industrial professional design with dark mode support
   ============================================================ */

:root {
    --mt-primary: #0d6efd;
    --mt-primary-dark: #0a58ca;
    --mt-bg: #f4f6fb;
    --mt-surface: #ffffff;
    --mt-border: #e3e8f0;
    --mt-text: #1e293b;
    --mt-text-muted: #64748b;
    --mt-sidebar-bg: #0f1b2d;
    --mt-sidebar-text: #94a3b8;
    --mt-sidebar-active: #0d6efd;
    --mt-radius: 0.75rem;
    --mt-shadow: 0 1px 3px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.05);
    --mt-transition: all 0.2s ease-in-out;
}

/* Dark mode palette */
[data-bs-theme="dark"] {
    --mt-bg: #0f1420;
    --mt-surface: #171e2e;
    --mt-border: #2a3446;
    --mt-text: #e2e8f0;
    --mt-text-muted: #94a3b8;
    --mt-sidebar-bg: #0b101a;
    --mt-sidebar-text: #64748b;
    --mt-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, 0.4) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.4); border-radius: 4px; }

body {
    background-color: var(--mt-bg);
    color: var(--mt-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.925rem;
    transition: background-color 0.3s ease;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.mt-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--mt-sidebar-bg);
    color: var(--mt-sidebar-text);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.mt-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.35rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mt-sidebar-logo-wide {
    height: 88px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}

.mt-sidebar-nav { padding: 1rem 0.75rem; flex: 1; }

.mt-nav-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(148, 163, 184, 0.6);
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.mt-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.85rem;
    margin: 0.15rem 0;
    border-radius: 0.6rem;
    color: var(--mt-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--mt-transition);
}

.mt-nav-item i { font-size: 1.05rem; width: 1.25rem; text-align: center; }

.mt-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.mt-nav-item.active {
    background: var(--mt-sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.mt-sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.5);
}

/* ============ MAIN CONTENT ============ */
.mt-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.mt-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--mt-surface);
    border-bottom: 1px solid var(--mt-border);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--mt-transition);
}

.mt-content { padding: 1.5rem; flex: 1; }

.mt-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.mt-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--mt-text);
}

.mt-page-subtitle { color: var(--mt-text-muted); font-size: 0.85rem; margin: 0; }

/* ============ CARDS ============ */
.card {
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow);
    transition: var(--mt-transition);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mt-border);
    font-weight: 600;
    padding: 0.9rem 1.25rem;
}

.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow);
    padding: 1.25rem;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(13, 110, 253, 0.12); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.85rem;
}

.stat-icon.primary { background: rgba(13, 110, 253, 0.12); color: var(--mt-primary); }
.stat-icon.success { background: rgba(25, 135, 84, 0.12); color: #198754; }
.stat-icon.warning { background: rgba(255, 193, 7, 0.15); color: #b8860b; }
.stat-icon.danger { background: rgba(220, 53, 69, 0.12); color: #dc3545; }
.stat-icon.info { background: rgba(13, 202, 240, 0.12); color: #0dcaf0; }
.stat-icon.secondary { background: rgba(108, 117, 125, 0.12); color: #6c757d; }

.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: var(--mt-text); }
.stat-label { color: var(--mt-text-muted); font-size: 0.82rem; font-weight: 500; margin-top: 0.25rem; }

/* ============ TABLES ============ */
.table {
    --bs-table-color: var(--mt-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--mt-border);
    --bs-table-hover-bg: rgba(13, 110, 253, 0.04);
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mt-text-muted);
    font-weight: 700;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table tbody td { vertical-align: middle; font-size: 0.9rem; }

/* DataTables */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--mt-border) !important;
    border-radius: 0.5rem !important;
    padding: 0.375rem 0.75rem !important;
    background: var(--mt-surface) !important;
    color: var(--mt-text) !important;
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--mt-text-muted) !important;
    font-size: 0.85rem;
}

.dataTables_wrapper .page-link {
    background: var(--mt-surface);
    border-color: var(--mt-border);
    color: var(--mt-text);
}

.dataTables_wrapper .page-item.active .page-link { background: var(--mt-primary); border-color: var(--mt-primary); color: #fff; }

/* ============ FORMS ============ */
.form-label { font-weight: 600; font-size: 0.85rem; color: var(--mt-text); margin-bottom: 0.4rem; }
.form-control, .form-select {
    border-color: var(--mt-border);
    background-color: var(--mt-surface);
    color: var(--mt-text);
    border-radius: 0.6rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--mt-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    background-color: var(--mt-surface);
    color: var(--mt-text);
}

.form-control::placeholder { color: var(--mt-text-muted); opacity: 0.7; }

.form-check-input:checked { background-color: var(--mt-primary); border-color: var(--mt-primary); }

/* Select2 overrides */
.select2-container--bootstrap-5 .select2-selection {
    border-color: var(--mt-border) !important;
    border-radius: 0.6rem !important;
    background: var(--mt-surface) !important;
    min-height: 42px;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--mt-text) !important;
    line-height: 42px;
}
.select2-container .select2-selection--single .select2-selection__rendered { padding-left: 0.85rem; }
.select2-dropdown { border-radius: 0.6rem; border-color: var(--mt-border); }

/* Flatpickr */
.flatpickr-calendar { border-radius: 0.75rem; box-shadow: var(--mt-shadow); }

/* ============ BADGES ============ */
.badge { font-weight: 600; padding: 0.4em 0.7em; border-radius: 0.5rem; font-size: 0.75rem; }

/* ============ BUTTONS ============ */
.btn { border-radius: 0.6rem; font-weight: 600; font-size: 0.875rem; padding: 0.5rem 1rem; }
.btn-primary { box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3); }
.btn-icon { padding: 0.4rem 0.6rem; line-height: 1; }

/* ============ NOTIFICATIONS PAGE (PWA mobile-first) ============ */
.mt-notif-page {
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 6rem; /* room for the mobile action bar */
}

.mt-notif-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.mt-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--mt-border);
    border-radius: 999px;
    background: var(--mt-surface);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mt-text-muted);
    white-space: nowrap;
    box-shadow: var(--mt-shadow);
}

.mt-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #198754;
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.5);
    animation: mtPulse 2s infinite;
}

@keyframes mtPulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

/* Filter tabs */
.mt-notif-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--mt-surface);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius);
    padding: 0.3rem;
    box-shadow: var(--mt-shadow);
}

.mt-notif-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: var(--mt-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--mt-transition);
    -webkit-tap-highlight-color: transparent;
}

.mt-notif-tab:hover { color: var(--mt-text); }

.mt-notif-tab.active {
    background: var(--mt-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.35);
}

.mt-notif-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.2rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.12);
    color: var(--mt-primary);
    font-size: 0.68rem;
    font-weight: 700;
}

.mt-notif-tab.active .mt-notif-tab-count { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* List rows */
.mt-notif-card .card-body { padding: 0; }

.mt-notif-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--mt-border);
    transition: background 0.15s ease;
    position: relative;
}

.mt-notif-row:last-child { border-bottom: 0; }

.mt-notif-row.unread { background: rgba(13, 110, 253, 0.055); }

.mt-notif-row.unread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--mt-primary);
}

.mt-notif-main {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.mt-notif-main:active { opacity: 0.75; }

.mt-notif-ic {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin: 0;
}

.mt-notif-body { min-width: 0; flex: 1; }

.mt-notif-msg {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--mt-text);
}

.mt-notif-row.unread .mt-notif-msg { font-weight: 700; }

.mt-notif-time {
    display: block;
    color: var(--mt-text-muted);
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.mt-notif-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--mt-primary);
    flex-shrink: 0;
    margin-top: 0.4rem;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.mt-notif-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.mt-notif-actions .btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
}

/* Enter animation for live-prepended rows */
.mt-notif-enter {
    animation: mtNotifIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mtNotifIn {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: none; }
}

/* Mobile bottom action bar (PWA) */
.mt-notif-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--mt-surface);
    border-top: 1px solid var(--mt-border);
    box-shadow: 0 -6px 24px rgba(15, 27, 45, 0.08);
}

.mt-notif-action-bar .btn { min-height: 44px; border-radius: 12px; }

/* Desktop: page header actions tucked under the list */
#notifHeaderActions { max-width: 820px; margin: 0 auto; }

/* ============ NOTIFICATIONS DROPDOWN ============ */
.mt-notif-dropdown { width: 380px; max-width: calc(100vw - 2rem); border-radius: 0.75rem; border: 1px solid var(--mt-border); box-shadow: var(--mt-shadow); }
.mt-notif-item { display: flex; gap: 0.75rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--mt-border); text-decoration: none; color: var(--mt-text); transition: background 0.15s ease; }
.mt-notif-item:hover { background: rgba(13, 110, 253, 0.06); }
.mt-notif-item.unread { background: rgba(13, 110, 253, 0.08); border-left: 3px solid var(--mt-primary); }

/* ============ SEARCH RESULTS ============ */
.mt-search-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mt-text-muted);
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
}

/* ============ FILTER PANEL ============ */
.mt-filter-panel { border: 1px solid var(--mt-border); border-radius: var(--mt-radius); background: var(--mt-surface); padding: 1.1rem; margin-bottom: 1.25rem; box-shadow: var(--mt-shadow); }

/* ============ AVATARS ============ */
.mt-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--mt-primary), #6610f2);
    color: #fff; font-weight: 700; font-size: 0.85rem;
}

/* ============ AUTH PAGES ============ */
.mt-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #0f1b2d 0%, #16283f 50%, #0d6efd 130%);
    position: relative;
    overflow: hidden;
}

.mt-auth-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(13, 110, 253, 0.25), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(102, 16, 242, 0.2), transparent 45%);
    pointer-events: none;
}

.mt-auth-card {
    width: 100%;
    max-width: 430px;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 2.25rem;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .mt-auth-card { background: #171e2e; border-color: #2a3446; }

.mt-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.mt-auth-logo {
    height: 120px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(13, 110, 253, 0.18));
}

/* ============ TIMELINE / ACTIVITY ============ */
.mt-timeline { position: relative; padding-left: 1.75rem; }
.mt-timeline::before { content: ""; position: absolute; left: 0.5rem; top: 0.25rem; bottom: 0.25rem; width: 2px; background: var(--mt-border); }
.mt-timeline-item { position: relative; padding-bottom: 1.25rem; }
.mt-timeline-item::before {
    content: ""; position: absolute; left: -1.62rem; top: 0.3rem;
    width: 0.7rem; height: 0.7rem; border-radius: 50%;
    background: var(--mt-primary);
    border: 2px solid var(--mt-surface);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.3);
}

/* ============ MISC ============ */
.text-muted-2 { color: var(--mt-text-muted); }
.bg-surface { background: var(--mt-surface); }
.border-soft { border-color: var(--mt-border) !important; }

.mt-empty-state { text-align: center; padding: 3rem 1rem; color: var(--mt-text-muted); }
.mt-empty-state i { font-size: 3rem; opacity: 0.4; display: block; margin-bottom: 1rem; }

.mt-detail-row { display: flex; padding: 0.6rem 0; border-bottom: 1px dashed var(--mt-border); font-size: 0.9rem; }
.mt-detail-row:last-child { border-bottom: 0; }
.mt-detail-label { width: 45%; color: var(--mt-text-muted); font-weight: 600; flex-shrink: 0; }
.mt-detail-value { flex: 1; }

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--mt-border);
    border-radius: 0.6rem;
    background: var(--mt-bg);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--mt-text);
    transition: var(--mt-transition);
}
.attachment-chip:hover { border-color: var(--mt-primary); color: var(--mt-primary); }

/* Print styles */
@media print {
    .mt-sidebar, .mt-topbar, .no-print { display: none !important; }
    .mt-main { margin-left: 0 !important; }
    .mt-content { padding: 0 !important; }
    body { background: #fff !important; }
    .card { border: 0 !important; box-shadow: none !important; }
}

/* Responsive */
@media (max-width: 991.98px) {
    .mt-sidebar { transform: translateX(-100%); }
    .mt-sidebar.show { transform: translateX(0); }
    .mt-main { margin-left: 0; }
    .mt-sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
        z-index: 1035; opacity: 0; visibility: hidden; transition: var(--mt-transition);
    }
    .mt-sidebar-backdrop.show { opacity: 1; visibility: visible; }
    .mt-content { padding: 1rem; }
}


/* ============================================================
   LANDING PAGE — industrial technical theme (dark-first)
   ============================================================ */
.mt-landing {
    background: #0b101a;
    color: #e2e8f0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

/* ---------- shared bits ---------- */
.mt-landing .mono {
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
.mt-landing a { color: inherit; }

.mt-landing .l-btn {
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.7rem 1.4rem; border-radius: 0.55rem;
    font-weight: 700; font-size: 0.95rem; text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.mt-landing .l-btn:active { transform: translateY(1px) scale(0.985); }
.mt-landing .l-btn-primary {
    background: #0d6efd; color: #fff;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.4), 0 6px 20px rgba(13, 110, 253, 0.28);
}
.mt-landing .l-btn-primary:hover { background: #2d7ffd; box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.55), 0 8px 26px rgba(13, 110, 253, 0.38); }
.mt-landing .l-btn-ghost {
    background: transparent; color: #cbd5e1;
    border: 1px solid #2a3446;
}
.mt-landing .l-btn-ghost:hover { border-color: #64748b; color: #fff; }

.mt-landing .l-chip {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.28rem 0.75rem; border-radius: 999px;
    border: 1px solid #2a3446; background: rgba(255, 255, 255, 0.03);
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; color: #94a3b8;
    white-space: nowrap;
}
.mt-landing .l-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ---------- nav ---------- */
.mt-landing .l-nav {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(11, 16, 26, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mt-landing .l-nav-inner {
    max-width: 1180px; margin: 0 auto; padding: 0.7rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.mt-landing .l-brand { display: flex; align-items: center; text-decoration: none; }
.mt-landing .l-brand-logo {
    height: 74px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.mt-landing .l-brand:hover .l-brand-logo { opacity: 0.88; transform: translateY(-1px); }
.mt-landing .l-brand-logo-sm { height: 58px; }
.mt-landing .l-nav-links { display: flex; align-items: center; gap: 1.75rem; }
.mt-landing .l-nav-links a { text-decoration: none; color: #94a3b8; font-size: 0.88rem; font-weight: 500; transition: color 0.15s ease; }
.mt-landing .l-nav-links a:hover { color: #fff; }

/* ---------- hero ---------- */
.mt-landing .l-hero {
    position: relative; overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mt-landing .l-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 55% 65% at 78% 18%, rgba(13, 110, 253, 0.22), transparent 60%),
        radial-gradient(ellipse 45% 55% at 8% 85%, rgba(102, 16, 242, 0.12), transparent 60%);
}
.mt-landing .l-hero-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, black 0%, transparent 90%);
    -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 90%);
}
.mt-landing .l-hero-inner {
    position: relative; max-width: 1180px; margin: 0 auto;
    padding: 5.5rem 1.5rem 5rem;
    display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 4rem; align-items: center;
}
.mt-landing .l-hero-tag {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: #7fb2ff; border: 1px solid rgba(13, 110, 253, 0.4);
    background: rgba(13, 110, 253, 0.1); border-radius: 999px; padding: 0.35rem 0.85rem;
}
.mt-landing .l-hero h1 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(2.1rem, 4.2vw, 3.35rem);
    font-weight: 700; letter-spacing: -0.025em; line-height: 1.06;
    color: #fff; margin: 1.25rem 0 1.1rem;
}
.mt-landing .l-hero h1 .accent { color: #4d94ff; }
.mt-landing .l-hero p.lead { color: #94a3b8; font-size: 1.02rem; line-height: 1.65; max-width: 52ch; margin-bottom: 1.9rem; }
.mt-landing .l-hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.mt-landing .l-hero-specs {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.4rem;
    padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- hero product preview ---------- */
.mt-landing .l-preview { position: relative; }
.mt-landing .l-preview-frame {
    position: relative; z-index: 1;
    border: 1px solid #2a3446; border-radius: 1rem;
    background: #111827;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.mt-landing .l-preview-bar {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #2a3446;
    background: rgba(255, 255, 255, 0.02);
}
.mt-landing .l-preview-bar .traffic { display: flex; gap: 0.32rem; }
.mt-landing .l-preview-bar .traffic i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.mt-landing .l-preview-bar .url {
    margin-left: auto; display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.68rem; color: #64748b;
    border: 1px solid #2a3446; border-radius: 999px; padding: 0.22rem 0.75rem;
}
.mt-landing .l-preview-body { padding: 1.1rem; }
.mt-landing .l-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.mt-landing .l-preview-head .t { font-size: 0.8rem; font-weight: 700; color: #e2e8f0; }
.mt-landing .l-preview-head .mono { font-size: 0.65rem; color: #64748b; }
.mt-landing .l-preview-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.9rem; }
.mt-landing .l-pc {
    border: 1px solid #2a3446; border-radius: 0.7rem; padding: 0.75rem;
    background: #151d2d;
}
.mt-landing .l-pc .k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: #64748b; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.mt-landing .l-pc .v { font-size: 1.45rem; font-weight: 800; color: #f1f5f9; font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }
.mt-landing .l-pc .v small { font-size: 0.68rem; color: #64748b; font-weight: 600; }
.mt-landing .l-preview-chart { border: 1px solid #2a3446; border-radius: 0.7rem; padding: 0.8rem 0.9rem; background: #151d2d; }
.mt-landing .l-preview-chart .c-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.mt-landing .l-preview-chart .c-head .t { font-size: 0.68rem; color: #94a3b8; font-weight: 600; }
.mt-landing .l-preview-chart .c-head .mono { font-size: 0.62rem; color: #0d6efd; }
.mt-landing .l-bars { display: flex; align-items: flex-end; gap: 6px; height: 52px; }
.mt-landing .l-bars i {
    flex: 1; border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #0d6efd 0%, rgba(13, 110, 253, 0.28) 100%);
    opacity: 0.85;
}
.mt-landing .l-preview-status { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.mt-landing .l-preview-glow {
    position: absolute; inset: 8% -6% -10% -6%; z-index: 0;
    background: radial-gradient(ellipse 60% 55% at 50% 40%, rgba(13, 110, 253, 0.22), transparent 70%);
    filter: blur(8px);
}

/* ---------- module strip ---------- */
.mt-landing .l-strip { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.mt-landing .l-strip-inner {
    max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.5rem;
    display: grid; grid-template-columns: repeat(4, 1fr);
}
.mt-landing .l-strip-item {
    display: flex; align-items: center; justify-content: center; gap: 0.55rem;
    padding: 0.35rem 0.75rem; text-align: center;
    color: #94a3b8; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
}
.mt-landing .l-strip-item + .l-strip-item { border-left: 1px solid rgba(255, 255, 255, 0.07); }
.mt-landing .l-strip-item i { color: #0d6efd; font-size: 0.9rem; }

/* ---------- sections ---------- */
.mt-landing .l-section { max-width: 1180px; margin: 0 auto; padding: 5.5rem 1.5rem; }
.mt-landing .l-sec-head { max-width: 640px; margin-bottom: 3rem; }
.mt-landing .l-sec-head .l-tag {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: #4d94ff; margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.5rem;
}
.mt-landing .l-sec-head .l-tag::before { content: ""; width: 22px; height: 1px; background: #0d6efd; }
.mt-landing .l-sec-head h2 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700;
    letter-spacing: -0.02em; color: #fff; line-height: 1.12; margin: 0 0 0.85rem;
}
.mt-landing .l-sec-head p { color: #94a3b8; font-size: 0.97rem; line-height: 1.65; margin: 0; }

/* ---------- bento ---------- */
.mt-landing .l-bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.9rem; }
.mt-landing .l-bento-cell {
    border: 1px solid #2a3446; border-radius: 1rem;
    background: #111827; padding: 1.6rem 1.5rem;
    display: flex; flex-direction: column;
    transition: border-color 0.18s ease, transform 0.18s ease;
    position: relative; overflow: hidden;
}
.mt-landing .l-bento-cell:hover { border-color: rgba(13, 110, 253, 0.5); transform: translateY(-3px); }
.mt-landing .l-bento-cell.span7 { grid-column: span 7; }
.mt-landing .l-bento-cell.span5 { grid-column: span 5; }
.mt-landing .l-bento-cell.span4 { grid-column: span 4; }
.mt-landing .l-bento-cell.span12 { grid-column: span 12; flex-direction: row; align-items: center; gap: 2rem; }
.mt-landing .l-bento-cell .cell-ic {
    width: 46px; height: 46px; border-radius: 0.8rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(13, 110, 253, 0.12); color: #4d94ff; font-size: 1.25rem;
    border: 1px solid rgba(13, 110, 253, 0.28);
    margin-bottom: 1.1rem;
}
.mt-landing .l-bento-cell h3 { font-size: 1.02rem; font-weight: 700; color: #f1f5f9; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.mt-landing .l-bento-cell p { font-size: 0.86rem; line-height: 1.6; color: #94a3b8; margin: 0; }
.mt-landing .l-bento-cell .mono-line {
    margin-top: auto; padding-top: 1rem;
    font-size: 0.66rem; color: #64748b; letter-spacing: 0.08em; text-transform: uppercase;
}
.mt-landing .l-bento-cell.cell-pattern::after {
    content: ""; position: absolute; inset: auto -30% -45% auto; width: 70%; height: 70%;
    background:
        linear-gradient(rgba(13, 110, 253, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 110, 253, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    pointer-events: none;
}
.mt-landing .l-bento-cell.cell-featured { background: linear-gradient(180deg, #0f1830 0%, #111827 60%); }
.mt-landing .l-flow {
    margin-top: 1.3rem; display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.mt-landing .l-flow-step {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.74rem; font-weight: 600; color: #cbd5e1;
    border: 1px solid #2a3446; border-radius: 0.55rem;
    padding: 0.4rem 0.7rem; background: rgba(255, 255, 255, 0.02);
}
.mt-landing .l-flow-step i { color: #4d94ff; font-size: 0.8rem; }
.mt-landing .l-flow-step .sep { color: #475569; margin: 0 0.2rem; }
.mt-landing .l-notif-list { margin-top: 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.mt-landing .l-notif {
    display: flex; align-items: center; gap: 0.7rem;
    border: 1px solid #2a3446; border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.02); padding: 0.55rem 0.8rem;
    font-size: 0.78rem; color: #cbd5e1;
}
.mt-landing .l-notif .mono { font-size: 0.62rem; color: #64748b; margin-left: auto; white-space: nowrap; }
.mt-landing .l-audit-flags { margin-left: auto; display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ---------- workflow (numbered timeline) ---------- */
.mt-landing .l-workflow { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2.5rem; }
.mt-landing .l-workflow::before {
    content: ""; position: absolute; top: 27px; left: 6%; right: 6%; height: 1px;
    background: linear-gradient(90deg, transparent, #2a3446 15%, #2a3446 85%, transparent);
}
.mt-landing .l-wstep { position: relative; padding-top: 3.4rem; }
.mt-landing .l-wstep .num {
    position: absolute; top: 0; left: 0;
    width: 54px; height: 54px; border-radius: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    background: #0f1830; border: 1px solid #2a3446;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1rem; font-weight: 700; color: #4d94ff;
    box-shadow: 0 0 0 6px #0b101a;
}
.mt-landing .l-wstep h3 { font-size: 1.02rem; font-weight: 700; color: #f1f5f9; margin: 0 0 0.55rem; }
.mt-landing .l-wstep p { font-size: 0.86rem; line-height: 1.6; color: #94a3b8; margin: 0; }
.mt-landing .l-wstep .mono { display: block; margin-top: 0.9rem; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: #475569; }

/* ---------- manifesto band ---------- */
.mt-landing .l-band {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #0d1424;
    position: relative; overflow: hidden;
}
.mt-landing .l-band::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, black, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, black, transparent 75%);
}
.mt-landing .l-band-inner {
    position: relative; max-width: 1180px; margin: 0 auto;
    padding: 4.5rem 1.5rem; text-align: center;
}
.mt-landing .l-band blockquote {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(1.35rem, 2.8vw, 2.1rem); font-weight: 600;
    letter-spacing: -0.02em; line-height: 1.25; color: #f1f5f9; margin: 0 0 1.1rem;
}
.mt-landing .l-band blockquote .accent { color: #4d94ff; }
.mt-landing .l-band p { color: #64748b; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }

/* ---------- CTA ---------- */
.mt-landing .l-cta-inner {
    max-width: 1180px; margin: 0 auto; padding: 5rem 1.5rem;
}
.mt-landing .l-cta-panel {
    border: 1px solid rgba(13, 110, 253, 0.45); border-radius: 1.25rem;
    background: linear-gradient(135deg, #0d1b3a 0%, #0f2448 55%, #12304f 100%);
    padding: 3.4rem 2.5rem; text-align: center; position: relative; overflow: hidden;
}
.mt-landing .l-cta-panel::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(77, 148, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 148, 255, 0.06) 1px, transparent 1px);
    background-size: 34px 34px;
}
.mt-landing .l-cta-panel > * { position: relative; }
.mt-landing .l-cta-panel h2 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700;
    letter-spacing: -0.02em; color: #fff; margin: 0 0 0.8rem;
}
.mt-landing .l-cta-panel p { color: #a8c4ee; font-size: 0.96rem; margin: 0 auto 2rem; max-width: 46ch; }
.mt-landing .l-cta-panel .l-btn-primary { font-size: 1.02rem; padding: 0.85rem 1.9rem; }
.mt-landing .l-cta-note { margin-top: 1rem; font-size: 0.72rem; color: #64748b; }

/* ---------- footer ---------- */
.mt-landing .l-footer { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.mt-landing .l-footer-inner {
    max-width: 1180px; margin: 0 auto; padding: 2.4rem 1.5rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.mt-landing .l-footer .brand { display: flex; align-items: center; gap: 0.85rem; }
.mt-landing .l-footer .brand .l-brand-logo-sm { opacity: 0.95; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3)); }
.mt-landing .l-footer .tag { color: #64748b; font-size: 0.78rem; }
.mt-landing .l-footer .copy { color: #475569; font-size: 0.76rem; }

/* ---------- reveal on scroll ---------- */
.mt-landing [data-reveal] {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.mt-landing [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .mt-landing [data-reveal] { opacity: 1; transform: none; transition: none; }
    .mt-landing .l-bento-cell { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .mt-landing .l-hero-inner { grid-template-columns: 1fr; gap: 3rem; padding: 4rem 1.5rem 4.5rem; }
    .mt-landing .l-preview { max-width: 560px; }
    .mt-landing .l-workflow { grid-template-columns: 1fr; gap: 2.2rem; }
    .mt-landing .l-workflow::before { display: none; }
    .mt-landing .l-wstep { padding-top: 0; padding-left: 4.4rem; }
    .mt-landing .l-wstep .num { left: 0; }
    .mt-landing .l-strip-inner { grid-template-columns: repeat(2, 1fr); row-gap: 0.6rem; }
    .mt-landing .l-strip-item:nth-child(3) { border-left: 0; }
}
@media (max-width: 767.98px) {
    .mt-landing .l-nav-links { display: none; }
    .mt-landing .l-section { padding: 4rem 1.25rem; }
    .mt-landing .l-bento { grid-template-columns: 1fr; }
    .mt-landing .l-bento-cell.span7, .mt-landing .l-bento-cell.span5,
    .mt-landing .l-bento-cell.span4, .mt-landing .l-bento-cell.span12 { grid-column: span 1; }
    .mt-landing .l-bento-cell.span12 { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .mt-landing .l-audit-flags { margin-left: 0; }
    .mt-landing .l-cta-panel { padding: 2.6rem 1.4rem; }
    .mt-landing .l-brand-logo { height: 58px; }
    .mt-landing .l-brand-logo-sm { height: 48px; }
    .mt-sidebar-logo-wide { height: 72px; }
    .mt-auth-logo { height: 96px; }
}

/* Notifications page — mobile PWA refinements */
@media (max-width: 575.98px) {
    .mt-notif-tabs {
        position: sticky;
        top: 60px; /* sits right below the sticky topbar */
        z-index: 1025;
        margin-inline: -0.5rem;
        box-shadow: var(--mt-shadow), 0 8px 20px rgba(15, 27, 45, 0.06);
    }
    .mt-notif-row { padding: 0.9rem 0.85rem; }
    .mt-notif-actions .btn { width: 42px; height: 42px; }
    .mt-notif-msg { font-size: 0.9rem; }
    .mt-notif-page { padding-bottom: 5.5rem; }
}

/* Tables — mobile card layout (PWA style) */
@media (max-width: 767.98px) {
    .mt-card-table { display: block; width: 100%; }
    .mt-card-table thead { display: none; }
    .mt-card-table tbody { display: block; }

    .mt-card-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.15rem 1rem;
        padding: 0.8rem 0.9rem 0.55rem;
        border-bottom: 1px solid var(--mt-border);
        background: var(--mt-surface);
    }

    .mt-card-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex: 1 1 100%;
        width: 100%;
        border: 0;
        padding: 0.25rem 0;
        background: transparent;
    }

    .mt-card-table td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--mt-text-muted);
    }

    /* Bulk-select checkbox floats top-left */
    .mt-card-table td:first-child:has(input[type="checkbox"]) {
        flex: 0 0 auto;
        width: auto;
        margin-right: auto;
        padding: 0 0 0.3rem;
    }

    /* Actions row: full-width, right-aligned, separated */
    .mt-card-table td:last-child {
        justify-content: flex-end;
        margin-top: 0.35rem;
        padding-top: 0.6rem;
        border-top: 1px dashed var(--mt-border);
    }
    .mt-card-table td:last-child::before { display: none; }

    .mt-card-table .text-truncate {
        white-space: normal;
        max-width: none !important;
        text-align: right;
    }

    .mt-card-table td .badge, .mt-card-table td .mt-avatar { flex-shrink: 0; }

    /* Empty-state row (colspan) stays centered */
    .mt-card-table td[colspan] {
        justify-content: center;
        border-top: 0;
        margin-top: 0;
        padding: 0.25rem 0;
    }
    .mt-card-table td[colspan]::before { display: none; }

    .mt-card-table .btn-group { gap: 0.4rem; flex-wrap: wrap; }
}

@media (display-mode: standalone) {
    .mt-topbar { padding-top: calc(0.6rem + env(safe-area-inset-top, 0px)); }
    .mt-notif-action-bar { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); }
}
