:root {
    --lcp-bg: #f3f6fb;
    --lcp-card: #ffffff;
    --lcp-line: #e5eaf2;
    --lcp-text: #172033;
    --lcp-muted: #64748b;
    --lcp-primary: #2563eb;
    --lcp-primary-2: #1d4ed8;
    --lcp-danger: #dc2626;
    --lcp-success: #16a34a;
    --lcp-warning: #d97706;
    --lcp-radius: 18px;
    --lcp-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.lcp-app {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--lcp-text);
    background: linear-gradient(180deg, #f8fbff 0%, var(--lcp-bg) 100%);
    border: 1px solid var(--lcp-line);
    border-radius: 28px;
    overflow: hidden;
    width: 100%;
}

.lcp-notify {
    margin: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.lcp-notify.success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--lcp-success);
}

.lcp-notify.error {
    background: rgba(220, 38, 38, 0.12);
    color: var(--lcp-danger);
}

.lcp-login-view {
    min-height: 440px;
    display: grid;
    place-items: center;
    padding: 28px;
}

.lcp-login-card {
    width: 100%;
    max-width: 520px;
    background: var(--lcp-card);
    border: 1px solid var(--lcp-line);
    border-radius: 26px;
    box-shadow: var(--lcp-shadow);
    padding: 30px;
}

.lcp-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.lcp-brand h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.1;
}

.lcp-brand p {
    margin: 4px 0 0;
    color: var(--lcp-muted);
    font-size: 0.96rem;
}

.lcp-brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--lcp-primary), #60a5fa);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.lcp-brand-mark.small {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 0.95rem;
}

.lcp-form {
    display: grid;
    gap: 12px;
}

.lcp-form label {
    font-weight: 700;
    font-size: 0.95rem;
}

.lcp-form input,
.lcp-form select,
.lcp-filter-input {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid var(--lcp-line);
    background: #fff;
    padding: 0 14px;
    font-size: 0.96rem;
    color: var(--lcp-text);
    box-sizing: border-box;
    width: 100%;
}

.lcp-form input:focus,
.lcp-form select:focus,
.lcp-filter-input:focus {
    outline: none;
    border-color: var(--lcp-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.lcp-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--lcp-muted);
    font-weight: 600 !important;
}

.lcp-check input {
    min-height: auto;
    width: auto;
}

.lcp-btn {
    min-height: 46px;
    border-radius: 14px;
    border: 0;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.lcp-btn:hover {
    transform: translateY(-1px);
}

.lcp-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--lcp-primary), var(--lcp-primary-2));
}

.lcp-btn-light {
    background: #eef2f7;
    color: #334155;
}

.lcp-feedback {
    min-height: 20px;
    margin: 0;
    font-size: 0.92rem;
    color: var(--lcp-muted);
}

.lcp-feedback.is-error {
    color: var(--lcp-danger);
}

.lcp-dashboard-view {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 760px;
}

.lcp-sidebar {
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px 18px;
}

.lcp-sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}

.lcp-token-label {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 4px;
    word-break: break-all;
}

.lcp-mobile-menu-toggle {
    display: none;
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 12px;
}

.lcp-nav {
    display: grid;
    gap: 8px;
}

.lcp-nav-item {
    width: 100%;
    text-align: left;
    min-height: 46px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.lcp-nav-item:hover,
.lcp-nav-item.active {
    background: rgba(255,255,255,0.08);
}

.lcp-nav-item.danger {
    margin-top: 10px;
    color: #fecaca;
}

.lcp-main {
    padding: 20px;
    display: grid;
    gap: 18px;
    min-width: 0;
}

.lcp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.lcp-topbar-text {
    min-width: 0;
}

.lcp-kicker {
    color: var(--lcp-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.lcp-topbar h1 {
    margin: 0;
    font-size: 1.85rem;
    line-height: 1.1;
}

.lcp-statusbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lcp-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 999px;
    padding: 0 14px;
    font-weight: 800;
    background: #eef2f7;
    color: #475569;
    white-space: nowrap;
}

.lcp-pill.neutral {
    background: #eef2f7;
    color: #475569;
}

.lcp-page[hidden] {
    display: none !important;
}

.lcp-card {
    background: var(--lcp-card);
    border: 1px solid var(--lcp-line);
    border-radius: var(--lcp-radius);
    box-shadow: var(--lcp-shadow);
    padding: 18px;
    min-width: 0;
}

.lcp-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.lcp-card-head-stack {
    flex-direction: column;
    align-items: stretch;
}

.lcp-card h3 {
    margin: 0;
    font-size: 1.08rem;
}

.lcp-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
}

.lcp-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.lcp-summary-card {
    background: var(--lcp-card);
    border: 1px solid var(--lcp-line);
    border-radius: 16px;
    box-shadow: var(--lcp-shadow);
    padding: 16px;
}

.lcp-summary-label {
    color: var(--lcp-muted);
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.lcp-summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.lcp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lcp-toolbar .lcp-filter-input {
    flex: 1 1 220px;
}

.lcp-toolbar .lcp-btn {
    flex: 0 0 auto;
}

.lcp-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
}

.lcp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    background: #fff;
}

.lcp-table th,
.lcp-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--lcp-line);
    text-align: left;
    vertical-align: middle;
    font-size: 0.94rem;
}

.lcp-table th {
    color: var(--lcp-muted);
    background: #fbfcfe;
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}

.lcp-empty {
    text-align: center;
    color: var(--lcp-muted);
    padding: 22px !important;
}

.lcp-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
}

.lcp-dot.ok {
    background: #22c55e;
}

.lcp-dot.warn {
    background: #facc15;
}

.lcp-dot.danger {
    background: #ef4444;
}

.lcp-dot.neutral {
    background: #94a3b8;
}

.lcp-inline-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lcp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    margin: 4px 8px 4px 0;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.3;
    flex-wrap: wrap;
    word-break: break-word;
}

.lcp-badge-gray {
    background: #e5e7eb;
    color: #374151;
}

.lcp-badge-green {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.lcp-hunting-live-row td {
    background: #fcfdff;
}

.lcp-hunting-live-block + .lcp-hunting-live-block-second,
.lcp-hunting-live-block-second {
    margin-top: 10px;
}

.lcp-hunting-live-title {
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--lcp-text);
}

.lcp-hunting-live-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.lcp-muted {
    color: var(--lcp-muted);
}

@media (max-width: 1180px) {
    .lcp-dashboard-view {
        grid-template-columns: 1fr;
    }

    .lcp-grid,
    .lcp-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .lcp-app {
        border-radius: 20px;
    }

    .lcp-login-view {
        padding: 14px;
        min-height: 100dvh;
    }

    .lcp-login-card {
        border-radius: 20px;
        padding: 20px;
    }

    .lcp-sidebar {
        padding: 14px;
    }

    .lcp-sidebar-head {
        margin-bottom: 10px;
    }

    .lcp-mobile-menu-toggle {
        display: block;
    }

    .lcp-nav {
        display: none;
    }

    .lcp-nav.is-open {
        display: grid;
    }

    .lcp-main {
        padding: 14px;
        gap: 14px;
    }

    .lcp-card {
        border-radius: 16px;
        padding: 14px;
    }

    .lcp-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .lcp-topbar h1 {
        font-size: 1.45rem;
    }

    .lcp-statusbar {
        width: 100%;
    }

    .lcp-pill {
        width: 100%;
        justify-content: center;
    }

    .lcp-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lcp-toolbar {
        flex-direction: column;
    }

    .lcp-toolbar .lcp-filter-input,
    .lcp-toolbar .lcp-btn {
        width: 100%;
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    .lcp-table-wrap {
        overflow: visible;
    }

    .lcp-table,
    .lcp-table thead,
    .lcp-table tbody,
    .lcp-table th,
    .lcp-table td,
    .lcp-table tr {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    .lcp-table thead {
        display: none;
    }

    .lcp-table tbody {
        display: grid;
        gap: 12px;
    }

    .lcp-table tr {
        background: #fff;
        border: 1px solid var(--lcp-line);
        border-radius: 14px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
        padding: 10px 12px;
    }

    .lcp-table td {
        border: 0;
        padding: 8px 0;
        display: grid;
        grid-template-columns: 92px 1fr;
        gap: 10px;
        align-items: start;
        text-align: left;
        word-break: break-word;
    }

    .lcp-table td::before {
        content: "";
        color: var(--lcp-muted);
        font-weight: 700;
        font-size: 0.8rem;
    }

    .lcp-empty {
        display: block !important;
        text-align: center;
        padding: 16px 8px !important;
    }

    #lcp-overview-table td:nth-child(1)::before { content: "Numéro"; }
    #lcp-overview-table td:nth-child(2)::before { content: "État"; }
    #lcp-overview-table td:nth-child(3)::before { content: "Occupation"; }

    #lcp-calls-table td:nth-child(1)::before { content: "Date"; }
    #lcp-calls-table td:nth-child(2)::before { content: "Direction"; }
    #lcp-calls-table td:nth-child(3)::before { content: "État"; }
    #lcp-calls-table td:nth-child(4)::before { content: "Durée"; }

    #lcp-events-table td:nth-child(1)::before { content: "Date"; }
    #lcp-events-table td:nth-child(2)::before { content: "Événement"; }
    #lcp-events-table td:nth-child(3)::before { content: "Direction"; }

    #lcp-hunting-table td:nth-child(1)::before { content: "Type"; }
    #lcp-hunting-table td:nth-child(2)::before { content: "Numéro"; }
    #lcp-hunting-table td:nth-child(3)::before { content: "Description"; }
    #lcp-hunting-table td:nth-child(4)::before { content: "Répondus"; }
    #lcp-hunting-table td:nth-child(5)::before { content: "Perdus"; }
    #lcp-hunting-table td:nth-child(6)::before { content: "Traités"; }
    #lcp-hunting-table td:nth-child(7)::before { content: "% succès"; }
    #lcp-hunting-table td:nth-child(8)::before { content: "En attente"; }
    #lcp-hunting-table td:nth-child(9)::before { content: "Attente moy."; }

    #lcp-hunting-history td:nth-child(1)::before { content: "Date"; }
    #lcp-hunting-history td:nth-child(2)::before { content: "File"; }
    #lcp-hunting-history td:nth-child(3)::before { content: "Membre"; }
    #lcp-hunting-history td:nth-child(4)::before { content: "Agent"; }
    #lcp-hunting-history td:nth-child(5)::before { content: "Durée file"; }
    #lcp-hunting-history td:nth-child(6)::before { content: "Durée appel"; }

    #lcp-hunting-table td[colspan],
    #lcp-hunting-history td[colspan],
    #lcp-overview-table td[colspan],
    #lcp-calls-table td[colspan],
    #lcp-events-table td[colspan] {
        display: block;
    }

    #lcp-hunting-table td[colspan]::before,
    #lcp-hunting-history td[colspan]::before,
    #lcp-overview-table td[colspan]::before,
    #lcp-calls-table td[colspan]::before,
    #lcp-events-table td[colspan]::before {
        content: "";
        display: none;
    }

    .lcp-summary-grid {
        grid-template-columns: 1fr;
    }

    .lcp-summary-card {
        padding: 14px;
    }

    .lcp-summary-value {
        font-size: 1.35rem;
    }

    .lcp-hunting-live-row {
        margin-top: -2px;
    }

    .lcp-hunting-live-row td {
        display: block !important;
        background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
        border-top: 1px dashed var(--lcp-line);
        padding-top: 12px;
    }

    .lcp-hunting-live-row td::before {
        display: none !important;
    }

    .lcp-hunting-live-block {
        border: 1px solid var(--lcp-line);
        border-radius: 12px;
        background: #ffffff;
        padding: 10px;
    }

    .lcp-hunting-live-block-second {
        margin-top: 10px;
    }

    .lcp-hunting-live-title {
        font-size: 0.86rem;
        margin-bottom: 8px;
    }

    .lcp-hunting-live-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .lcp-badge {
        display: flex;
        width: 100%;
        margin: 0;
        border-radius: 12px;
        padding: 10px 12px;
        justify-content: space-between;
    }

    .lcp-badge span[id^="q"],
    .lcp-badge span[id^="m"] {
        font-weight: 800;
        white-space: nowrap;
    }

    #lcp-hunting-history tr,
    #lcp-events-table tr {
        padding: 12px;
    }
}

@media (max-width: 520px) {
    .lcp-app {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .lcp-login-view {
        padding: 10px;
    }

    .lcp-login-card {
        padding: 16px;
        border-radius: 18px;
    }

    .lcp-brand {
        align-items: flex-start;
    }

    .lcp-brand h2 {
        font-size: 1.3rem;
    }

    .lcp-brand p {
        font-size: 0.92rem;
    }

    .lcp-brand-mark {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .lcp-main {
        padding: 10px;
    }

    .lcp-card {
        padding: 12px;
    }

    .lcp-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .lcp-topbar h1 {
        font-size: 1.28rem;
    }

    .lcp-table td {
        grid-template-columns: 84px 1fr;
        gap: 8px;
        font-size: 0.88rem;
    }

    .lcp-table td::before {
        font-size: 0.76rem;
    }

    #lcp-overview-table td {
        grid-template-columns: 74px 1fr;
    }

    .lcp-hunting-live-block {
        padding: 9px;
    }

    .lcp-badge {
        font-size: 0.8rem;
        padding: 9px 10px;
    }
}