/* ===========================================================
   DISPLAYOS UI KIT v1.0
   =========================================================== */

/* ---------- CARD ---------- */

.ui-card{
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:22px;
    box-shadow:0 18px 45px rgba(15,23,42,.08);
    transition:.25s ease;
    overflow:hidden;
}

.ui-card:hover{
    transform:translateY(-6px);
    box-shadow:0 28px 60px rgba(15,23,42,.14);
}

.ui-card-header{
    padding:22px 26px;
    border-bottom:1px solid #edf2f7;
    font-size:20px;
    font-weight:700;
}

.ui-card-body{
    padding:26px;
}

.ui-card-footer{
    padding:20px 26px;
    border-top:1px solid #edf2f7;
    background:#f8fafc;
}

/* ---------- BOTTONI ---------- */

.btn{
    border:none;
    border-radius:15px;
    padding:14px 22px;
    cursor:pointer;
    font-weight:700;
    font-size:15px;
    transition:.25s ease;
}

.btn:hover{
    transform:translateY(-2px);
}

.btn:active{
    transform:scale(.98);
}

.btn-primary{
    color:#fff;
    background:linear-gradient(135deg,#2563eb,#0ea5e9);
}

.btn-success{
    color:#fff;
    background:linear-gradient(135deg,#16a34a,#22c55e);
}

.btn-danger{
    color:#fff;
    background:linear-gradient(135deg,#dc2626,#ef4444);
}

.btn-warning{
    color:#fff;
    background:linear-gradient(135deg,#d97706,#f59e0b);
}

.btn-secondary{
    background:#f1f5f9;
    color:#334155;
}

/* ---------- INPUT ---------- */

.ui-input{
    width:100%;
    padding:14px 16px;
    border-radius:14px;
    border:1px solid #dbe3ec;
    background:white;
    font-size:15px;
    transition:.25s;
}

.ui-input:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

.ui-label{
    display:block;
    margin-bottom:8px;
    font-weight:700;
    color:#1e293b;
}

/* ---------- BADGE ---------- */

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
}

.badge-primary{
    background:#dbeafe;
    color:#1d4ed8;
}

.badge-success{
    background:#dcfce7;
    color:#15803d;
}

.badge-danger{
    background:#fee2e2;
    color:#b91c1c;
}

.badge-warning{
    background:#fef3c7;
    color:#b45309;
}

.badge-gray{
    background:#e2e8f0;
    color:#475569;
}

/* ---------- AVATAR ---------- */

.avatar{
    width:48px;
    height:48px;
    border-radius:50%;
    background:linear-gradient(135deg,#2563eb,#0ea5e9);
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    font-weight:800;
}

/* ---------- KPI ---------- */

.kpi{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.kpi-label{
    color:#64748b;
    font-size:14px;
}

.kpi-value{
    font-size:36px;
    font-weight:800;
    color:#0f172a;
    letter-spacing:-1px;
}

.kpi-change{
    font-size:14px;
    font-weight:700;
}

.kpi-positive{
    color:#16a34a;
}

.kpi-negative{
    color:#dc2626;
}

.kpi-warning{
    color:#f59e0b;
}

/* ---------- PROGRESS ---------- */

.progress{
    width:100%;
    height:10px;
    border-radius:999px;
    background:#e2e8f0;
    overflow:hidden;
}

.progress-fill{
    height:100%;
    background:linear-gradient(90deg,#2563eb,#0ea5e9);
    transition:.4s;
}

.progress-success{
    background:linear-gradient(90deg,#16a34a,#22c55e);
}

.progress-warning{
    background:linear-gradient(90deg,#f59e0b,#fbbf24);
}

.progress-danger{
    background:linear-gradient(90deg,#dc2626,#ef4444);
}

/* ---------- DIVISORI ---------- */

.divider{
    width:100%;
    height:1px;
    background:#e2e8f0;
    margin:20px 0;
}

/* ---------- LISTE ---------- */

.ui-list{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.ui-list-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 0;
    border-bottom:1px solid #edf2f7;
}

.ui-list-item:last-child{
    border-bottom:none;
}

/* ---------- TABELLE ---------- */

.ui-table{
    width:100%;
    border-collapse:collapse;
}

.ui-table th{
    text-align:left;
    padding:14px;
    background:#f8fafc;
    color:#475569;
    font-weight:700;
}

.ui-table td{
    padding:14px;
    border-bottom:1px solid #edf2f7;
}

/* ---------- ALERT ---------- */

.alert{
    padding:16px 20px;
    border-radius:16px;
    margin-bottom:20px;
}

.alert-success{
    background:#dcfce7;
    color:#15803d;
}

.alert-danger{
    background:#fee2e2;
    color:#b91c1c;
}

.alert-warning{
    background:#fef3c7;
    color:#b45309;
}

.alert-info{
    background:#dbeafe;
    color:#1d4ed8;
}

/* ---------- GRID ---------- */

.grid-2{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:24px;
}

.grid-3{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:24px;
}

.grid-4{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:24px;
}

/* ---------- UTILITIES ---------- */

.text-center{
    text-align:center;
}

.mt-10{margin-top:10px;}
.mt-20{margin-top:20px;}
.mt-30{margin-top:30px;}
.mt-40{margin-top:40px;}

.mb-10{margin-bottom:10px;}
.mb-20{margin-bottom:20px;}
.mb-30{margin-bottom:30px;}
.mb-40{margin-bottom:40px;}

.hidden{
    display:none !important;
}

/* ---------- RESPONSIVE ---------- */

@media(max-width:1100px){

    .grid-4{
        grid-template-columns:repeat(2,1fr);
    }

}

@media(max-width:800px){

    .grid-2,
    .grid-3,
    .grid-4{
        grid-template-columns:1fr;
    }

}

#toastContainer{
    position:fixed;
    top:24px;
    right:24px;
    z-index:9999;
    display:flex;
    flex-direction:column;
    gap:14px;
}

.toast{
    min-width:300px;
    max-width:420px;
    background:white;
    border:1px solid #e2e8f0;
    border-radius:18px;
    box-shadow:0 20px 45px rgba(15,23,42,.16);
    padding:16px 18px;
    display:flex;
    align-items:center;
    gap:14px;
    opacity:0;
    transform:translateX(30px);
    transition:.3s ease;
}

.toast.show{
    opacity:1;
    transform:translateX(0);
}

.toast span{
    width:34px;
    height:34px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:white;
    font-weight:900;
    flex-shrink:0;
}

.toast p{
    margin:0;
    font-weight:700;
    color:#0f172a;
}

.toast-success span{
    background:#16a34a;
}

.toast-error span{
    background:#dc2626;
}

.toast-warning span{
    background:#f59e0b;
}

.toast-info span{
    background:#2563eb;
}

@media(max-width:700px){
    #toastContainer{
        left:18px;
        right:18px;
        top:18px;
    }

    .toast{
        min-width:unset;
        width:100%;
    }
}
#commandOverlay{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.45);
    backdrop-filter:blur(8px);
    z-index:9998;
    display:none;
    align-items:flex-start;
    justify-content:center;
    padding-top:90px;
}

#commandOverlay.show{
    display:flex;
}

.command-box{
    width:min(620px, calc(100% - 32px));
    background:white;
    border-radius:24px;
    box-shadow:0 30px 80px rgba(15,23,42,.28);
    overflow:hidden;
    border:1px solid #e2e8f0;
}

.command-input-wrap{
    display:flex;
    align-items:center;
    gap:14px;
    padding:18px 20px;
    border-bottom:1px solid #e2e8f0;
}

.command-input-wrap span{
    width:34px;
    height:34px;
    border-radius:12px;
    background:#eff6ff;
    color:#2563eb;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
}

.command-input-wrap input{
    border:none;
    margin:0;
    padding:0;
    box-shadow:none;
    font-size:18px;
}

.command-input-wrap input:focus{
    box-shadow:none;
}

.command-input-wrap small{
    background:#f1f5f9;
    padding:6px 9px;
    border-radius:8px;
    color:#64748b;
    font-weight:800;
}

.command-results{
    padding:12px;
    max-height:420px;
    overflow:auto;
}

.command-item{
    width:100%;
    border:none;
    background:white;
    display:flex;
    align-items:center;
    gap:14px;
    padding:15px;
    border-radius:16px;
    cursor:pointer;
    font-weight:700;
    color:#0f172a;
    text-align:left;
}

.command-item:hover{
    background:#eff6ff;
}

.command-item i{
    width:20px;
    height:20px;
    color:#2563eb;
}

.assistant-toggle{
    position:fixed;
    right:26px;
    bottom:26px;
    width:64px;
    height:64px;
    border-radius:22px;
    border:none;
    background:linear-gradient(135deg,#2563eb,#0ea5e9);
    color:white;
    box-shadow:0 20px 45px rgba(37,99,235,.35);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    z-index:9997;
}

.assistant-toggle i{
    width:28px;
    height:28px;
}

.assistant-panel{
    position:fixed;
    right:26px;
    bottom:104px;
    width:380px;
    height:520px;
    background:white;
    border-radius:26px;
    box-shadow:0 30px 80px rgba(15,23,42,.28);
    border:1px solid #e2e8f0;
    overflow:hidden;
    display:none;
    flex-direction:column;
    z-index:9997;
}

.assistant-panel.show{
    display:flex;
}

.assistant-header{
    padding:18px 20px;
    background:linear-gradient(135deg,#2563eb,#0ea5e9);
    color:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.assistant-header p{
    margin:3px 0 0;
    opacity:.85;
    font-size:13px;
}

.assistant-header button{
    background:rgba(255,255,255,.18);
    border:none;
    color:white;
    width:34px;
    height:34px;
    border-radius:50%;
    font-size:22px;
    cursor:pointer;
}

.assistant-messages{
    flex:1;
    padding:18px;
    overflow:auto;
    background:#f8fafc;
}

.assistant-message{
    max-width:82%;
    padding:13px 15px;
    border-radius:18px;
    margin-bottom:12px;
    font-size:14px;
    line-height:1.45;
}

.assistant-message.bot{
    background:white;
    border:1px solid #e2e8f0;
    color:#0f172a;
}

.assistant-message.user{
    background:#2563eb;
    color:white;
    margin-left:auto;
}

.assistant-input{
    padding:14px;
    display:flex;
    gap:10px;
    border-top:1px solid #e2e8f0;
}

.assistant-input input{
    margin:0;
    flex:1;
}

.assistant-input button{
    width:48px;
    border:none;
    border-radius:14px;
    background:#2563eb;
    color:white;
    cursor:pointer;
}

@media(max-width:600px){
    .assistant-panel{
        left:16px;
        right:16px;
        width:auto;
        bottom:94px;
    }
}
.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.50);
    backdrop-filter:blur(8px);
    z-index:9999;
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    transition:.2s ease;
}

.modal-overlay.show{
    opacity:1;
}

.modal-box{
    width:min(460px, calc(100% - 32px));
    background:white;
    border-radius:26px;
    padding:30px;
    box-shadow:0 30px 90px rgba(15,23,42,.30);
    transform:scale(.96);
    transition:.2s ease;
}

.modal-overlay.show .modal-box{
    transform:scale(1);
}

.modal-box h2{
    margin:0 0 12px;
    font-size:26px;
}

.modal-box p{
    color:#64748b;
    line-height:1.6;
    margin-bottom:26px;
}

.modal-actions{
    display:flex;
    gap:12px;
    justify-content:flex-end;
}
.skeleton{
    position:relative;
    overflow:hidden;
    background:#e2e8f0;
    border-radius:14px;
}

.skeleton::after{
    content:"";
    position:absolute;
    inset:0;
    transform:translateX(-100%);
    background:linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.55),
        transparent
    );
    animation:skeleton-loading 1.3s infinite;
}

@keyframes skeleton-loading{
    100%{
        transform:translateX(100%);
    }
}

.skeleton-card{
    height:160px;
    border-radius:22px;
}

.skeleton-line{
    height:16px;
    margin-bottom:12px;
}

.skeleton-line.short{
    width:45%;
}

.skeleton-line.medium{
    width:70%;
}

.skeleton-line.long{
    width:100%;
}

.empty-state{
    padding:44px 28px;
    text-align:center;
    background:white;
    border:1px dashed #cbd5e1;
    border-radius:24px;
}

.empty-state-icon{
    width:64px;
    height:64px;
    margin:0 auto 18px;
    border-radius:22px;
    background:#eff6ff;
    color:#2563eb;
    display:flex;
    align-items:center;
    justify-content:center;
}

.empty-state-icon i{
    width:32px;
    height:32px;
}

.empty-state h3{
    font-size:22px;
    margin-bottom:8px;
}

.empty-state p{
    color:#64748b;
    line-height:1.6;
    margin-bottom:22px;
}