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

:root {
    --sidebar-width: 202px;
    --header-height: 64px;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
    --radius: 5px;
    --transition: 0.25s ease;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbars app-wide while preserving scroll behavior */
.app-layout,
.app-main,
.app-main__content,
.app-sidebar,
.app-sidebar__nav,
.page-card,
.data-table-wrap,
.dashboard-page,
.dashboard-page * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-layout::-webkit-scrollbar,
.app-main::-webkit-scrollbar,
.app-main__content::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar,
.app-sidebar__nav::-webkit-scrollbar,
.page-card::-webkit-scrollbar,
.data-table-wrap::-webkit-scrollbar,
.dashboard-page::-webkit-scrollbar,
.dashboard-page *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

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

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

/* Layout */
.app-layout {
    min-height: 100vh;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

.app-main__content {
    flex: 1;
    padding: calc(var(--header-height) + 12px) 12px 12px;
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 5px;
    border-bottom: 1px solid var(--color-border);
}

.app-sidebar__brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.app-sidebar__brand-logo {
    width: auto;
    height: 40px;
    max-width: 190px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.app-sidebar__brand-link i {
    font-size: 1.5rem;
}

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

.app-sidebar__close {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    color: var(--color-muted);
    background: transparent;
    cursor: pointer;
}

.app-sidebar__close i {
    font-size: 1.5rem;
    line-height: 1;
}

.app-sidebar__close:hover {
    background: var(--color-bg);
}

.app-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.app-sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--color-muted);
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.app-sidebar__link i {
    font-size: 1.25rem;
}

.app-sidebar__link:hover,
.app-sidebar__link.active {
    background: #eff6ff;
    color: var(--color-primary);
}

.app-sidebar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 999;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    transition: left var(--transition);
}

.app-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header__toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--color-text);
}

.app-header__toggle:hover {
    background: var(--color-bg);
}

.app-header__toggle i {
    font-size: 1.5rem;
}

.app-header__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.app-header__right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.app-header__search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 220px;
}

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

.app-header__search input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.9rem;
    color: var(--color-text);
}

.app-header__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header__user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-muted);
}

.app-header__menu {
    position: relative;
}

.app-header__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    border: none;
    transition: background var(--transition), box-shadow var(--transition);
}

.app-header__avatar:hover,
.app-header__menu.is-open .app-header__avatar {
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.app-header__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 8px;
    z-index: 1001;
}

.app-header__dropdown-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 6px;
}

.app-header__dropdown-meta strong {
    font-size: 0.9rem;
    color: var(--color-text);
}

.app-header__dropdown-meta span {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.app-header__dropdown-item,
.app-header__logout button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}

.app-header__dropdown-item i,
.app-header__logout button i {
    font-size: 1.15rem;
}

.app-header__dropdown-item:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.app-header__logout {
    margin: 0;
}

.app-header__logout button:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Footer */
.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Page content */
.page-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 12px;
}

.page-card__header {
    margin-bottom: 24px;
}

.page-card__header h2 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.page-card__header p {
    color: var(--color-muted);
    margin: 0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.stat-card__icon--blue { background: #3b82f6; }
.stat-card__icon--green { background: #22c55e; }
.stat-card__icon--orange { background: #f97316; }
.stat-card__icon--purple { background: #8b5cf6; }
.stat-card__icon--teal { background: #14b8a6; }
.stat-card__icon--cyan { background: #06b6d4; }
.stat-card__icon--success { background: #16a34a; }

.stat-card--virtual {
    border-color: #dbeafe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

a.stat-card--link {
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

a.stat-card--link:hover,
a.stat-card--link:focus-visible {
    border-color: #93c5fd;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    outline: none;
}

.stat-card__hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--color-muted);
}

.dashboard-page .dashboard-stats {
    margin-bottom: 8px;
}

.dashboard-group {
    margin-top: 20px;
}

.dashboard-group:first-of-type {
    margin-top: 0;
}

.dashboard-group__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 0 12px;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: var(--color-muted);
    transition: color var(--transition);
}

.dashboard-group__toggle:hover,
.dashboard-group__toggle:focus-visible {
    color: var(--color-primary);
    outline: none;
}

.dashboard-group__title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-group__icon {
    font-size: 1.1rem;
    transition: transform var(--transition);
}

.dashboard-group--collapsed .dashboard-group__icon {
    transform: rotate(180deg);
}

.dashboard-group--collapsed .dashboard-group__body {
    display: none;
}

.dashboard-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    margin: 20px 0 12px;
}

.dashboard-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 24px;
}

.dashboard-toolbar__intro {
    flex: 1 1 220px;
    min-width: 0;
}

.dashboard-toolbar__bu {
    color: var(--color-muted);
}

.dashboard-toolbar__actions {
    flex: 1 1 360px;
    min-width: 0;
    max-width: 100%;
}

.dashboard-filter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.dashboard-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.dashboard-preset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.dashboard-preset:hover {
    color: var(--color-primary);
    border-color: #bfdbfe;
    background: #eff6ff;
}

.dashboard-preset--active {
    color: var(--color-primary);
    border-color: #93c5fd;
    background: #eff6ff;
}

.dashboard-filter-form__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    justify-content: flex-end;
}

.dashboard-segment {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-bg);
}

.dashboard-segment__option {
    margin: 0;
    cursor: pointer;
}

.dashboard-segment__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dashboard-segment__option span {
    display: block;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-muted);
}

.dashboard-segment__option input:checked + span {
    background: var(--color-primary);
    color: #fff;
}

.dashboard-filter-form__dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-filter-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 140px;
}

.dashboard-filter-form__field--hidden {
    display: none;
}

.dashboard-filter-form__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dashboard-filter-form__input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.dashboard-filter-form__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.dashboard-filter-form__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dashboard-filter-form__errors {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: #dc2626;
    text-align: right;
}

.dashboard-chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-chart-card__header {
    padding: 16px 20px 0;
}

.dashboard-chart-card__header h3 {
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-chart-card__sub {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-muted);
}

.dashboard-chart-card__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 12px 20px 0;
}

.dashboard-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--color-muted);
}

.dashboard-legend-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.dashboard-chart-card__body {
    padding: 16px 20px 20px;
    position: relative;
    overflow: visible;
    max-height: none;
}

.dashboard-chart-card__body--split {
    min-height: 280px;
}

.dashboard-chart-card__body--full {
    min-height: 420px;
}

.dashboard-chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 220px;
}

.dashboard-chart-card__body--full .dashboard-chart-canvas-wrap {
    height: 360px;
}

.dashboard-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.dashboard-chart-card--panel .dashboard-chart-card__body {
    min-height: auto;
    overflow: visible;
    max-height: none;
}

.dashboard-chart-card__empty {
    color: var(--color-muted);
    margin: 0;
    font-size: 0.875rem;
    padding: 24px 0;
    text-align: center;
}

.dashboard-active-list {
    overflow: visible;
    max-height: none;
}

.dashboard-active-list__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.dashboard-active-list__avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-active-list__row:last-child {
    border-bottom: none;
}

.dashboard-active-list__name {
    font-weight: 500;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
}

.dashboard-active-list__time {
    color: var(--color-muted);
    text-align: right;
    white-space: nowrap;
}

.dashboard-active-list__empty {
    color: var(--color-muted);
    margin: 0;
    font-size: 0.875rem;
}

.stat-card__label {
    color: var(--color-muted);
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Sidebar collapsed (desktop) */
body.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .app-main,
body.sidebar-collapsed .app-header {
    margin-left: 0;
    left: 0;
}

/* Mobile */
@media (max-width: 991px) {
    .app-main {
        margin-left: 0;
    }

    .app-header {
        left: 0;
        padding: 0 16px;
    }

    .app-sidebar {
        width: min(300px, 86vw);
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .app-sidebar__overlay {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .app-sidebar__brand {
        padding: 0 10px 0 16px;
        gap: 8px;
    }

    .app-sidebar__brand-link {
        min-width: 0;
        flex: 1;
    }

    .app-sidebar__brand-logo {
        height: 34px;
        max-width: 100%;
    }

    .app-header__toggle,
    .app-sidebar__close {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .app-header__toggle {
        width: 44px;
        height: 44px;
    }

    .app-sidebar__close {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .app-sidebar__close i {
        font-size: 1.85rem;
    }

    .app-sidebar__link {
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 0;
    }

    .app-sidebar__link i {
        font-size: 1.35rem;
    }

    .app-header__search {
        display: none;
    }
}

/* Auth / Login */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #e0e7ff 100%);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.auth-card__header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card__logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    overflow: hidden;
    /* background: #0a0a0a; */
    /* box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); */
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card__logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-card__header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-card__header p {
    color: var(--color-muted);
    margin: 0;
    font-size: 0.9rem;
}

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.auth-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-form__group {
    margin-bottom: 18px;
}

.auth-form__group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.auth-form__input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0 14px;
    background: var(--color-bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-form__input-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: var(--color-surface);
}

.auth-form__input-wrap i {
    color: var(--color-muted);
    font-size: 1.1rem;
}

.auth-form__input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px 0;
    font-size: 0.95rem;
    color: var(--color-text);
}

.auth-form__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.auth-form__remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-muted);
    cursor: pointer;
    margin: 0;
}

.auth-form__remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

.auth-form__submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background var(--transition);
}

.auth-form__submit:hover {
    background: var(--color-primary-dark);
}

/* Data table */
.page-card__header--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.page-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    -webkit-border-radius: var(--radius);
    -moz-border-radius: var(--radius);
    -ms-border-radius: var(--radius);
    -o-border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--color-bg);
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-muted);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table__empty {
    text-align: center;
    color: var(--color-muted);
    padding: 32px 16px !important;
}

.data-table__pagination {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.data-table__pagination > nav {
    width: 100%;
    align-items: center;
}

.data-table__pagination > nav > .d-sm-flex {
    width: 100%;
    gap: 1.5rem;
    align-items: center !important;
}

.data-table__pagination p {
    margin: 0;
    line-height: 1.25;
}

.data-table__pagination .pagination {
    margin: 0;
}

.data-table__pagination .page-link {
    color: var(--color-primary);
    border-color: var(--color-border);
    font-size: 0.875rem;
}

.data-table__pagination .page-item.active .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.data-table__pagination .page-link:hover {
    background: #eff6ff;
    color: var(--color-primary-dark);
}

.page-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-table__actions-col {
    width: 80px;
    text-align: center;
}

.data-table__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    border-radius: 8px;
    color: var(--color-primary);
    transition: background var(--transition);
}

.data-table__action:hover {
    background: #eff6ff;
}

.data-table__read:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.data-table__read:disabled:hover {
    background: transparent;
}

.app-modal .modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: 18px 22px 14px;
    align-items: flex-start;
}

.app-modal .modal-footer {
    border-top: 1px solid var(--color-border);
    padding: 14px 22px;
    gap: 10px;
}

.app-modal-dialog {
    max-width: 760px;
}

.app-modal--lead {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.app-modal--lead .modal-body {
    padding: 8px 22px 22px;
}

.app-modal__eyebrow {
    margin: 0 0 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-muted, #6b7280);
}

.app-modal--lead .modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.app-modal__name {
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 14px;
    color: var(--color-text);
}

.app-modal__remark {
    padding: 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.app-modal__details {
    margin: 0;
    display: grid;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    width: 100%;
}

.app-modal__details--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
}

.app-modal__details > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.app-modal__details > div[hidden] {
    display: none !important;
}

.app-modal__details-span {
    grid-column: 1 / -1;
}

.app-modal__details dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-muted, #6b7280);
}

.app-modal__details dd {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--color-text);
    word-break: break-word;
    white-space: pre-wrap;
}

.app-modal__readonly {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
    font-size: 0.95rem;
    color: var(--color-text);
}

.app-form--modal {
    max-width: none;
    width: 100%;
}

.app-modal__edit {
    margin-top: 16px;
    display: grid;
    gap: 16px;
    width: 100%;
}

.app-modal__edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    width: 100%;
}

.app-modal__edit-grid .app-form__group {
    margin-bottom: 0;
    min-width: 0;
}

.app-modal__edit-grid .app-form__group input,
.app-modal__edit-grid .app-form__group select {
    width: 100%;
    max-width: none;
}

.app-status-block {
    display: grid;
    gap: 8px;
    width: 100%;
}

.app-status-block__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-muted, #6b7280);
}

.app-status-picks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.app-status-pick {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.app-status-pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-status-pick__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.app-status-pick__text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
}

.app-status-pick__check {
    margin-left: auto;
    font-size: 1.05rem;
    color: currentColor;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.app-status-pick:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.app-status-pick.is-selected,
.app-status-pick:has(input:checked) {
    border-color: currentColor;
    background: var(--pick-bg);
    box-shadow: 0 0 0 3px var(--pick-ring);
}

.app-status-pick.is-selected .app-status-pick__check,
.app-status-pick:has(input:checked) .app-status-pick__check {
    opacity: 1;
    transform: scale(1);
}

.app-status-pick:has(input:focus-visible) {
    box-shadow: 0 0 0 3px var(--pick-ring);
}

.app-status-pick--hot {
    color: #dc2626;
    --pick-bg: #fef2f2;
    --pick-ring: rgba(220, 38, 38, 0.14);
}

.app-status-pick--warm {
    color: #ea580c;
    --pick-bg: #fff7ed;
    --pick-ring: rgba(234, 88, 12, 0.14);
}

.app-status-pick--cold {
    color: #0284c7;
    --pick-bg: #f0f9ff;
    --pick-ring: rgba(2, 132, 199, 0.14);
}

.app-status-pick--processing {
    color: #2563eb;
    --pick-bg: #eff6ff;
    --pick-ring: rgba(37, 99, 235, 0.14);
}

.app-status-pick--success {
    color: #16a34a;
    --pick-bg: #f0fdf4;
    --pick-ring: rgba(22, 163, 74, 0.14);
}

.app-status-pick--fail {
    color: #dc2626;
    --pick-bg: #fef2f2;
    --pick-ring: rgba(220, 38, 38, 0.14);
}

@media (max-width: 575px) {
    .app-modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    .app-modal__details--two,
    .app-modal__edit-grid,
    .app-status-picks {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dashboard-presets {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .dashboard-preset {
        width: 100%;
    }

    .dashboard-filter-form__field {
        flex: 1 1 100%;
    }

    .dashboard-filter-form__buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-filter-form__buttons .app-form__btn {
        width: 100%;
    }
}

.data-table__row--clickable {
    cursor: pointer;
}

.data-table__row--clickable:hover {
    background: #f8fafc;
}

.data-table__row--clickable:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: -2px;
}

.data-table__action i {
    font-size: 1.2rem;
}

.app-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.app-alert--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.app-form {
    max-width: 560px;
}

.app-form.app-form--modal {
    max-width: none;
    width: 100%;
}

.app-form__group {
    margin-bottom: 20px;
}

.app-form__group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.app-form__required {
    color: #dc2626;
}

.app-form__group input,
.app-form__group textarea,
.app-form__group select {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.app-form__group input:focus,
.app-form__group textarea:focus,
.app-form__group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.app-form__group textarea {
    resize: vertical;
    min-height: 100px;
}

.app-form__error {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #dc2626;
}

.app-form__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.app-form__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}

.app-form__btn--sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.app-form__btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.app-form__btn--primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.app-form__btn--secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.app-form__btn--secondary:hover {
    background: #e2e8f0;
    color: var(--color-text);
}

.app-form__hint {
    font-weight: 400;
    color: var(--color-muted);
}

.app-form__group input.app-form__readonly,
.app-form__group input[readonly] {
    background: var(--color-bg);
    color: var(--color-muted);
    cursor: default;
}

.app-form__group input.app-form__readonly:focus,
.app-form__group input[readonly]:focus {
    border-color: var(--color-border);
    box-shadow: none;
}

.app-form__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text);
}

.app-form__check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.app-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Filters */
.app-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.app-filters__search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 42px;
}

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

.app-filters__search input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.9rem;
    color: var(--color-text);
}

.app-filters__control {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-surface);
    min-height: 42px;
    flex: 1 1 150px;
    min-width: 150px;
    max-width: 200px;
}

.app-filters__link {
    font-size: 0.875rem;
    color: var(--color-muted);
    padding: 8px 4px;
}

.app-filters__link:hover {
    color: var(--color-primary);
}

/* Status badges */
.app-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.app-badge--processing { background: #dbeafe; color: #1d4ed8; }
.app-badge--success { background: #dcfce7; color: #15803d; }
.app-badge--fail { background: #fee2e2; color: #b91c1c; }
.app-badge--hot { background: #fee2e2; color: #b91c1c; }
.app-badge--warm { background: #ffedd5; color: #c2410c; }
.app-badge--cold { background: #e0f2fe; color: #0369a1; }
.app-badge--spam { background: #f3f4f6; color: #4b5563; }
.app-badge--role-1 { background: #ede9fe; color: #6d28d9; }
.app-badge--role-2 { background: #dbeafe; color: #1d4ed8; }
.app-badge--role-3 { background: #f3f4f6; color: #4b5563; }

.data-table--wide {
    table-layout: fixed;
    width: 100%;
    min-width: 1100px;
    font-size: 0.78rem;
    white-space: nowrap;
    border-collapse: collapse;
}

.data-table--wide thead {
    background: #eceff3;
}

.data-table--wide th,
.data-table--wide td {
    padding: 3px 8px;
    line-height: 1.25;
    vertical-align: middle;
    border: 1px solid #dde3ea;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table--wide th:nth-child(1),
.data-table--wide td:nth-child(1) { width: 4%; }   /* ID */

.data-table--wide th:nth-child(2),
.data-table--wide td:nth-child(2) { width: 10%; }  /* Date/Time */

.data-table--wide th:nth-child(3),
.data-table--wide td:nth-child(3) { width: 13%; }  /* Name */

.data-table--wide th:nth-child(4),
.data-table--wide td:nth-child(4) { width: 11%; }  /* Phone */

.data-table--wide th:nth-child(5),
.data-table--wide td:nth-child(5) { width: 15%; }  /* Email */

.data-table--wide th:nth-child(6),
.data-table--wide td:nth-child(6) { width: 8%; }   /* Interested */

.data-table--wide th:nth-child(7),
.data-table--wide td:nth-child(7) { width: 7%; }   /* From */

.data-table--wide th:nth-child(8),
.data-table--wide td:nth-child(8) { width: 7%; }   /* Status */

.data-table--wide th:nth-child(9),
.data-table--wide td:nth-child(9) { width: 11%; }  /* Remark */

.data-table--wide th:nth-child(10),
.data-table--wide td:nth-child(10) { width: 7%; }  /* Assign */

.data-table--wide th:nth-child(11),
.data-table--wide td:nth-child(11) { width: 7%; }  /* Updated By */

.data-table--wide th {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    text-align: center;
    color: #111827;
    background: #eceff3;
}

.data-table--wide tbody tr:nth-child(even) {
    background: #f7f9fb;
}

.data-table--wide tbody tr:hover,
.data-table--wide tbody tr.data-table__row--clickable:hover {
    background: #eef4ff;
}

.data-table--wide tbody tr:last-child td {
    border-bottom: 1px solid #dde3ea;
}

.data-table--wide .app-badge {
    display: inline-block;
    max-width: 100%;
    padding: 1px 6px;
    font-size: 0.68rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table--wide .data-table__actions-col {
    width: 44px;
}

.data-table--wide .data-table__action {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.data-table--wide .data-table__action i {
    font-size: 0.95rem;
}

@media (max-width: 991px) {
    .page-card__header--row {
        flex-direction: column;
    }

    .dashboard-toolbar {
        gap: 14px;
    }

    .dashboard-toolbar__intro,
    .dashboard-toolbar__actions {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    .dashboard-toolbar h2 {
        font-size: 1.25rem;
        word-break: break-word;
    }

    .dashboard-presets,
    .dashboard-filter-form__row,
    .dashboard-filter-form__errors {
        justify-content: flex-start;
        text-align: left;
    }

    .dashboard-filter-form__row {
        align-items: stretch;
    }

    .dashboard-segment {
        width: 100%;
    }

    .dashboard-segment__option {
        flex: 1 1 0;
    }

    .dashboard-segment__option span {
        text-align: center;
    }

    .dashboard-filter-form__dates {
        flex: 1 1 100%;
        width: 100%;
    }

    .dashboard-filter-form__field {
        flex: 1 1 calc(50% - 4px);
    }

    .dashboard-filter-form__buttons {
        width: 100%;
    }

    .dashboard-filter-form__buttons .app-form__btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .app-filters__search {
        flex-basis: 100%;
    }
}
