/**
 * License Compliance Dashboard & Cost Analysis Styles
 * (c) Adrian Ranta. All rights reserved. Unauthorised use, reproduction and or distribution is strictly prohibited.
 */

/* ===== License View Toggle (List / Compliance / Cost Analysis) ===== */
.license-view-toggle {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    margin-left: 8px;
}

.license-view-toggle .toggle-btn {
    padding: 6px 14px;
    border: none;
    background: #f8f9fa;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.license-view-toggle .toggle-btn:hover {
    background: #e9ecef;
}

.license-view-toggle .toggle-btn.active {
    background: #667eea;
    color: #fff;
}

/* ===== Compliance Summary Cards ===== */
.compliance-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.compliance-card {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    text-align: center;
}

.compliance-card .card-count {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.compliance-card .card-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.compliance-card .card-sublabel {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.compliance-card.card-compliant .card-count { color: #16a34a; }
.compliance-card.card-over .card-count { color: #ef4444; }
.compliance-card.card-under .card-count { color: #f59e0b; }
.compliance-card.card-total .card-count { color: #3b82f6; }

/* ===== Compliance & Cost Tables ===== */
.compliance-table-wrap,
.cost-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.compliance-table,
.cost-analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.compliance-table th,
.compliance-table td,
.cost-analysis-table th,
.cost-analysis-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.compliance-table th,
.cost-analysis-table th {
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.compliance-table tr:hover,
.cost-analysis-table tr:hover {
    background: #f8fafc;
}

/* Status pills for compliance */
.compliance-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.compliance-pill.pill-over {
    background: #fef2f2;
    color: #dc2626;
}

.compliance-pill.pill-under {
    background: #fffbeb;
    color: #d97706;
}

.compliance-pill.pill-compliant {
    background: #f0fdf4;
    color: #16a34a;
}

/* Utilization bar (inline) */
.util-bar-track {
    display: inline-block;
    width: 80px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}

.util-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.util-bar-fill.fill-good { background: #16a34a; }
.util-bar-fill.fill-warning { background: #f59e0b; }
.util-bar-fill.fill-danger { background: #ef4444; }

/* ===== Cost Analysis ===== */
.cost-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.cost-card {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    text-align: center;
}

.cost-card .card-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.cost-card .card-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

/* Collapsible sections */
.cost-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    margin-bottom: 16px;
}

.cost-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.cost-section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.cost-section-toggle {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.cost-section-toggle.collapsed {
    transform: rotate(-90deg);
}

.cost-section-body {
    margin-top: 16px;
}

.cost-section-body.hidden {
    display: none;
}

/* Bar chart items (reuse dashboardCharts pattern) */
.cost-bar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cost-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cost-bar-label {
    flex: 0 0 140px;
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cost-bar-track {
    flex: 1;
    height: 14px;
    background: #f1f5f9;
    border-radius: 7px;
    overflow: hidden;
}

.cost-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.cost-bar-value {
    flex: 0 0 90px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

/* Renewal forecast items */
.renewal-forecast {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.renewal-bucket {
    flex: 1;
    min-width: 140px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.renewal-bucket .bucket-period {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.renewal-bucket .bucket-count {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.renewal-bucket .bucket-cost {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-top: 4px;
}

/* No data state */
.compliance-no-data,
.cost-no-data {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 14px;
}
