/* app_license_dashboard.css - Modern Overhaul */

:root {
    --dash-bg: #f5f6f8;
    --card-bg: #ffffff;
    --text-main: #1a1b1e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    
    --blue-base: #3b82f6;
    --blue-light: #eff6ff;
    --green-base: #10b981;
    --green-light: #ecfdf5;
    --purple-base: #8b5cf6;
    --purple-light: #f5f3ff;
    --orange-base: #f97316;
    --orange-light: #fff7ed;
    --red-base: #ef4444;
    --red-light: #fef2f2;
    --grey-base: #6b7280;
    --grey-light: #f3f4f6;
    
    --teal-base: #0ea5e9;
    --green-dark: #059669;
}

.license-dashboard-container {
    padding: 24px 32px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--dash-bg);
    min-height: 100vh;
    color: var(--text-main);
}

/* Header */
.license-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.license-header-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.license-header-title p {
    font-size: 14px;
    margin: 0;
    color: var(--text-muted);
}

.license-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-filter-btn {
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.dash-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 4px 16px 4px 4px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.dash-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-base);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* KPI Cards Row */
.kpi-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.kpi-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 20px;
    height: 20px;
}

/* Colors */
.kpi-icon.blue { background: var(--blue-light); color: var(--blue-base); }
.kpi-icon.green { background: var(--green-light); color: var(--green-base); }
.kpi-icon.purple { background: var(--purple-light); color: var(--purple-base); }
.kpi-icon.orange { background: var(--orange-light); color: var(--orange-base); }
.kpi-icon.red { background: var(--red-light); color: var(--red-base); }
.kpi-icon.grey { background: var(--grey-light); color: var(--grey-base); }

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin: 4px 0;
    line-height: 1;
}

.kpi-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.kpi-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.up { color: var(--green-base); }
.kpi-trend.down { color: var(--red-base); }
.kpi-trend.neutral { color: var(--grey-base); }
.kpi-trend-text { color: var(--text-muted); font-weight: 400; }

/* Large Green KPI Card */
.kpi-card.snapshot {
    background: var(--green-dark);
    color: #fff;
    min-width: 220px;
}

.kpi-card.snapshot .kpi-icon {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.kpi-card.snapshot .kpi-icon svg { width: 14px; height: 14px; }
.kpi-card.snapshot .kpi-title { color: #fff; font-size: 14px;}
.kpi-card.snapshot .kpi-value { color: #fff; font-size: 42px; margin-top: 10px;}
.kpi-card.snapshot .kpi-subtitle { color: rgba(255,255,255,0.8); font-size: 13px; margin-bottom:0;}
.kpi-card.snapshot .kpi-trend { color: #fff;}

/* Grid Layouts */
.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.dash-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dash-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

.dash-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dash-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.dash-link {
    font-size: 13px;
    color: var(--blue-base);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.dash-link:hover { text-decoration: underline; }

/* Custom Lists / Tables */
.rule-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.rule-item:last-child { border-bottom: none; padding-bottom: 0; }

.rule-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rule-icon.green { background: var(--green-light); color: var(--green-base); }
.rule-icon.orange { background: var(--orange-light); color: var(--orange-base); }
.rule-icon.blue { background: var(--blue-light); color: var(--blue-base); }
.rule-icon.red { background: var(--red-light); color: var(--red-base); }

.rule-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}
.rule-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Basic Tables */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dash-table th {
    text-align: left;
    padding: 12px 8px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.dash-table td {
    padding: 14px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.dash-table tr:last-child td {
    border-bottom: none;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.app-brand img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

/* Progress bar inside table */
.cov-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cov-progress-val {
    font-weight: 600;
    font-size: 12px;
    width: 35px;
}
.cov-progress-bg {
    flex: 1;
    height: 6px;
    background: var(--grey-light);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}
.cov-progress-fill {
    height: 100%;
    background: var(--green-base);
}
.cov-progress-fill.warning { background: var(--orange-base); }
.cov-progress-fill.danger { background: var(--red-base); }

/* Horizontal Bar chart mimic */
.horiz-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}
.horiz-bar-label {
    width: 120px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.horiz-bar-track {
    flex: 1;
    height: 12px;
    background: transparent;
    border-radius: 6px;
    margin: 0 12px;
}
.horiz-bar-fill {
    height: 100%;
    background: var(--blue-base);
    border-radius: 6px;
}
.horiz-bar-val {
    width: 50px;
    text-align: right;
    font-weight: 600;
}

/* Alert Item */
.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; padding-bottom: 0;}
.alert-left {
    display: flex;
    gap: 12px;
}
.alert-right {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}
.chart-container-tall {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 1200px) {
    .dash-grid-3 { grid-template-columns: 1fr; }
    .dash-grid-2-1 { grid-template-columns: 1fr; }
}

/* Minimal styling for overlay modal if needed */
.overlay-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.overlay-content {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}
