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

body {
    font-family: Inter, Arial, sans-serif;
    background: #f4f7fb;
    color: #0f172a;
}

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

[hidden] {
    display: none !important;
}

.crm {
    min-height: 100vh;
    display: block;
}


/* LOGIN */

.login-body,
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #071226, #1d4ed8);
    padding: 20px;
}

.login-box,
.auth-card {
    width: 420px;
    max-width: 100%;
    background: #fff;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.25);
}

.login-logo,
.auth-logo {
    font-size: 24px;
    font-weight: 800;
    color: #1d4ed8;
    margin-bottom: 20px;
}

.login-box h1,
.auth-card h1 {
    font-size: 26px;
    margin-bottom: 12px;
}

.auth-card p {
    color: #64748b;
    margin-bottom: 24px;
}

.login-box label,
.auth-card label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #475569;
}

.login-box input,
.auth-card input {
    width: 100%;
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 14px;
    margin-bottom: 16px;
    font-size: 15px;
}

.login-box button,
.auth-card button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.alert-error,
.alert-danger,
.alert {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

/* SIDEBAR */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0b1730, #071226);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    pointer-events: auto;
}

.logo {
    height: 78px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: white;
    color: #2563eb;
}

.nav,
.sidebar-menu {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
}

.nav a,
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    color: #cbd5e1;
    border-radius: 11px;
    margin-bottom: 5px;
    font-size: 15px;
    transition: .2s;
}

.nav a svg,
.sidebar-menu a svg {
    width: 20px;
    height: 20px;
}

.nav a:hover,
.nav a.active,
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: linear-gradient(135deg, #1d4ed8, #274690);
    color: white;
}

.sidebar-user {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    background: #2563eb;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.sidebar-user b {
    display: block;
    font-size: 14px;
}

.sidebar-user span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

/* TOPBAR */

.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    margin-left: 0;
    height: 78px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
}

.topbar-context {
    min-width: 170px;
}

.topbar-context span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar-context strong {
    display: block;
    color: #0f172a;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.15;
}

.topbar-search {
    width: min(520px, 40vw);
    max-width: 100%;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 8px 0 15px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.topbar-search:focus-within {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .10);
}

.topbar-search svg {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
}

.topbar-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font-size: 14px;
}

.topbar-search input::placeholder {
    color: #94a3b8;
}

.topbar-search button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: #e0ebff;
    color: #2563eb;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.topbar-search button:hover {
    background: #2563eb;
    color: #fff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-link {
    height: 38px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
}

.topbar-link svg {
    width: 17px;
    height: 17px;
}

.topbar-link:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.topbar-dropdown {
    position: relative;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #475569;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 17px;
    position: relative;
}

.topbar-btn.primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.topbar-btn:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.topbar-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ef4444;
}

.topbar-user {
    height: 44px;
    min-width: 188px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 4px 10px 4px 5px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #0f172a;
    cursor: pointer;
}

.topbar-user:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #0f172a;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 850;
    flex-shrink: 0;
}

.topbar-avatar-image {
    padding: 3px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.topbar-avatar img,
.logo-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.topbar-user-text {
    min-width: 0;
    text-align: left;
    line-height: 1.15;
}

.topbar-user-text b,
.topbar-user-text small {
    display: block;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-text b {
    font-size: 13px;
}

.topbar-user-text small {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.topbar-user > svg {
    width: 16px;
    height: 16px;
    color: #64748b;
    margin-left: auto;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
    display: none;
    z-index: 80;
}

.dropdown-menu.show {
    display: block;
}

.topbar-menu a {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 750;
}

.topbar-menu a:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.topbar-menu a.danger {
    color: #dc2626;
}

.topbar-menu svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.topbar-updates {
    width: 280px;
}

.topbar-updates b,
.topbar-updates span {
    display: block;
    padding: 5px 8px;
}

.topbar-updates b {
    color: #0f172a;
    font-size: 14px;
}

.topbar-updates span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

/* MAIN */

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    padding-top: 78px;
    background: #f4f7fb;
}


.content {
    padding: 24px 28px 40px;
    width: 100%;
}

.content h1,
.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 22px;
}

/* CARDS */

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.card-title,
.card-header {
    padding: 20px 22px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title h3,
.card-header h3 {
    font-size: 17px;
    font-weight: 800;
}

.card-body {
    padding: 18px 22px 22px;
}

.muted {
    color: #64748b;
}

.small-text {
    font-size: 12px;
    margin-top: 4px;
}

.table-status {
    margin: 0 18px 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 13px;
    font-weight: 700;
}

.table-status.error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.error-text {
    color: #b91c1c;
}

.product-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.product-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

/* KPI */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.kpi,
.kpi-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 28px;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 28px;
    height: 28px;
}

.blue-soft,
.kpi-blue {
    background: #dbeafe;
    color: #2563eb;
}

.green-soft,
.kpi-green {
    background: #d1fae5;
    color: #16a34a;
}

.purple-soft,
.kpi-purple {
    background: #ede9fe;
    color: #7c3aed;
}

.orange-soft,
.kpi-orange {
    background: #fef3c7;
    color: #f59e0b;
}

.kpi span,
.kpi-card small {
    display: block;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 6px;
}

.kpi h2,
.kpi-card h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}

.green-text,
.up {
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
}

/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.25fr .95fr;
    gap: 16px;
    margin-bottom: 16px;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr .95fr;
    gap: 16px;
}

.small-select,
.select-small {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    color: #64748b;
    background: #fff;
}

/* FUNNEL */

.funnel-layout,
.funnel-wrap {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 24px 26px;
}

.funnel {
    width: 260px;
    flex-shrink: 0;
}

.funnel-step,
.funnel div {
    height: 50px;
    margin: 0 auto 6px;
    clip-path: polygon(8% 0, 92% 0, 82% 100%, 18% 100%);
}

.funnel-list,
.legend {
    flex: 1;
}

.funnel-row,
.legend-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}

.funnel-row span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.funnel-row i,
.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

/* MANAGERS */

.manager-list {
    padding: 8px 20px 18px;
}

.manager-row,
.manager {
    display: grid;
    grid-template-columns: 38px 1fr 130px 100px;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
    font-size: 13px;
}

.mini-avatar,
.face {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    display: grid;
    place-items: center;
    color: #2563eb;
    font-weight: 800;
}

.manager-info span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

.progress,
.bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
}

.progress span,
.bar span {
    display: block;
    height: 100%;
    background: #2563eb;
}

/* TASKS */

.task-list {
    padding: 4px 0 8px;
}

.task-row,
.task {
    display: grid;
    grid-template-columns: 22px 1fr 48px;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

.task-row:last-child,
.task:last-child {
    border-bottom: none;
}

.task-check,
.circle {
    width: 15px;
    height: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    margin-top: 2px;
}

.task-row small,
.task small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

/* ACTIVITY */

.activity-list {
    padding: 8px 0;
}

.activity-row {
    display: grid;
    grid-template-columns: 40px 1fr 55px;
    gap: 12px;
    padding: 13px 18px;
    font-size: 13px;
    border-bottom: 1px solid #eef2f7;
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #dbeafe;
}

.activity-row small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

/* REVENUE */

.revenue-block,
.revenue-box {
    padding: 0 22px 20px;
}

.revenue-block h2,
.revenue-box h2 {
    font-size: 28px;
    margin-bottom: 18px;
}

.revenue-block h2 span {
    color: #16a34a;
    font-size: 18px;
}

.fake-chart,
.chart-placeholder {
    height: 200px;
    border-radius: 14px;
    background:
        linear-gradient(to top, rgba(37, 99, 235, .13), transparent),
        repeating-linear-gradient(to top, #e5e7eb 0 1px, transparent 1px 40px);
    position: relative;
    overflow: hidden;
}

.chart-line {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 42px;
    height: 110px;
    border-bottom: 4px solid #2563eb;
    transform: skewY(-18deg);
}

/* CLIENTS MINI */

.client-list,
.client-list-mini {
    padding: 4px 0 10px;
}

.client-row,
.client-mini {
    display: grid;
    grid-template-columns: 36px 1fr 60px;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

.client-row:last-child,
.client-mini:last-child {
    border-bottom: none;
}

.client-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    display: grid;
    place-items: center;
}

.client-row small,
.client-mini small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

.card-link,
.link-center {
    display: block;
    text-align: center;
    padding: 14px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

/* TABLES */

.table-card {
    overflow: hidden;
}

.table-toolbar {
    padding: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.table-search {
    width: 340px;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 14px;
    outline: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
}

.table tr:hover td {
    background: #f8fafc;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-lost {
    background: #fee2e2;
    color: #b91c1c;
}

/* BUTTONS */

.btn {
    border: none;
    border-radius: 10px;
    height: 42px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-light {
    background: #f1f5f9;
    color: #334155;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

/* FORMS */

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

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
    color: #334155;
}

.form-control {
    width: 100%;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 13px;
    outline: none;
    font-size: 14px;
    background: #fff;
}

textarea.form-control {
    height: 100px;
    padding-top: 12px;
    resize: vertical;
}

.form-control:focus {
    border-color: #2563eb;
}

/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 680px;
    max-width: 100%;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.modal-header {
    height: 66px;
    padding: 0 22px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    border: none;
    background: #f1f5f9;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
    .topbar-link span,
    .topbar-user-text {
        display: none;
    }

    .topbar-link {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    .topbar-user {
        min-width: 46px;
        padding-right: 5px;
    }

    .topbar-user > svg {
        display: none;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .manager-row,
    .manager {
        grid-template-columns: 38px 1fr;
    }

    .manager-row .progress,
    .manager-row > b,
    .manager .bar,
    .manager > b {
        display: none;
    }
}

@media (max-width: 800px) {
    .sidebar {
        display: none;
    }

    .topbar,
    .main {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        left: 0;
        height: 72px;
        padding: 0 16px;
        gap: 12px;
    }

    .topbar-actions {
        display: none;
    }

    .topbar-context {
        min-width: 112px;
    }

    .topbar-context span {
        font-size: 11px;
    }

    .topbar-context strong {
        font-size: 15px;
    }

    .topbar-search {
        width: auto;
        flex: 1;
    }

    .topbar-search input {
        font-size: 13px;
    }

    .content {
        padding: 20px 16px 32px;
    }

    .kpi-grid,
    .dashboard-grid,
    .bottom-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .funnel-layout,
    .funnel-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .funnel {
        width: 100%;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        width: 100%;
    }

    .table {
        min-width: 760px;
    }

    .table-card {
        overflow-x: auto;
    }
}


.menu-group {
    margin-bottom: 6px;
}

.menu-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px;
    color: #cbd5e1;
    border-radius: 11px;
    cursor: pointer;
}

.menu-parent.active,
.menu-parent:hover {
    background: linear-gradient(135deg, #1d4ed8, #274690);
    color: white;
}

.menu-child {
    display: none;
    padding: 4px 0 6px 42px;
}

.menu-child a {
    display: block;
    padding: 9px 12px;
    font-size: 14px;
    color: #94a3b8;
    border-radius: 8px;
    margin-bottom: 2px;
}

.menu-child a.active,
.menu-child a:hover {
    background: rgba(255,255,255,.08);
    color: white;
}

.menu-group.open .menu-child {
    display: block;
}

.arrow {
    font-size: 12px;
    transition: 0.2s;
}

.menu-group.open .arrow {
    transform: rotate(180deg);
}


.parser-log {
    height: 280px;
    overflow-y: auto;
    background: #0b1220;
    color: #dbeafe;
    border-radius: 14px;
    padding: 14px;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.parser-card {
    cursor: pointer;
}

.parser-card.active {
    border-color: #2563eb;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}

.parser-state {
    display: inline-block;
    margin-top: 8px;
}

.parser-row {
    display: grid;
    grid-template-columns: 150px 90px 1fr;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.parser-row span {
    color: #93c5fd;
}

.parser-row b {
    text-transform: uppercase;
}

.parser-success b {
    color: #22c55e;
}

.parser-error b {
    color: #ef4444;
}

.parser-warning b {
    color: #f59e0b;
}

.parser-skip b {
    color: #94a3b8;
}

.parser-done b {
    color: #38bdf8;
}


.parser-details {
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
    color: #bfdbfe;
    white-space: pre-wrap;
    overflow-x: auto;
    font-size: 12px;
}

.parser-debug b {
    color: #a78bfa;
}

.parser-step b {
    color: #60a5fa;
}

.pagination {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
}

.pagination button {
    min-width: 38px;
    height: 38px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.pagination button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pagination span {
    color: #94a3b8;
    padding: 0 4px;
}

/* INVENTORY */

.inventory-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 18px;
    align-items: start;
}

.inventory-form .btn {
    width: 100%;
}

.pos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.pos-header h1 {
    margin-bottom: 0;
}

.pos-warehouse {
    width: 260px;
    flex-shrink: 0;
}

.pos-layout {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 18px;
    align-items: start;
}

.pos-products {
    min-height: 620px;
}

.pos-product-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.pos-product {
    min-height: 104px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.pos-product:hover:not(:disabled) {
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.pos-product.zero-stock {
    border-color: #fbbf24;
    background: #fffbeb;
}

.pos-product.zero-stock .pos-product-image {
    background: #fef3c7;
    color: #b45309;
}

.pos-product.offer-product {
    border-color: #93c5fd;
    background: #f8fbff;
}

.pos-product.offer-product .pos-product-image {
    background: #dbeafe;
    color: #1d4ed8;
}

.pos-product:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pos-product b {
    font-size: 14px;
    line-height: 1.35;
}

.pos-product span {
    color: #64748b;
    font-size: 13px;
}

.pos-cart {
    position: sticky;
    top: 96px;
}

.pos-cart-items {
    min-height: 260px;
    max-height: 390px;
    overflow-y: auto;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
}

.pos-cart-row {
    display: grid;
    grid-template-columns: 1fr 86px 92px;
    gap: 10px;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid #eef2f7;
}

.pos-cart-row:last-child {
    border-bottom: none;
}

.pos-cart-row b {
    display: block;
    font-size: 14px;
}

.pos-cart-row span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

.pos-qty {
    height: 34px;
    display: grid;
    grid-template-columns: 28px 30px 28px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.pos-qty button {
    height: 100%;
    border: 0;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 800;
}

.pos-qty span {
    margin: 0;
    color: #0f172a;
    text-align: center;
    font-weight: 800;
}

.pos-summary {
    padding: 18px;
}

.pos-summary > div:first-child,
.pos-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pos-summary span,
.pos-total span {
    color: #64748b;
}

.pos-total {
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.pos-total b {
    font-size: 24px;
}

.pos-pay-btn {
    width: 100%;
    height: 50px;
}

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

    .pos-cart {
        position: static;
    }
}

@media (max-width: 800px) {
    .pos-header {
        align-items: stretch;
        flex-direction: column;
    }

    .pos-warehouse {
        width: 100%;
    }

    .pos-cart-row {
        grid-template-columns: 1fr;
    }
}

/* POS PRO */

.pos-pro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.pos-pro-header h1 {
    margin-bottom: 6px;
}

.pos-shift {
    color: #64748b;
    font-size: 13px;
}

.pos-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 18px;
    align-items: start;
}

.pos-left {
    display: grid;
    gap: 14px;
}

.pos-scan-panel {
    padding: 14px;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 12px;
}

.pos-scan-box,
.pos-search-box {
    height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #dbeafe;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0 14px;
}

.pos-scan-box {
    border-color: #93c5fd;
    background: #eff6ff;
}

.pos-scan-box svg,
.pos-search-box svg {
    width: 22px;
    height: 22px;
    color: #2563eb;
    flex-shrink: 0;
}

.pos-scan-box input,
.pos-search-box input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.pos-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.pos-tabs button {
    height: 38px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 0 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.pos-tabs button.active,
.pos-tabs button:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.pos-products {
    min-height: calc(100vh - 250px);
}

.pos-products-head {
    height: 62px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.pos-products-head b,
.pos-products-head span {
    display: block;
}

.pos-products-head span {
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

.pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    align-content: start;
    max-height: calc(100vh - 318px);
    overflow-y: auto;
}

.pos-product {
    min-height: 126px;
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: stretch;
}

.pos-product-image {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: #dbeafe;
    color: #2563eb;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
    overflow: hidden;
}

.pos-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-product-info {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.pos-product-info b {
    font-size: 14px;
}

.pos-product-info span {
    line-height: 1.3;
}

.pos-product-info strong {
    color: #0f172a;
    font-size: 16px;
}

.pos-register {
    position: sticky;
    top: 96px;
}

.pos-receipt-head {
    min-height: 70px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.pos-receipt-head h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.pos-receipt-head span {
    color: #64748b;
    font-size: 13px;
}

.pos-held {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px;
}

.pos-held:not(:empty) {
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f7;
}

.pos-held button {
    height: 32px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 8px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.pos-cart-items {
    min-height: 250px;
    max-height: calc(100vh - 526px);
}

.pos-cart-row {
    grid-template-columns: minmax(0, 1fr) 110px 92px;
}

.pos-qty {
    grid-template-columns: 30px 48px 30px;
}

.pos-qty input {
    width: 100%;
    height: 100%;
    border: 0;
    text-align: center;
    outline: none;
    font-weight: 800;
    color: #0f172a;
}

.pos-line-total {
    text-align: right;
}

.pos-line-total button {
    border: 0;
    background: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    margin-top: 4px;
}

.pos-summary-line,
.pos-total-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-summary-line {
    margin-bottom: 14px;
}

.pos-summary-line span,
.pos-total-box span {
    color: #64748b;
}

.pos-discount-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pos-payments {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 4px 0 14px;
}

.pos-payments button {
    min-height: 50px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pos-payments button.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.pos-payments svg {
    width: 18px;
    height: 18px;
}

.pos-total-box {
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.pos-total-box b {
    display: block;
    font-size: 22px;
    color: #0f172a;
    margin-top: 4px;
}

.pos-pay-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.pos-hotkeys {
    display: flex;
    justify-content: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 12px;
}

.pos-empty,
.pos-empty-cart {
    padding: 28px;
    color: #64748b;
    text-align: center;
    grid-column: 1 / -1;
}

.pos-empty-cart {
    min-height: 180px;
    display: grid;
    place-items: center;
}

.pos-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    padding: 13px 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s;
}

.pos-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.pos-toast.error {
    background: #b91c1c;
}

/* CASHIER FULLSCREEN */

body.cashier-body {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: #0f172a;
    background:
        radial-gradient(circle at 12% 0, rgba(37, 99, 235, .12), transparent 32%),
        linear-gradient(180deg, #eef3fb 0, #f8fafc 100%);
}

.cashier-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.cashier-topbar {
    height: 72px;
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    border-bottom: 1px solid #dbe3ef;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
    backdrop-filter: blur(14px);
}

.cashier-brand,
.cashier-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
}

.cashier-brand {
    min-width: 142px;
    padding: 0 18px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #123477);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .24);
}

.cashier-brand svg,
.cashier-nav svg {
    width: 19px;
    height: 19px;
}

.cashier-status {
    display: grid;
    gap: 3px;
}

.cashier-status span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cashier-status b {
    color: #0f172a;
    font-size: 20px;
}

.cashier-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cashier-nav a {
    padding: 0 14px;
    border: 1px solid #dbe3ef;
    color: #10203f;
    background: #fff;
}

.cashier-nav a:hover {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.cashier-user {
    min-height: 46px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 190px;
    padding: 4px 12px 4px 5px;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #fff;
}

.cashier-user > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: #0f172a;
    font-weight: 950;
}

.cashier-user b,
.cashier-user small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashier-user b {
    font-size: 14px;
}

.cashier-user small {
    color: #64748b;
    font-size: 12px;
}

.cashier-main {
    min-height: 0;
    padding: 16px 18px 18px;
    overflow: hidden;
}

.cashier-body .cashier-pos-header {
    min-height: 72px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid #dbe3ef;
    border-radius: 20px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.cashier-body .cashier-pos-header h1 {
    margin: 0 0 5px;
    font-size: 26px;
}

.cashier-body .cashier-workspace {
    min-height: 0;
    height: calc(100vh - 176px);
    grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
}

.cashier-body .pos-left,
.cashier-body .pos-register,
.cashier-body .pos-products {
    min-height: 0;
}

.cashier-body .pos-scan-panel,
.cashier-body .pos-products,
.cashier-body .pos-register {
    border: 1px solid #dbe3ef;
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.cashier-body .pos-product-grid {
    max-height: calc(100vh - 354px);
    padding: 16px;
}

.cashier-body .pos-product {
    border-radius: 16px;
}

.cashier-body .pos-register {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-rows: auto auto minmax(120px, 1fr) auto;
    max-height: calc(100vh - 176px);
}

.cashier-body .pos-cart-items {
    max-height: none;
    overflow-y: auto;
}

.cashier-body .pos-summary {
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.cashier-body .pos-pay-btn {
    min-height: 58px;
    border-radius: 16px;
    font-size: 16px;
}

.topbar-link-cashier {
    color: #123477;
    background: #eff6ff;
}

.topbar-link-cashier:hover {
    color: #fff;
    background: #2563eb;
}

.topbar-link-chat {
    position: relative;
    color: #123477;
    background: #eff6ff;
}

.topbar-link-chat:hover {
    color: #fff;
    background: #2563eb;
}

.topbar-link-badge,
.sidebar-badge {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.topbar-link-badge {
    margin-left: 2px;
}

.sidebar-badge {
    margin-left: auto;
}

.chat-admin-page {
    display: grid;
    gap: 16px;
}

.chat-admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(135deg, #17337f, #2563eb);
    color: #fff;
    box-shadow: 0 22px 56px rgba(37, 99, 235, .18);
}

.chat-admin-hero span {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.chat-admin-hero h1 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 30px;
}

.chat-admin-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    line-height: 1.45;
}

.chat-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
}

.chat-kpis article {
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .04);
}

.chat-kpis span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

.chat-kpis span.blue { background: #dbeafe; color: #2563eb; }
.chat-kpis span.green { background: #dcfce7; color: #16a34a; }
.chat-kpis span.orange { background: #ffedd5; color: #f97316; }
.chat-kpis span.red { background: #fee2e2; color: #ef4444; }

.chat-kpis small {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-weight: 700;
}

.chat-kpis b {
    font-size: 24px;
    font-weight: 900;
}

.chat-workspace {
    height: calc(100vh - 310px);
    min-height: 620px;
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr) 300px;
    gap: 16px;
}

.chat-list-panel,
.chat-conversation-panel,
.chat-info-panel {
    min-height: 0;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .045);
}

.chat-list-panel {
    display: grid;
    grid-template-rows: auto auto 1fr;
    overflow: hidden;
}

.chat-list-toolbar {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-search {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
}

.chat-search svg {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.chat-search input,
.chat-list-toolbar select,
.chat-head-actions select,
.chat-info-card select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    outline: 0;
}

.chat-search input {
    border: 0;
    background: transparent;
}

.chat-list-toolbar select,
.chat-head-actions select,
.chat-info-card select {
    height: 40px;
    padding: 0 11px;
}

.chat-filter-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    overflow-x: auto;
    border-bottom: 1px solid #e2e8f0;
}

.chat-filter-row button,
.chat-quick-replies button,
.chat-side-actions button {
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-weight: 800;
}

.chat-filter-row button {
    height: 34px;
    padding: 0 12px;
    white-space: nowrap;
}

.chat-filter-row button.active {
    background: #2563eb;
    color: #fff;
}

.chat-dialog-list {
    min-height: 0;
    overflow: auto;
    padding: 10px;
}

.chat-list-item {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.chat-list-item:hover,
.chat-list-item.active {
    border-color: #dbeafe;
    background: #f8fbff;
}

.chat-list-item.has-unread {
    background: #eff6ff;
}

.chat-list-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
}

.chat-list-main {
    min-width: 0;
}

.chat-list-main b,
.chat-list-main small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-list-main b {
    margin-bottom: 4px;
    font-size: 14px;
}

.chat-list-main small,
.chat-list-side small {
    color: #64748b;
    font-size: 12px;
}

.chat-list-side {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.chat-list-side i {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.chat-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.chat-status.new { background: #dbeafe; color: #1d4ed8; }
.chat-status.open { background: #dcfce7; color: #15803d; }
.chat-status.pending { background: #ffedd5; color: #c2410c; }
.chat-status.closed { background: #e2e8f0; color: #475569; }
.chat-status.spam { background: #fee2e2; color: #b91c1c; }

.chat-conversation-panel {
    overflow: hidden;
}

.chat-conversation,
.chat-conversation-panel {
    min-height: 0;
}

.chat-conversation {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
}

.chat-conversation-empty,
.chat-empty-state {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 28px;
    color: #64748b;
    text-align: center;
}

.chat-conversation-empty svg,
.chat-empty-state svg {
    width: 42px;
    height: 42px;
    color: #2563eb;
}

.chat-conversation-empty h2,
.chat-empty-state p {
    margin: 0;
    color: #0f172a;
}

.chat-conversation-head {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-conversation-head span {
    display: block;
    margin-bottom: 4px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.chat-conversation-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.chat-conversation-head p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.chat-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-messages {
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(180deg, #f8fbff, #fff);
}

.chat-message {
    max-width: 76%;
}

.chat-message.admin {
    align-self: flex-end;
}

.chat-message.visitor {
    align-self: flex-start;
}

.chat-message > div {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.chat-message.admin > div {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.chat-message header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 900;
}

.chat-message time {
    opacity: .72;
    font-weight: 800;
}

.chat-message p {
    margin: 0;
    line-height: 1.45;
}

.chat-quick-replies {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    border-top: 1px solid #e2e8f0;
}

.chat-quick-replies button {
    min-height: 34px;
    padding: 0 12px;
    color: #1d4ed8;
    background: #eff6ff;
    white-space: nowrap;
}

.chat-reply-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid #e2e8f0;
}

.chat-reply-form textarea {
    min-height: 46px;
    max-height: 130px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    resize: none;
    overflow: auto;
    outline: 0;
    font: inherit;
}

.chat-info-panel {
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 14px;
}

.chat-info-card {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
}

.chat-info-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.chat-info-card dl {
    display: grid;
    gap: 9px;
}

.chat-info-card dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.chat-info-card dd {
    margin: 0;
    color: #0f172a;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.chat-context {
    display: grid;
    gap: 9px;
}

.chat-context p {
    margin: 0;
    color: #64748b;
    line-height: 1.4;
}

.chat-context-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: #f8fafc;
}

.chat-context-row svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 11px;
    background: #dbeafe;
    color: #2563eb;
}

.chat-context-row b,
.chat-context-row small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-context-row small {
    margin-top: 2px;
    color: #64748b;
    font-weight: 700;
}

.chat-side-actions {
    display: grid;
    gap: 9px;
}

.chat-side-actions button {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 0 12px;
    border-radius: 12px;
    text-align: left;
}

@media (max-width: 1320px) {
    .chat-workspace {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .chat-info-panel {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .chat-admin-hero,
    .chat-conversation-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .chat-kpis,
    .chat-workspace,
    .chat-info-panel {
        grid-template-columns: 1fr;
    }

    .chat-workspace {
        height: auto;
    }

    .chat-list-panel,
    .chat-conversation-panel {
        min-height: 520px;
    }
}

@media (max-width: 1180px) {
    body.cashier-body {
        overflow: auto;
    }

    .cashier-topbar {
        height: auto;
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 12px;
    }

    .cashier-brand,
    .cashier-nav a {
        width: 100%;
    }

    .cashier-status {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .cashier-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cashier-user {
        width: 100%;
    }

    .cashier-main {
        overflow: visible;
        padding: 12px;
    }

    .cashier-body .cashier-workspace {
        height: auto;
        grid-template-columns: 1fr;
    }

    .cashier-body .pos-register {
        position: static;
        max-height: none;
    }

    .cashier-body .pos-product-grid,
    .cashier-body .pos-cart-items {
        max-height: none;
    }
}

@media (max-width: 720px) {
    .cashier-nav {
        grid-template-columns: 1fr;
    }
}

/* ADMIN */

.admin-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.settings-card {
    max-width: 880px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.checkbox-line input {
    width: 16px;
    height: 16px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 12px;
    margin-bottom: 16px;
}

.table td .btn + .btn {
    margin-left: 6px;
}

/* OPERATIONAL PAGES */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    align-items: start;
}

.kanban-column {
    min-height: 420px;
}

.kanban-head {
    padding: 16px;
    border-top: 4px solid #2563eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-head span {
    color: #64748b;
    font-weight: 800;
}

.kanban-list {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.kanban-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.kanban-card b,
.kanban-card span,
.kanban-card strong {
    display: block;
}

.kanban-card span {
    color: #64748b;
    font-size: 12px;
    margin: 5px 0 8px;
}

.calendar-toolbar,
.report-filter {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.calendar-toolbar label,
.report-filter label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 6px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 10px;
}

.calendar-day {
    min-height: 120px;
    padding: 12px;
}

.calendar-day.today {
    border-color: #2563eb;
}

.calendar-task {
    margin-top: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.empty-state-card {
    max-width: 720px;
}

.empty-state-card h3 {
    margin-bottom: 8px;
}

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

.tool-card {
    padding: 18px;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    align-items: start;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #eff6ff;
}

.tool-icon svg {
    width: 24px;
    height: 24px;
}

.tool-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.tool-body p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.tool-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.db-note {
    margin-top: 16px;
}

/* SHOP COLLECTIONS */

.collection-admin-page {
    display: grid;
    gap: 18px;
}

.collection-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 2px 0 4px;
}

.collection-topline span,
.collection-board-head span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-weight: 800;
}

.collection-topline h1 {
    margin: 0;
    color: #051433;
    font-size: 34px;
    line-height: 1.08;
}

.collection-topline p {
    max-width: 760px;
    margin: 8px 0 0;
    color: #60708f;
    font-size: 15px;
    line-height: 1.5;
}

.collection-top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.collection-top-actions .btn,
.collection-filters .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.collection-alert {
    padding: 13px 16px;
    border-radius: 14px;
    font-weight: 800;
}

.collection-alert.success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.collection-alert.danger {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.collection-admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: stretch;
    padding: 28px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 78% 0, rgba(125, 211, 252, .35), transparent 34%),
        linear-gradient(135deg, #102f7a, #2563eb 68%, #1d4ed8);
    box-shadow: 0 24px 54px rgba(37, 99, 235, .22);
    overflow: hidden;
}

.collection-hero-copy span {
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #bfdbfe;
}

.collection-hero-copy h2 {
    max-width: 860px;
    margin: 8px 0 10px;
    color: #fff;
    font-size: 32px;
    line-height: 1.08;
}

.collection-hero-copy p {
    max-width: 780px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 16px;
    line-height: 1.5;
}

.collection-hero-card {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 20px;
    background: rgba(255, 255, 255, .13);
    backdrop-filter: blur(12px);
}

.collection-hero-card svg {
    width: 36px;
    height: 36px;
    color: #fff;
}

.collection-hero-card b {
    color: #fff;
    font-size: 18px;
}

.collection-hero-card small {
    color: rgba(255, 255, 255, .82);
    line-height: 1.4;
}

.collection-hero-card a {
    width: max-content;
    padding: 10px 12px;
    border-radius: 12px;
    color: #0f3f96;
    background: #fff;
    font-weight: 950;
    text-decoration: none;
}

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

.collection-kpi-grid article {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border: 1px solid #dfe7f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .05);
}

.collection-kpi-grid span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    border-radius: 16px;
}

.collection-kpi-grid svg {
    width: 24px;
    height: 24px;
}

.collection-kpi-grid small {
    display: block;
    color: #64748b;
    font-weight: 800;
}

.collection-kpi-grid b {
    display: block;
    margin-top: 2px;
    color: #071735;
    font-size: 28px;
    line-height: 1;
}

.collection-kpi-grid .blue {
    color: #2563eb;
    background: #dbeafe;
}

.collection-kpi-grid .green {
    color: #16a34a;
    background: #dcfce7;
}

.collection-kpi-grid .purple {
    color: #7c3aed;
    background: #ede9fe;
}

.collection-kpi-grid .orange {
    color: #f97316;
    background: #ffedd5;
}

.collection-filters {
    padding: 16px;
    border: 1px solid #dfe7f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .04);
}

.collection-filters form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 190px 210px auto auto;
    gap: 12px;
    align-items: end;
}

.collection-filters label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 850;
}

.collection-board {
    padding: 20px;
    border: 1px solid #dfe7f3;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
}

.collection-board-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

.collection-board-head h2 {
    margin: 0;
    color: #071735;
    font-size: 24px;
}

.collection-board-head small {
    color: #64748b;
    font-weight: 850;
}

.collection-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.collection-card-admin {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #f8fbff);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .05);
}

.collection-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.collection-card-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 54px;
    border-radius: 17px;
    color: #2563eb;
    background: #eaf1ff;
}

.collection-card-icon svg {
    width: 27px;
    height: 27px;
}

.collection-card-badges {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.collection-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    color: #475569;
    background: #eef2f7;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}

.collection-pill.success {
    color: #15803d;
    background: #dcfce7;
}

.collection-pill.warning {
    color: #92400e;
    background: #fef3c7;
}

.collection-pill.danger {
    color: #b91c1c;
    background: #fee2e2;
}

.collection-pill.blue {
    color: #1d4ed8;
    background: #dbeafe;
}

.collection-pill.soft {
    color: #6d28d9;
    background: #ede9fe;
}

.collection-pill.muted {
    color: #64748b;
    background: #f1f5f9;
}

.collection-card-admin h3 {
    margin: 0;
    color: #071735;
    font-size: 20px;
    line-height: 1.2;
}

.collection-card-admin p {
    min-height: 44px;
    margin: 0;
    color: #64748b;
    line-height: 1.4;
    font-weight: 650;
}

.collection-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.collection-meta div {
    padding: 11px;
    border: 1px solid #e6edf7;
    border-radius: 14px;
    background: #fff;
}

.collection-meta small {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.collection-meta b {
    display: block;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
}

.collection-card-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 2px;
}

.collection-card-footer form {
    margin: 0;
}

.collection-action {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    color: #1e3a8a;
    background: #edf4ff;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.collection-action svg {
    width: 17px;
    height: 17px;
}

.collection-action.primary {
    color: #fff;
    background: #2563eb;
}

.collection-action.danger {
    width: 42px;
    padding: 0;
    color: #fff;
    background: #ef4444;
}

.collection-empty-state {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #f8fafc;
}

.collection-empty-state svg {
    width: 54px;
    height: 54px;
    color: #2563eb;
}

.collection-empty-state h3 {
    margin: 0;
    color: #071735;
    font-size: 22px;
}

.collection-empty-state p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 1280px) {
    .collection-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-filters form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .collection-topline,
    .collection-admin-hero {
        display: grid;
        grid-template-columns: 1fr;
    }

    .collection-kpi-grid,
    .collection-card-grid,
    .collection-filters form {
        grid-template-columns: 1fr;
    }

    .collection-hero-copy h2 {
        font-size: 26px;
    }
}

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

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .pos-register {
        position: static;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .pos-product-grid,
    .pos-cart-items {
        max-height: none;
    }
}

@media (max-width: 800px) {
    .pos-pro-header,
    .pos-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pos-scan-panel,
    .pos-discount-row,
    .pos-payments {
        grid-template-columns: 1fr;
    }

    .pos-cart-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .pos-line-total {
        text-align: left;
    }
}

/* MODERN ADMIN SIDEBAR */

.sidebar {
    width: 260px;
    background:
        radial-gradient(circle at 20% 0%, rgba(37, 99, 235, .24), transparent 34%),
        linear-gradient(180deg, #071226 0%, #09142b 54%, #050b18 100%);
    border-right: 1px solid rgba(148, 163, 184, .14);
    box-shadow: 12px 0 34px rgba(15, 23, 42, .12);
}

.logo {
    height: 82px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.logo-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #1d4ed8;
    background: linear-gradient(135deg, #fff, #dbeafe);
    box-shadow: 0 14px 28px rgba(37, 99, 235, .22);
    flex: 0 0 auto;
}

.logo-mark svg {
    width: 20px;
    height: 20px;
}

.logo-mark-image {
    padding: 4px;
    background: #fff;
}

.logo-text {
    display: grid;
    gap: 2px;
    line-height: 1.1;
}

.logo-text strong {
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: .01em;
}

.logo-text span {
    color: #93c5fd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}

.sidebar-filter {
    margin: 12px 12px 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 13px;
    background: rgba(15, 23, 42, .5);
    color: #93a4bb;
}

.sidebar-filter svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.sidebar-filter input {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    touch-action: manipulation;
}

.sidebar-filter input::placeholder {
    color: #64748b;
}

.sidebar-quick-links {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px 0;
}

.sidebar-quick-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    background: rgba(15, 23, 42, .5);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 900;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-quick-links a.active,
.sidebar-quick-links a:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(99, 102, 241, .72));
}

.sidebar-quick-links svg {
    width: 17px;
    height: 17px;
}

.admin-sidebar-nav {
    padding: 14px 12px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .45) transparent;
}

.admin-sidebar-nav::-webkit-scrollbar {
    width: 7px;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .35);
    border-radius: 999px;
}

.sidebar-section {
    margin: 0 0 6px;
}

.sidebar-section-title {
    padding: 10px 11px 7px;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.admin-sidebar-nav > .sidebar-section > a,
.admin-sidebar-nav .menu-parent {
    min-height: 44px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    margin: 0 0 6px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: #cbd5e1;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.admin-sidebar-nav > .sidebar-section > a:hover,
.admin-sidebar-nav > .sidebar-section > a.active,
.admin-sidebar-nav .menu-parent:hover,
.admin-sidebar-nav .menu-parent.active {
    color: #fff;
    border-color: rgba(147, 197, 253, .18);
    background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(29, 78, 216, .68));
    box-shadow: 0 12px 28px rgba(37, 99, 235, .18);
}

.admin-sidebar-nav > .sidebar-section > a:hover,
.admin-sidebar-nav .menu-parent:hover {
    transform: translateX(2px);
}

.admin-sidebar-nav a svg,
.admin-sidebar-nav .menu-parent svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

.sidebar-parent-label {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
}

.sidebar-parent-label span,
.admin-sidebar-nav > .sidebar-section > a span:first-of-type {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-sidebar-nav .menu-child {
    display: none;
    margin: -2px 0 8px 21px;
    padding: 4px 0 4px 12px;
    border-left: 1px solid rgba(148, 163, 184, .18);
}

.admin-sidebar-nav .menu-group.open .menu-child {
    display: block;
}

.admin-sidebar-nav .menu-child a {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    margin: 0 0 3px;
    border-radius: 11px;
    color: #9fb0c7;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.admin-sidebar-nav .menu-child-label {
    padding: 12px 10px 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .1em;
    line-height: 1.1;
    text-transform: uppercase;
}

.admin-sidebar-nav .menu-child-label:first-child {
    padding-top: 4px;
}

.admin-sidebar-nav .menu-child a:hover,
.admin-sidebar-nav .menu-child a.active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.admin-sidebar-nav .menu-child a.active {
    box-shadow: inset 3px 0 0 #60a5fa;
}

.admin-sidebar-nav .arrow {
    width: 17px;
    height: 17px;
    color: #93a4bb;
    transition: transform .18s ease, color .18s ease;
}

.admin-sidebar-nav .menu-parent.active .arrow,
.admin-sidebar-nav .menu-parent:hover .arrow {
    color: #fff;
}

.admin-sidebar-nav .menu-group.open .arrow {
    transform: rotate(180deg);
}

.sidebar-badge {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239, 68, 68, .25);
}

.sidebar-user {
    min-height: 76px;
    background: rgba(2, 6, 23, .26);
}

.sidebar-avatar {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

/* CRM MOBILE APP SHELL */

.crm-mobile-bottom-nav {
    display: none;
}

.crm-mobile-app .topbar-search {
    display: none;
}

.crm-mobile-app .topbar-link,
.crm-mobile-app .topbar-dropdown:not(:last-child) {
    display: none;
}

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

.mobile-app-menu-hero {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #071b45, #2563eb);
    color: #fff;
    box-shadow: 0 18px 44px rgba(37, 99, 235, .18);
}

.mobile-app-menu-hero span {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mobile-app-menu-hero h1 {
    margin: 6px 0;
    color: #fff;
}

.mobile-app-menu-hero p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
}

.mobile-app-menu-stats {
    width: fit-content;
    min-width: 132px;
    margin-top: 14px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
}

.mobile-app-menu-stats b,
.mobile-app-menu-stats small {
    display: block;
    color: #fff;
}

.mobile-app-menu-stats b {
    font-size: 22px;
    line-height: 1;
}

.mobile-app-menu-stats small {
    margin-top: 3px;
    color: rgba(255, 255, 255, .76);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.mobile-app-menu-section {
    display: grid;
    gap: 12px;
}

.mobile-app-section-head h2 {
    margin: 0;
    color: #071b45;
    font-size: 20px;
}

.mobile-app-section-head small {
    color: #64748b;
    font-weight: 750;
}

.mobile-app-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.mobile-app-menu-card {
    min-height: 132px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 16px;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #fff;
    color: #071b45;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.mobile-app-menu-card:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.mobile-app-menu-card svg {
    width: 24px;
    height: 24px;
    color: #2563eb;
}

.mobile-app-menu-card strong {
    font-size: 16px;
    font-weight: 950;
}

.mobile-app-menu-card span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

.mobile-app-menu-card.danger svg,
.mobile-app-menu-card.danger strong {
    color: #dc2626;
}

/* MOBILE ADMIN SHELL */

.mobile-sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

.mobile-sidebar-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    text-decoration: none;
}

.mobile-sidebar-toggle svg {
    width: 21px;
    height: 21px;
}

@media (max-width: 800px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .mobile-sidebar-toggle {
        display: grid;
    }

    .sidebar {
        display: flex;
        width: min(92vw, 340px);
        transform: translateX(-104%);
        transition: transform .22s ease;
        z-index: 1000;
        will-change: transform;
    }

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

    .sidebar-quick-links {
        display: grid;
    }

    .admin-sidebar-nav {
        padding-bottom: 28px;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        pointer-events: none;
        opacity: 0;
        background: rgba(2, 6, 23, .54);
        backdrop-filter: blur(2px);
        transition: opacity .2s ease;
        z-index: 900;
    }

    body.sidebar-open .sidebar-backdrop {
        pointer-events: auto;
        opacity: 1;
    }

    .topbar {
        left: 0;
        right: 0;
        height: 64px;
        padding: 0 10px;
        gap: 10px;
    }

    .topbar-context {
        min-width: 0;
        flex: 1;
    }

    .topbar-context span {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-context strong {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 15px;
    }

    .topbar-search,
    .topbar-link,
    .topbar-dropdown:not(:last-child) {
        display: none;
    }

    .topbar-actions {
        display: flex;
        flex: 0 0 auto;
        gap: 0;
    }

    .topbar-user {
        min-width: 42px;
        height: 42px;
        padding: 4px;
        border-radius: 12px;
    }

    .topbar-avatar {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .topbar-user-text,
    .topbar-user > svg {
        display: none;
    }

    .dropdown-menu {
        position: fixed;
        top: 58px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding-top: 64px;
    }

    .content {
        padding: 14px 10px 28px;
    }

    .content h1,
    .page-title {
        margin-bottom: 14px;
        font-size: 22px;
        line-height: 1.2;
    }

    .card,
    .table-card,
    .mobile-card {
        border-radius: 12px;
    }

    .card-title,
    .card-header,
    .table-toolbar {
        padding: 14px;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .card-body {
        padding: 14px;
    }

    .btn,
    button,
    input,
    select,
    textarea {
        max-width: 100%;
    }

    .btn {
        min-height: 42px;
        white-space: normal;
    }

    .table-card,
    .mobile-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content .card > table,
    .content .card > .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content table {
        min-width: 720px;
    }

    .content table th,
    .content table td {
        padding: 11px 12px;
        font-size: 13px;
        vertical-align: top;
    }

    .crm-mobile-app table[data-mobile-cards="true"] {
        min-width: 0;
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    .crm-mobile-app table[data-mobile-cards="true"] thead {
        display: none;
    }

    .crm-mobile-app table[data-mobile-cards="true"] tbody,
    .crm-mobile-app table[data-mobile-cards="true"] tr,
    .crm-mobile-app table[data-mobile-cards="true"] td {
        display: block;
        width: 100%;
    }

    .crm-mobile-app table[data-mobile-cards="true"] tbody {
        padding: 10px;
    }

    .crm-mobile-app table[data-mobile-cards="true"] tr {
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    }

    .crm-mobile-app table[data-mobile-cards="true"] td {
        min-height: 32px;
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0;
        border: 0;
        color: #0f172a;
        word-break: break-word;
    }

    .crm-mobile-app table[data-mobile-cards="true"] td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .kpi,
    .kpi-card {
        padding: 16px;
        align-items: flex-start;
    }

    .kpi-icon {
        width: 48px;
        height: 48px;
    }

    .kpi h2,
    .kpi-card h2 {
        font-size: 24px;
    }

    .modal {
        padding: 10px;
        align-items: flex-start;
    }

    .modal-content {
        width: 100%;
        margin-top: 8px;
    }

    .crm-mobile-app .content {
        padding-bottom: 84px;
    }

    .crm-mobile-app .topbar {
        box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
    }

    .crm-mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 6px;
        z-index: 850;
        min-height: 56px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 5px;
        border: 1px solid rgba(219, 228, 240, .92);
        border-radius: 18px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
        backdrop-filter: blur(16px);
    }

    .crm-mobile-bottom-nav a {
        min-width: 0;
        display: grid;
        place-items: center;
        gap: 2px;
        padding: 5px 2px;
        border-radius: 14px;
        color: #64748b;
        text-decoration: none;
        font-size: 10.5px;
        font-weight: 900;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .crm-mobile-bottom-nav a.active {
        background: #eef4ff;
        color: #1d4ed8;
    }

    .crm-mobile-bottom-nav svg {
        width: 18px;
        height: 18px;
    }

    .mobile-app-menu-hero {
        padding: 16px;
        border-radius: 16px;
    }

    .mobile-app-menu-hero h1 {
        font-size: 26px;
        line-height: 1.08;
    }

    .mobile-app-menu-hero p {
        font-size: 14px;
        line-height: 1.35;
    }

    .mobile-app-menu-grid,
    .mobile-app-menu-grid.service {
        grid-template-columns: 1fr 1fr;
    }

    .mobile-app-menu-card {
        min-height: 108px;
        gap: 6px;
        padding: 12px;
        border-radius: 14px;
    }

    .mobile-app-menu-card svg {
        width: 22px;
        height: 22px;
    }

    .mobile-app-menu-card strong {
        font-size: 15px;
    }

    .mobile-app-menu-card span {
        font-size: 12px;
        line-height: 1.3;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: 0 8px;
    }

    .mobile-sidebar-toggle,
    .topbar-user {
        width: 40px;
        height: 40px;
    }

    .content {
        padding-left: 8px;
        padding-right: 8px;
    }

    .mobile-app-menu-grid,
    .mobile-app-menu-grid.service {
        gap: 9px;
    }
}
