/* --- Core Variables & Reset --- */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --sidebar-width: 260px;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* --- Layout --- */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
}

.sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background-color: #e0e7ff;
    color: var(--primary);
}

.badge {
    background-color: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    margin-left: auto;
}

.sidebar-footer {
    margin-top: auto;
}

.upgrade-card {
    background: linear-gradient(135deg, #f3e8ff 0%, #e0e7ff 100%);
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

.upgrade-card h4 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.upgrade-card p { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1rem; }

.btn-upgrade {
    background: white;
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.user-info span { color: var(--text-muted); font-size: 0.75rem; }

/* --- Main Content --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-titles h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.header-titles p { color: var(--text-muted); font-size: 0.9rem; }

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-bar {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 250px;
    outline: none;
}

.search-bar:focus { border-color: var(--primary); }

.icon-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

/* Cards & Grids */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.kpi-header h3 { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }

.icon-bg {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.icon-bg.purple { background: #e0e7ff; color: var(--primary); }
.icon-bg.green { background: #d1fae5; color: var(--success); }
.icon-bg.orange { background: #ffedd5; color: var(--warning); }
.icon-bg.blue { background: #dbeafe; color: var(--info); }

.kpi-value { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.kpi-trend { font-size: 0.8rem; }
.kpi-trend.positive { color: var(--success); }
.kpi-trend.neutral { color: var(--text-muted); }

/* Middle Grid */
.middle-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card h3, .list-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.placeholder-chart {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.donut-placeholder {
    width: 150px; height: 150px;
    border: 15px solid #e2e8f0;
    border-top-color: var(--danger);
    border-right-color: var(--warning);
    border-bottom-color: var(--success);
    border-radius: 50%;
    margin: 0 auto;
}

.center-text { text-align: center; font-weight: bold; font-size: 1.5rem; }
.center-text span { font-size: 0.75rem; color: var(--text-muted); font-weight: normal; }

.view-link {
    display: block;
    text-align: right;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}
.center-link { text-align: center; margin-top: 1rem; }

.tool-list { list-style: none; }
.tool-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.5rem;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.badge-light {
    background: #f1f5f9; color: var(--text-muted);
    padding: 2px 8px; border-radius: 12px; font-size: 0.8rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table th { color: var(--text-muted); font-weight: 500; }

.tag {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
}
.tag-active { background: #d1fae5; color: #065f46; }
.tag-inactive { background: #f1f5f9; color: #475569; }
.tag-low { background: #dcfce7; color: #166534; }
.tag-medium { background: #fef3c7; color: #92400e; }
.tag-high { background: #fee2e2; color: #991b1b; }

.alert-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.alert-icon.red { color: var(--danger); }
.alert-icon.orange { color: var(--warning); }

.alert-text p { font-size: 0.85rem; margin-bottom: 0.25rem; }
.alert-text span { font-size: 0.75rem; color: var(--text-muted); }

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .middle-grid, .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dashboard-container { flex-direction: column; overflow-y: auto; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .main-content { overflow-y: visible; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .header-actions { width: 100%; flex-wrap: wrap; }
    .data-table { display: block; overflow-x: auto; }
}


/* --- New Icon & Image Layout Rules --- */

/* Sidebar Alignments */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
}
.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

/* Header Search Element Wrapper */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.search-wrapper .search-bar {
    padding-left: 2.25rem;
}

/* Brand Graphic Rules (Top Tools List) */
.tool-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Data Table Grid Components */
.agent-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.table-agent-icon {
    color: var(--text-muted);
    font-size: 1rem;
}
.table-icon-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.table-icon-group img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Layout Button Padding Standardization */
.btn-primary i, .btn-secondary i {
    margin-right: 4px;
}

/* ==========================================================================
   AI AGENTS WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

/* Split Area Workspace Master-Detail Config */
.agents-workspace-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Master Row Item Triggers */
.interactive-rows tbody tr {
    cursor: pointer;
    transition: background-color 0.2s, border-left 0.15s;
    border-left: 0px solid transparent;
}

.interactive-rows tbody tr:hover {
    background-color: #f8fafc;
}

/* Active Highlight Border Styling matching AgentOps theme */
.interactive-rows tbody tr.active-selection {
    background-color: #f0fdf4;
    border-left: 4px solid var(--primary);
}

/* Deep Dive Governance Inspection Panel Card Styles */
.detail-panel-card {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.detail-title-block h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.detail-title-block span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.panel-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

.detail-body-scroll {
    overflow-y: auto;
    padding-right: 4px;
}

/* Info Strip Metadata Blocks */
.meta-data-strip {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-pill {
    flex: 1;
    background-color: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 1rem;
    color: var(--text-main);
}

/* Internal Section Blocks */
.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

/* Connected Tools Item Badges */
.connected-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-badge-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tool-badge-item img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Operational Governance Action Dropdown Control */
.lifecycle-dropdown {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.lifecycle-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Audit Interaction Profiles */
.interaction-card {
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.interaction-actor {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.actor-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.actor-info {
    display: flex;
    flex-direction: column;
}

.actor-info strong {
    font-size: 0.85rem;
}

.actor-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.interaction-description {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
}

/* Access Log Timelines */
.access-logs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.access-logs-list li {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.log-time {
    font-family: monospace;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 1px;
}

.log-msg {
    color: var(--text-main);
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 1200px) {
    .agents-workspace-grid {
        grid-template-columns: 1fr;
    }
    .detail-panel-card {
        position: static;
        max-height: none;
    }
}

/* ==========================================================================
   ACCESS & PERMISSIONS WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

/* Main Multi-Column Split Framework */
.permissions-workspace-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Sidebar Item Switcher Layout */
.panel-header-inline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.panel-header-inline h3 {
    font-size: 1rem;
    font-weight: 700;
}

.search-wrapper.mini .search-bar {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    font-size: 0.85rem;
}

.search-wrapper.mini .search-icon {
    font-size: 0.8rem;
    left: 10px;
}

/* Agent Picker Row Options */
.agent-selection-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-picker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.agent-picker-item:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.agent-picker-item.selected {
    background-color: #f0fdf4;
    border-color: var(--success);
}

.picker-avatar {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.agent-picker-item.selected .picker-avatar {
    background-color: #d1fae5;
    color: #065f46;
}

.picker-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.picker-info strong {
    font-size: 0.85rem;
    color: var(--text-main);
}

.picker-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.permission-count-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    background-color: #f1f5f9;
    border-radius: 20px;
    color: var(--text-muted);
}

.agent-picker-item.selected .permission-count-tag {
    background-color: var(--success);
    color: #ffffff;
}

/* Right Matrix Container Groups */
.matrix-panel-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.matrix-card-section {
    padding: 1.5rem;
}

.section-title-wrapper {
    margin-bottom: 1.25rem;
}

.title-indicator-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.title-indicator-row h3 {
    font-size: 1rem;
    font-weight: 700;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.indicator-dot.green { background-color: var(--success); }
.indicator-dot.gray { background-color: #94a3b8; }

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Two-Column Internal App Cards Grid Layout */
.systems-entitlement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* Dynamic Integration Row Item Display Cards */
.permission-identity-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.permission-identity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.03);
}

.permission-identity-card img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.permission-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-grow: 1;
}

.permission-meta h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.permission-meta span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.permission-meta code {
    font-family: monospace;
    background-color: #f1f5f9;
    padding: 1px 4px;
    border-radius: 4px;
    color: #334155;
}

/* Interactive Direct-Action Trigger Buttons */
.btn-action-revoke, .btn-action-grant {
    border: 1px solid;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}

/* Revoke Button Aesthetics */
.btn-action-revoke {
    border-color: #fca5a5;
    background-color: #fef2f2;
    color: var(--danger);
}
.btn-action-revoke:hover {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

/* Grant Button Aesthetics */
.btn-action-grant {
    border-color: #c7d2fe;
    background-color: #f5f3ff;
    color: var(--primary);
}
.btn-action-grant:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Catalog Block Soft Adjustments */
.catalog-section {
    background-color: #fafafa;
}

.empty-state-notice {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* ==========================================================================
   RESPONSIVE LAYOUT RESPONSIVENESS OVERRIDES
   ========================================================================== */
@media (max-width: 992px) {
    .permissions-workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   RISK & ALERTS WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

/* Split Dashboard Layout */
.risk-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    align-items: start;
}

/* Text Utility Overrides */
.text-danger { color: var(--danger); font-weight: 500; }

/* Threat Feed List Styling */
.threat-feed-panel {
    display: flex;
    flex-direction: column;
}

.threat-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.threat-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    background-color: var(--bg-main);
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

/* Severity Indicator Borders */
.threat-item.critical {
    border-left-color: var(--danger);
    background-color: #fef2f2;
}

.threat-item.warning {
    border-left-color: var(--warning);
}

.threat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.threat-item.critical .threat-icon { background-color: #fee2e2; color: var(--danger); }
.threat-item.warning .threat-icon { background-color: #ffedd5; color: var(--warning); }

.threat-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.threat-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.threat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.threat-desc strong {
    color: var(--text-main);
}

.threat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Code Snippet styling for System Targeting in Tables */
.system-code {
    font-family: monospace;
    background-color: #f1f5f9;
    padding: 4px 6px;
    border-radius: 4px;
    color: #475569;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

/* Responsive Override for Risk Dashboard */
@media (max-width: 1200px) {
    .risk-split-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   APPROVALS WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

/* Main Master-Detail Layout */
.approvals-workspace-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* --- Queue Column (Left) --- */
.approval-queue-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.approval-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.approval-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Active State */
.approval-card.active {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Risk Level Borders */
.approval-card.critical { border-left-color: var(--danger); }
.approval-card.active.critical { background-color: #fef2f2; border-color: #fca5a5; }

.approval-card.elevated { border-left-color: var(--warning); }
.approval-card.active.elevated { background-color: #fffbeb; border-color: #fde68a; }

.approval-card.standard { border-left-color: var(--success); }
.approval-card.active.standard { background-color: #f0fdf4; border-color: #bbf7d0; }

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.req-id { color: var(--text-muted); font-family: monospace; }
.ttl-timer { display: flex; align-items: center; gap: 0.4rem; }

.card-main-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agent-avatar {
    width: 40px; height: 40px;
    background-color: #f1f5f9;
    color: var(--text-muted);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.req-details { flex-grow: 1; }
.req-details h4 { font-size: 0.95rem; color: var(--text-main); margin-bottom: 0.2rem; }
.req-details p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.req-details code { background: #f1f5f9; padding: 2px 4px; border-radius: 4px; font-family: monospace; color: #475569; }

/* --- Detail Inspection Panel (Right) --- */
.approval-detail-panel {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px); /* Keeps panel within viewport */
    padding: 0; /* Override default card padding to handle scrolling */
    overflow: hidden;
}

.detail-panel-header { padding: 1.5rem 1.5rem 0 1.5rem; display: flex; justify-content: space-between; align-items: flex-start; }
.detail-title-block h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.2rem; }
.detail-title-block span { font-size: 0.8rem; color: var(--text-muted); }

.detail-body-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
}

.context-grid { display: flex; flex-direction: column; gap: 1rem; background: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid var(--border); }
.context-item { display: flex; flex-direction: column; gap: 0.2rem; }
.context-label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; font-weight: 600; }
.context-value { font-size: 0.9rem; color: var(--text-main); }
.context-value code { background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.85rem;}
.italic { font-style: italic; color: #475569; }

/* Policy Violations */
.policy-alert {
    display: flex; gap: 0.75rem; padding: 1rem; border-radius: 8px; align-items: flex-start; margin-bottom: 1rem;
}
.policy-alert.danger { background-color: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.policy-alert i { font-size: 1.2rem; margin-top: 0.1rem; }
.policy-alert strong { display: block; font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--danger); }
.policy-alert p { font-size: 0.85rem; line-height: 1.4; margin: 0; }

.impact-assessment h5 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; }
.impact-assessment ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.impact-assessment li { font-size: 0.85rem; display: flex; gap: 0.5rem; align-items: center; color: var(--text-main); }

/* Forms & Toggles */
.jit-toggle-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.form-select { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; outline: none; margin-top: 0.5rem; }
.form-select:focus { border-color: var(--primary); }

/* Action Footer */
.action-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background-color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-right-group { display: flex; gap: 0.75rem; }

.btn-action-deny, .btn-action-neutral, .btn-action-approve {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem;
    transition: all 0.2s;
    border: none;
}

.btn-action-deny { background-color: #fee2e2; color: var(--danger); border: 1px solid transparent; }
.btn-action-deny:hover { background-color: var(--danger); color: white; }

.btn-action-neutral { background-color: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-action-neutral:hover { background-color: #f1f5f9; }

.btn-action-approve { background-color: var(--success); color: white; box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2); }
.btn-action-approve:hover { background-color: #059669; }

/* Typography Utilities */
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.mt-2 { margin-top: 0.5rem; }

/* Responsive */
@media (max-width: 1024px) {
    .approvals-workspace-grid { grid-template-columns: 1fr; }
    .approval-detail-panel { position: static; height: auto; border: 1px solid var(--border); }
}


/* --- Force Square Logo to Fit Sidebar --- */
.sidebar-header {
    display: block !important;       /* Overrides existing flex alignment layout constraints */
    width: 100% !important;
    margin-bottom: 2rem;
    padding: 0;
}

.sidebar-header img,
.site-logo {
    display: block !important;
    width: 130px !important;         /* Shrinks the large square down to a crisp sidebar size */
    height: 130px !important;        /* Maintains the exact square aspect ratio of your image */
    object-fit: contain !important;  /* Ensures the artwork scales perfectly inside the box without clipping */
    margin: 0 auto 0 0;              /* Aligns it perfectly to the left of the sidebar panel */
}

.sidebar {
    width: var(--sidebar-width);
    background-color: #0b1121; /* Matches the dark navy background of the Athena logo */
    border-right: 1px solid #1e293b; /* Darkened border to blend with the dark theme */
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #ffffff; /* Forces text and icons to be white */
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}


.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1); /* Soft translucent white hover */
    color: #ffffff; /* Keeps text and icons white on hover */
}

.sidebar-header img,
.site-logo {
    display: block !important;
    width: 130px !important;         
    height: 130px !important;        
    object-fit: contain !important;  
    margin: 0 auto !important;       /* This automatically centers the block element */
}

/* --- Brand Tagline Styling --- */
.brand-tagline {
    text-align: center;
    font-size: 0.75rem;          /* Keeps it sleek and professional */
    color: #94a3b8;              /* Muted slate color for the dark theme */
    margin-top: 1rem;            /* Gives a little breathing room below the owl */
    font-weight: 500;
    letter-spacing: 0.03em;      /* Adds a slight premium kerning to the tagline */
    line-height: 1.4;
}

/* --- Policy Page UI Enhancements --- */

/* Ensures the dropdown and button share the same height and padding */
.table-actions .btn-secondary, 
.table-actions select.btn-secondary {
    height: 40px; /* Adjust if your existing buttons have a different height */
    padding: 0 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.table-actions .btn-secondary:hover {
    background: #f1f5f9;
}

/* Custom styling for the select dropdown */
.dropdown-wrapper select {
    appearance: none; /* Removes default browser arrows */
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 35px !important; /* Space for the icon */
    background: white;
}

/* Icons within table for Manage column */
.manage-btns {
    display: flex;
    gap: 12px;
}

.manage-btns button {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 1rem;
    transition: color 0.2s;
}

.manage-btns button:hover {
    color: #2563eb;
}

/* Remove underline from all links */
a {
    text-decoration: none;
    color: inherit; /* Keeps the color consistent with surrounding text */
}

/* Remove default browser focus highlights/outlines */
a:focus, 
a:active {
    outline: none;
    box-shadow: none;
}

/* Optional: Ensure buttons that are wrapped in <a> tags also don't get forced styles */
a button {
    text-decoration: none;
    outline: none;
}

/* --- Namespaced Integration Modal Styles --- */

.athena-modal-overlay {
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.5); 
    align-items: center; 
    justify-content: center; 
    z-index: 1000; 
    overflow-y: auto;
}

.athena-modal-card {
    background: white;
    width: 100%; 
    max-width: 600px; 
    padding: 2rem; 
    margin: 20px;
    border-radius: 8px;
}

.athena-modal-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1.5rem;
}

.athena-close-btn {
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 1.5rem;
}

.athena-service-grid {
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 1rem;
}

.athena-service-option {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 15px; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s;
}

.athena-service-option:hover {
    border-color: #2563eb; 
    background: #f8fafc;
}

.athena-service-option img {
    width: 48px; 
    height: 48px; 
    margin-bottom: 8px;
}


/* ==========================================================================
   TOOLS & INTEGRATIONS WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.card-icon-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon-header img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.card-icon-header h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.integration-grid p {
    color: var(--text-muted);
    font-size: 0.95rem;
    min-height: 44px;
    margin-bottom: 1.5rem;
}

/* Generic Secondary Button (if not globally defined) */
.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

/* --- Connection Modal Styles --- */
.athena-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.athena-modal-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.athena-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.athena-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: 0.2s;
}

.athena-close-btn:hover {
    color: var(--text-main);
}

.athena-service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.athena-service-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    color: var(--text-main);
}

.athena-service-option:hover {
    border-color: var(--primary);
    background: #e0e7ff; /* Matches your active hover state */
    transform: translateY(-2px);
}

.athena-service-option img {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    object-fit: contain;
}

/* ==========================================================================
   PERMISSIONS MODAL STYLING (Append to style.css)
   ========================================================================== */

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc; /* Matches your --bg-main */
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: 0.2s;
}

.permission-item:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.perm-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.perm-icon-wrapper.granted { 
    background: #d1fae5; 
    color: #059669; 
}

.perm-icon-wrapper.denied { 
    background: #fee2e2; 
    color: #dc2626; 
}

.perm-details {
    display: flex;
    flex-direction: column;
}

.perm-details h5 { 
    font-size: 0.9rem; 
    margin-bottom: 0.2rem; 
    color: var(--text-main); 
}

.perm-details p { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    margin: 0; 
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

/* /*

/* ==========================================================================
   TOOLS LIBRARY WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

/* Filter Bar */
.tool-filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-pill {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* Tool Catalog Grid */
.tool-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.tool-catalog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-catalog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.tool-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.tool-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-app-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid var(--border);
}

.tool-identity h4 {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.tool-identity span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-catalog-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Assigned Agents Avatar Stack */
.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.avatar-stack-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.avatar-stack-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

.stack-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    background-color: #e2e8f0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: -8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stack-avatar:first-child {
    margin-left: 0;
}

/* Specific colors for specific agent avatars to make it pop */
.stack-avatar.legal { background-color: #dbeafe; color: #1e40af; }
.stack-avatar.hr { background-color: #fce7f3; color: #9d174d; }
.stack-avatar.ops { background-color: #dcfce7; color: #166534; }
.stack-avatar.more { background-color: #f1f5f9; color: var(--text-muted); font-size: 0.7rem; }


/* ==========================================================================
   SLIDE-OUT DRAWER & TOGGLES (Append to style.css)
   ========================================================================== */

/* Drawer Overlay */
.athena-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.athena-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* The Drawer Panel */
.athena-drawer {
    position: fixed;
    top: 0;
    right: -450px; /* Hidden off-screen initially */
    width: 450px;
    max-width: 100%;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.athena-drawer.open {
    right: 0; /* Slide in */
}

/* Drawer Internal Layout */
.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #f8fafc;
}

.drawer-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #ffffff;
}

/* Form Groups & Sections */
.config-section {
    margin-bottom: 2rem;
}

.config-section h3 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: var(--primary);
}

/* Custom UI Toggle Switch */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.toggle-info h4 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.toggle-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   REPORT WORKSPACE STYLING (Append to style.css)
   ========================================================================== */

/* Layout Grid for Report Sections */
.report-split-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
}

/* Specific alignment for the Remediation Buttons in reports */
.report-action-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

/* Ensure data-table rows don't stretch awkwardly in report cards */
.report-split-grid .data-table th, 
.report-split-grid .data-table td {
    padding: 0.85rem 0.5rem;
}

/* Add a hover effect to the KPI cards on the report page for interactivity */
.kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Override utility for warning trends in KPI */
.kpi-trend.warning {
    color: var(--warning);
}

/* Responsive collapse for reports */
@media (max-width: 1200px) {
    .report-split-grid {
        grid-template-columns: 1fr;
    }
}
















