/* ==========================================
   CLIENTE 360
========================================== */

.client360-modal{
    position:fixed;
    inset:0;
    z-index:9999;
}

.client360-overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.45);

    display:flex;
    justify-content:center;
    align-items:center;
}

.client360-window{

    width:min(1400px,95vw);
    height:min(900px,92vh);

    background:#ffffff;

    border-radius:16px;

    overflow:auto;

    padding:24px;

    box-shadow:
        0 20px 50px rgba(0,0,0,.25);

}

.client360-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:20px;

}

.client360-header h2{

    margin:0;

}

.client360-close{

    border:none;

    background:none;

    cursor:pointer;

    font-size:20px;

}

.client360-body{

    display:flex;

    flex-direction:column;

    gap:16px;

}

.client360-subtitle{
    margin:4px 0 0 0;
    color:#64748b;
    font-size:13px;
}

.client360-profile{
    display:flex;
    gap:20px;
    align-items:center;
    padding:20px;
    border:1px solid #e5e7eb;
    border-radius:16px;
    background:#ffffff;
    margin-bottom:18px;
}

.client360-avatar{
    width:72px;
    height:72px;
    border-radius:50%;
    background:linear-gradient(135deg,#2563eb,#14b8a6);
    color:#ffffff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:28px;
    font-weight:800;
}

.client360-profile-info h3{
    margin:0 0 12px 0;
    font-size:24px;
}

.client360-profile-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px 24px;
}

.client360-profile-grid p{
    margin:0;
    font-size:14px;
}

.client360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:16px;
}

.client360-card{
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:18px;
}

.client360-card:nth-child(1){
    border-left:5px solid #2563eb;
}

.client360-card:nth-child(2){
    border-left:5px solid #16a34a;
}

.client360-card:nth-child(3){
    border-left:5px solid #ea580c;
}

.client360-card:nth-child(4){
    border-left:5px solid #9333ea;
}

.client360-card h4{
    margin:0 0 8px 0;
    font-size:13px;
    color:#475569;
}

.client360-card span{
    display:block;
    font-size:24px;
    font-weight:800;
    color:#0f172a;
}

.client360-card small{
    color:#64748b;
}

.client360-tabs{
    display:flex;
    gap:8px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:8px;
    margin-bottom:16px;
    background:#ffffff;
}

.client360-tabs button{
    border:none;
    background:transparent;
    padding:10px 14px;
    border-radius:10px;
    cursor:pointer;
    font-weight:700;
    color:#475569;
}

.client360-tabs button.active{
    background:#eff6ff;
    color:#1d4ed8;
}

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

.client360-section{
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:18px;
    background:#ffffff;
}

.client360-section-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
}

.client360-section-header h3{
    margin:0;
}

.client360-section-header button{
    border:none;
    background:transparent;
    color:#2563eb;
    font-weight:700;
    cursor:pointer;
}

.client360-empty{
    padding:18px;
    background:#f8fafc;
    border-radius:12px;
    color:#64748b;
}

.client360-loading{
    padding:32px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:14px;
    color:#64748b;
    font-weight:700;
}

.client360-mini-row{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:12px 0;
    border-bottom:1px solid #e5e7eb;
}

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

.client360-mini-row strong{
    display:block;
    color:#0f172a;
}

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

.client360-task-list{

    display:flex;

    flex-direction:column;

    gap:10px;

}

.client360-task{

    display:flex;

    align-items:center;

    background:#f8fafc;

    border:1px solid #e5e7eb;

    border-radius:8px;

    padding:8px 12px;

    font-size:13px;

    min-height:38px;

}

.client360-quote-card{

    border:1px solid #e5e7eb;

    border-radius:12px;

    padding:14px;

    margin-bottom:12px;

    background:#ffffff;

}

.client360-quote-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:10px;

}

.client360-status{

    background:#eff6ff;

    color:#2563eb;

    padding:4px 8px;

    border-radius:8px;

    font-size:12px;

    font-weight:600;

}

.client360-quote-event{

    font-weight:700;

    margin-bottom:10px;

}

.client360-quote-details{

    display:flex;

    gap:16px;

    color:#64748b;

    font-size:13px;

    margin-bottom:12px;

}

.client360-quote-footer{

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.client360-quote-footer button{

    border:none;

    background:#1e2945;

    color:white;

    padding:8px 12px;

    border-radius:8px;

    cursor:pointer;

}

/* ==========================================
   CLIENTES - TABLA
========================================== */

.clients-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    border: 1px solid #e5e7eb;
    margin-top: 18px;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.clients-table th {
    text-align: left;
    padding: 14px 16px;
    background: #f8fafc;
    color: #1e293b;
    font-weight: 800;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.clients-table th button {
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.clients-table th button:hover {
    color: #2563eb;
}

.clients-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #0f172a;
    vertical-align: middle;
    white-space: nowrap;
}

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

.client-table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.client-table-actions button {
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
}

/* ==========================================
   FIX CLIENTES - LISTA COMO TABLA
========================================== */

.clients-list {
    width: 100%;
    max-width: 100%;
    display: block;
}

#clientsList {
    width: 100%;
    max-width: 100%;
}

.clients-table-wrapper {
    width: 100%;
    max-width: 100%;
}

.clients-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.clients-counter {
    margin: 10px 0 14px 0;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

.clients-toolbar input {

    width: 500px;

    max-width: 100%;

}

.clients-counter {

    margin: 10px 0;

    font-size: 13px;

    font-weight: 700;

    color: #64748b;

}

.clients-header-actions {

    display: flex;

    justify-content: flex-end;

    margin-bottom: 16px;

}

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

.clients-header h2 {
    margin: 0;
}

.clients-header .clients-counter {
    margin-top: 4px;
}

.clients-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.clients-toolbar input {
    width: 520px;
    max-width: 100%;
}

.client-table-actions button[title]:hover::after {
    content: attr(title);
}

/* ==========================================
   CLIENTES GLOBAL
========================================== */

.clients-global-analytics {
    margin: 0 0 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.clients-back-btn {
    margin-bottom: 12px;
}

.clients-global-analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.clients-global-analytics-header h3 {
    margin: 0;
    color: #111827;
    font-size: 17px;
}

.clients-global-analytics-header p,
.clients-analytics-note {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 12px;
}

.clients-period-selector {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 4px;
    background: #e5e7eb;
    border-radius: 8px;
}

.clients-period-selector select,
.clients-period-selector button {
    min-height: 32px;
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.clients-period-selector select {
    min-width: 112px;
    background: #ffffff;
    color: #111827;
    outline: none;
}

.clients-period-selector button.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.clients-global-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.clients-chart-card {
    min-height: 250px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.clients-chart-card h4 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 14px;
}

.clients-chart-card canvas {
    max-height: 190px;
}

@media (max-width: 900px) {
    .clients-global-analytics-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .clients-global-charts {
        grid-template-columns: 1fr;
    }
}
