/* SALES MODULE SPECIFIC STYLES */

/* KPI CARDS ENHANCEMENT */
.kpi-fat-card {
    flex: 2;
    justify-content: space-between;
    padding: 10px 20px;
}

.k-main-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* TURNOVER BREAKDOWN (V_01) */
.v01-mini-list {
    display: flex;
    flex-direction: column;
    border-left: 2px solid #222;
    padding-left: 25px;
    min-width: 250px;
    height: 100%;
    justify-content: space-around;
}

.v01-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.v01-year { 
    color: #444; 
    font-weight: 900; 
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.v01-val { 
    color: #fff; 
    font-weight: 900; 
    font-size: 19px;
    letter-spacing: -0.5px;
}

.v01-delta {
    font-size: 11px;
    font-weight: 900;
    width: 65px;
    text-align: right;
    display: inline-block;
}

/* SALES TABLES (V_06_1, V_06_2, V_05_1) */
.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 0 5px;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 13px;
    opacity: 0.7;
    pointer-events: none;
}

.table-search {
    width: 100%;
    background: #000;
    border: 1px solid #222;
    color: #fff;
    padding: 12px 16px 12px 40px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 0;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.table-search:focus {
    border-color: var(--primary);
    background: #050505;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.1), inset 0 2px 4px rgba(0,0,0,0.5);
}

.table-search::placeholder {
    color: #444;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Highlight search matches */
mark {
    background: rgba(255, 204, 0, 0.3);
    color: #fff;
    border-radius: 2px;
    padding: 0 2px;
}

.table-total {
    background: rgba(255, 204, 0, 0.08);
    border: 1px solid rgba(255, 204, 0, 0.3);
    color: var(--primary);
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 16px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-total .label {
    font-size: 10px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* UI Table Base */
.ui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    text-align: left;
    table-layout: fixed;
}

.ui-table th {
    background: #000;
    color: var(--primary);
    padding: 10px 8px;
    border-bottom: 1px solid #222;
    font-weight: 900;
    position: sticky;
    top: 0;
    z-index: 2;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-table th:hover { background: #111; }

.ui-table td {
    padding: 8px;
    border-bottom: 1px solid #111;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-table td.num { text-align: center; }
.ui-table td.currency { text-align: right; font-family: monospace; }
.ui-table tr:hover td {
    background: rgba(255, 204, 0, 0.05);
    color: #fff;
}

.table-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 #000;
    min-height: 0;
    max-height: 480px;
}

/* Sales Column Specifics */
.col-date { width: 110px !important; }
.col-small-num { width: 85px !important; text-align: center !important; }
.col-currency { width: 120px !important; text-align: right !important; }
.col-commessa { width: 160px !important; color: var(--primary) !important; font-weight: 700; }
.col-cliente { width: 190px !important; }
.col-articolo { width: 230px !important; }

/* Drill-down filter note */
.filter-note {
    color: #fff;
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-size: 10px;
}

/* Sales Drill-down Table Container */
.v05-detail-container {
    margin-top: 15px;
    border-top: 1px solid #222;
    padding-top: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}
