/* 
   ServiceNow-like Theme Variables 
   - Clean, enterprise, data-dense
*/
:root {
    /* Colors */
    --bg-app: #f5f5f5;
    --bg-header: #293e40;
    /* Deep Teal/Slate - ServiceNow-ish Dark Header */
    --bg-sidebar: #303a46;
    --bg-content: #ffffff;
    --bg-hover: #f7fafc;

    --text-primary: #1d2125;
    --text-secondary: #5e6c84;
    --text-on-dark: #ffffff;

    --primary-color: #1f8476;
    /* ServiceNow Green/Teal accent */
    --secondary-color: #3b424b;
    --border-color: #dfe1e6;

    /* Status Colors */
    --status-success-bg: #e3fcef;
    --status-success-text: #006644;
    --status-warning-bg: #fffae6;
    --status-warning-text: #bf2600;
    /* Actually red-orange in some palettes, let's go standard orange */
    --status-error-bg: #ffebe6;
    --status-error-text: #de350b;

    /* Sizing */
    --header-height: 50px;
    --sidebar-width: 50px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-size: 13px;
    /* Enterprise apps often use smaller fonts for data density */
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-header);
    color: var(--text-on-dark);
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 10;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.context-picker {
    display: flex;
    align-items: center;
    font-size: 13px;
    opacity: 0.9;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.context-picker:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Global Search */
.global-search {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    width: 300px;
    border: 1px solid transparent;
}

.global-search:focus-within {
    background-color: #fff;
    border-color: var(--primary-color);
}

.global-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-on-dark);
    margin-left: 8px;
    width: 100%;
    font-size: 13px;
}

.global-search:focus-within input {
    color: var(--text-primary);
}

.global-search .search-icon {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.global-search:focus-within .search-icon {
    color: var(--text-secondary);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-profile .avatar {
    width: 28px;
    height: 28px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

/* Workspace */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}


:root {
    /* ... existing vars ... */
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 60px;
    /* Bit wider for comfort */
}

/* ... */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 0;
    z-index: 50;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed h1 {
    display: none;
}

/* Tooltip for nav text when collapsed */
.sidebar.collapsed .nav-item {
    position: relative;
    overflow: visible; 
}

.sidebar.collapsed .nav-text {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--secondary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 100;
}

.sidebar.collapsed .nav-text::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 5px 5px 0;
    border-style: solid;
    border-color: transparent var(--secondary-color) transparent transparent;
}

.sidebar.collapsed .nav-item:hover .nav-text {
    opacity: 1;
    visibility: visible;
}

.nav-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 12px;
    transition: background-color 0.2s, color 0.2s, border-left 0.2s;
    white-space: nowrap;
    height: 48px;
    position: relative;
    flex-shrink: 0;
}

.nav-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item .material-symbols-outlined {
    min-width: 24px;
    /* Ensure icon doesn't shrink */
    margin-right: 12px;
    /* Space between icon and text */
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--primary-color);
}

/* Content Area */
.content-area {
    flex: 1;
    background-color: var(--bg-app);
    overflow: auto;
    padding: 16px;
}

.list-view-container {
    background-color: var(--bg-content);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Toolbar */
.list-toolbar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-title {
    font-size: 18px;
    font-weight: 600;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-right {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.1s;
}

.action-btn.primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.action-btn.primary:hover {
    background-color: #176b60;
}

.action-btn.secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.action-btn.secondary:hover {
    background-color: var(--bg-hover);
}

.action-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Filter Bar */
.filter-bar {
    padding: 8px 16px;
    background-color: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
    display: none;
    /* Hidden by default */
    align-items: center;
    gap: 8px;
}

.filter-bar.visible {
    display: flex;
    /* Show when visible class is added */
}

.action-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    min-width: 150px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Data Grid */
.data-grid-wrapper {
    flex: 1;
    overflow: auto;
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
}

.data-grid th {
    background-color: #fafbfb;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    font-size: 12px;
    white-space: nowrap;
}

.data-grid th.sortable {
    cursor: pointer;
}

.data-grid th.sortable:hover {
    background-color: #f0f2f5;
}

.data-grid td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-grid tr:hover td {
    background-color: #f0f7ff;
    /* Typically light blue hover in enterprise apps */
}

.clickable-cell {
    cursor: pointer;
}

.clickable-cell:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Status Badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 11px;
}

.status-compatible {
    background-color: var(--status-success-bg);
    color: var(--status-success-text);
}

.status-incompatible {
    background-color: var(--status-error-bg);
    color: var(--status-error-text);
}

.status-conditional {
    background-color: var(--status-warning-bg);
    color: #b7791f;
}

/* Pagination */
.pagination-bar {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    background-color: #fafbfb;
}

.pagination-controls button {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Grouped View Styles */
.grouped-view-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Breadcrumbs */
.drilldown-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--primary-color);
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    cursor: default;
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Card Grids */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.drilldown-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.drilldown-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
    background: var(--bg-hover);
    padding: 12px;
    border-radius: 50%;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Traffic Light View */
.traffic-light-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.os-button {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    /* Maybe not clickable if it just shows status, but looks interactive */
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s;
}

.os-button:hover {
    transform: scale(1.02);
}

/* Traffic Light Colors */
.os-compatible {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.os-incompatible {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.os-conditional {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

.os-icon {
    font-size: 24px;
}

/* Detail View Layout */
.version-detail-container {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 24px;
}

.version-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.version-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.version-meta {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Windows Updates Grid */
.updates-section-title {
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.updates-columns-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

.update-group-col {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.update-group-header {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.update-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s;
}

.update-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.update-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.kb-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
}

.update-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

.criticality-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.crit-security {
    background: #e0f2fe;
    color: #0369a1;
}

.crit-critical {
    background: #fee2e2;
    color: #991b1b;
}

.crit-rollup {
    background: #f3f4f6;
    color: #4b5563;
}

.crit-feature {
    background: #fefce8;
    color: #854d0e;
}

.os-button.active {
    box-shadow: 0 0 0 2px var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* This overrides previous shadow, need to combine */
}

.vendor-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.vendor-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.vendor-header .material-symbols-outlined {
    color: var(--text-secondary);
}

.product-group {
    border-bottom: 1px solid var(--border-color);
}

.product-group:last-child {
    border-bottom: none;
}

.product-summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-summary:hover {
    background-color: var(--bg-hover);
}

.product-details {
    padding: 0 16px 16px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.compliance-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    background: #fff;
    font-size: 12px;
}

.compliance-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.compliance-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.compliance-info-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.meta-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 13px;
    margin-top: 10px;
}

.detail-item {
    display: flex;
    gap: 8px;
}