:root {
    /* Colors based on Simple Storage Solutions brand & design */
    --ink: #0f172a;
    --dark-surface: #1e293b;
    --darker-surface: #0b1120;
    --paper: #faf9f6;
    --accent: #e63946;
    /* Adjusted to a brand-fitting Red/orange */
    --accent-glow: rgba(230, 57, 70, 0.15);
    --teal: #1d3557;
    /* Adjusted to a brand-fitting Deep Blue */
    --teal-glow: rgba(29, 53, 87, 0.3);
    --purple: #457b9d;
    /* Adjusted to a brand-fitting Lighter Blue */
    --purple-glow: rgba(69, 123, 157, 0.2);
    --slate: #475569;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;

    font-family: 'Outfit',
        sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--darker-surface);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

h1,
h2,
h3,
h4,
.brand-se {
    font-family: 'Fraunces', serif;
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--ink);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.sidebar-brand {
    padding: 0 1.5rem 2rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-se {
    color: var(--purple);
}

.brand-ai {
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item a:hover,
.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active a {
    color: var(--accent);
    background-color: var(--accent-glow);
    border-left: 3px solid var(--accent);
}

.sidebar-status {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}


/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Header */
.top-header {
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.header-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-bar {
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 300px;
    transition: border-color 0.3s;
}

.search-bar:focus-within {
    border-color: var(--purple);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-family: inherit;
}

.notification-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.notification-btn:hover {
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: 700;
}

.badge.purple {
    background: var(--purple);
    top: auto;
    right: auto;
    position: static;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Grid Layout */
.content-grid {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* KPIs */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.kpi-card {
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.kpi-icon.orange {
    background: var(--accent-glow);
    color: var(--accent);
}

.kpi-icon.purple {
    background: var(--purple-glow);
    color: var(--purple);
}

.kpi-icon.teal {
    background: var(--teal-glow);
    color: var(--teal);
}

.kpi-details h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: 'Outfit';
    font-weight: 500;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.3rem 0;
}

.kpi-value .sub-text {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.kpi-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kpi-trend.up {
    color: #10b981;
}

.kpi-trend.neutral {
    color: var(--text-muted);
}

/* Main Columns */
.main-columns {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
}

/* Panels */
.panel {
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.panel-header h2 {
    font-size: 1.1rem;
}

.btn-small {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* Agent Grid */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.agent-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s;
}

.agent-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.agent-card .agent-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.agent-card.active .agent-icon {
    color: var(--purple);
}

.agent-card.active-pulse .agent-icon {
    color: var(--accent);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
}

.agent-card.active .status-dot {
    background: #10b981;
}

.agent-card.active-pulse .status-dot {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(232, 93, 38, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(232, 93, 38, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(232, 93, 38, 0);
    }
}

.agent-card h4 {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.agent-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.activity-feed::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
    background: transparent;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.feed-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

.feed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feed-icon.blue {
    background: rgba(37, 99, 235, 0.15);
    color: #3b82f6;
}

.feed-icon.orange {
    background: var(--accent-glow);
    color: var(--accent);
}

.feed-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.feed-content h4 {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}

.feed-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.feed-time {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.3rem;
    display: block;
}


/* Manager AI Chat */
.ai-chat-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.ai-chat-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--accent));
}

.ai-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ai-title i {
    color: var(--purple);
    font-size: 1.2rem;
}

.ai-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}


.message {
    display: flex;
    gap: 0.8rem;
    max-width: 90%;
}

.message.ai-message {
    align-self: flex-start;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.message .ai-avatar {
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.4);
}

.msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid var(--border);
}

.message.ai-message .msg-bubble {
    border-top-left-radius: 2px;
}

.message.user-message .msg-bubble {
    border-top-right-radius: 2px;
    background: var(--purple-glow);
    border-color: rgba(124, 58, 237, 0.3);
}

.msg-bubble .action-btn {
    display: inline-block;
    background: var(--purple);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.msg-bubble .action-btn:hover {
    background: #6d28d9;
}


.ai-chat-input {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.ai-chat-input input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.3s;
}

.ai-chat-input input:focus {
    border-color: var(--purple);
}

.ai-chat-input button {
    background: var(--purple);
    color: white;
    border: none;
    width: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.ai-chat-input button:hover {
    background: #6d28d9;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
    .main-columns {
        grid-template-columns: 1fr;
    }

    .ai-chat-panel {
        height: 500px;
    }
}