:root {
    --bg-color: #0f111a;
    --panel-bg: rgba(26, 29, 41, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --font-family: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.1), transparent 40%);
    background-attachment: fixed;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.text-green { color: var(--accent-green); }
.text-orange { color: var(--accent-orange); }

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 17, 26, 0.8);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    backdrop-filter: blur(20px);
    transition: width var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
}

.brand-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    transition: opacity var(--transition), transform var(--transition);
}

.sidebar.collapsed .brand-info {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
    position: absolute;
    right: 16px;
}

.sidebar.collapsed .sidebar-toggle {
    right: 50%;
    transform: translateX(50%) rotate(180deg);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4));
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-version {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0;
    opacity: 0.8;
}

/* Side Column Layout */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Todo List Styles */
.todo-section {
    padding: 24px;
}

.todo-count {
    font-size: 12px;
    color: var(--text-muted);
}

.todo-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.todo-input-container input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.todo-input-container input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

#add-todo-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#add-todo-btn:hover {
    background: var(--accent-blue-hover);
    transform: scale(1.05);
}

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.todo-list::-webkit-scrollbar {
    width: 4px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 10px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: var(--transition);
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--panel-border);
}

.todo-item.completed {
    opacity: 0.5;
}

.todo-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--panel-border);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.todo-checkbox:checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.todo-checkbox:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.todo-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
}

.delete-todo-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    padding: 4px;
}

.todo-item:hover .delete-todo-btn {
    opacity: 1;
}

.delete-todo-btn:hover {
    color: var(--accent-red);
}

.nav-links li a span {
    transition: opacity var(--transition), transform var(--transition);
    white-space: nowrap;
}

.sidebar.collapsed .nav-links li a span {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
}

.sidebar.collapsed .nav-links li a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-links li a i {
    font-size: 20px;
    margin: 0;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 10px;
    transition: var(--transition);
}

.nav-links li a:hover, .nav-links li.active a {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.nav-links li.active a {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), transparent);
    border-left: 3px solid var(--accent-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Nav */
.top-nav {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(15, 17, 26, 0.5);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 8px 16px;
    width: 400px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 100%;
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notifications {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.notifications:hover {
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    cursor: pointer;
}

/* Dashboard Content */
.dashboard-content {
    padding: 40px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

.stat-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-value .text-sm {
    font-size: 16px;
    color: var(--text-muted);
}

.stat-trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.positive { color: var(--accent-green); }
.stat-trend.negative { color: var(--accent-red); }
.stat-trend.neutral { color: var(--text-muted); }

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Table Section */
.table-section {
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    transition: margin-bottom var(--transition);
}

.collapsible-panel.collapsed .section-header {
    margin-bottom: 0;
}

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

.panel-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.panel-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.collapsible-panel.collapsed .panel-toggle-btn {
    transform: rotate(180deg);
}

.panel-content {
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 1;
}

.collapsible-panel.collapsed .panel-content {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.table-filters {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
    font-family: inherit;
}

.btn-primary:hover {
    opacity: 0.9;
}

.table-responsive {
    overflow-x: auto;
}

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

.team-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--panel-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.team-table th.sortable:hover {
    color: var(--accent-blue);
}

.team-table th.sortable i {
    margin-left: 5px;
    font-size: 11px;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
}

.team-table th.sortable:hover i {
    opacity: 0.7;
}

.team-table th.sortable.active {
    color: var(--accent-blue);
}

.team-table th.sortable.active i {
    opacity: 1;
}

.team-table th.sortable.asc i {
    transform: rotate(180deg);
}

.team-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.team-table tbody tr {
    transition: background 0.2s;
}

.team-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.member-details h4 {
    font-size: 14px;
    font-weight: 500;
}

.member-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.project-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-block;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge i { font-size: 10px; }

.status-working {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-idle {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Multi-agent entries */
.agents-container, .credits-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-entry {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    min-width: 100px;
}

.agent-credit-entry {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 28px;
}

/* Credits Bar */
.credits-bar-container {
    width: 140px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.credits-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
    position: relative;
    overflow: hidden;
}

.bar-label {
    font-size: 10px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.85);
    letter-spacing: 0.8px;
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
}

.projects-history-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-history-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.project-idle {
    font-size: 10px;
    color: var(--text-muted);
}

.credits-text {
    font-size: 12px;
    color: var(--text-muted);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
    padding: 4px 8px;
}

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

.last-seen-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.last-seen-text {
    font-size: 13px;
    color: var(--text-muted);
}

.quota-refresh-info {
    margin-top: 6px;
    font-size: 10px;
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.action-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--panel-bg);
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-content.show {
    display: block;
}

/* Activity Feed */
.activity-feed {
    padding: 24px;
    height: 100%;
}

.activity-feed h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
}

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    gap: 16px;
    position: relative;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: -20px;
    width: 2px;
    background: var(--panel-border);
}

.activity-item:last-child::before {
    display: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    z-index: 1;
}

.icon-blue { color: var(--accent-blue); background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3);}
.icon-green { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3);}
.icon-orange { color: var(--accent-orange); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3);}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 14px;
    line-height: 1.5;
}

.activity-content strong {
    color: var(--text-main);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--panel-bg);
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--panel-border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

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

.close-btn:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group select, .form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group select option {
    background: var(--bg-color);
}

.form-group select:focus, .form-group input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

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

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    margin-left: 8px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.machine-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.machine-stats {
    display: flex;
    gap: 12px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.machine-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bridge-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    border: 1px solid transparent;
}

.bridge-tag.connected {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
}

.bridge-tag.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.bridge-tag.offline, .bridge-tag.disconnected {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.bridge-tag i {
    font-size: 0.75rem;
}

/* ── Model Quota Panel ─────────────────────────────────────── */
.model-quota-section {
    padding: 20px 24px 16px;
}

.quota-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quota-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-quota-refresh {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 6px 10px;
    border-radius: 8px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-quota-refresh:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-quota-refresh.spinning i {
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.quota-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 14px 0 12px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
}

.quota-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--panel-border);
    transition: background 0.2s;
}

.quota-item:last-child {
    border-bottom: none;
}

.quota-item:hover {
    background: rgba(255, 255, 255, 0.025);
}

.quota-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 7px;
}

.quota-model-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.quota-refresh-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.quota-bars {
    display: flex;
    gap: 3px;
    height: 5px;
}

.quota-bar-segment {
    flex: 1;
    height: 5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.quota-footer {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
    padding-top: 2px;
}

/* Workflow Panel Styles */
.workflow-content {
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-main);
}

.workflow-content h1 {
    font-size: 1.25em;
    margin-bottom: 12px;
    color: var(--accent-blue);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.workflow-content h2 {
    font-size: 1.1em;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 600;
}

.workflow-content h3 {
    font-size: 1em;
    margin-top: 12px;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.workflow-content ul {
    margin-bottom: 12px;
    padding-left: 20px;
}

.workflow-content li {
    margin-bottom: 4px;
}

.workflow-content strong {
    color: var(--accent-blue);
    font-weight: 600;
}

.workflow-content br {
    display: block;
    margin: 8px 0;
    content: "";
}

.workflow-section .panel-content {
    max-height: 400px;
    overflow-y: auto;
}


/* -- Deployment & Updates ------------------------------------------ */

.agent-versions span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.agent-versions span i[class*=" arrow-up\] {
 animation: pulse-amber 2s infinite;
}

@keyframes pulse-amber {
 0% { opacity: 0.4; transform: scale(0.9); }
 50% { opacity: 1; transform: scale(1.1); }
 100% { opacity: 0.4; transform: scale(0.9); }
}

#deployment-panel .form-group input,
#deployment-panel select {
 transition: var(--transition);
}

#deployment-panel .form-group input:focus,
#deployment-panel select:focus {
 border-color: var(--accent-blue) !important;
 background: rgba(255, 255, 255, 0.1) !important;
 outline: none;
}

#deploy-push-all-btn {
 box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

#deploy-push-all-btn:hover {
 transform: translateY(-2px);
 box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

#antares-toast {
 box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
 background: rgba(30, 58, 95, 0.95) !important;
 backdrop-filter: blur(8px);
 border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.deployment-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.update-amber { color: var(--accent-orange); font-weight: 600; }
#deployment-panel .form-group { margin-bottom: 12px; }
#deployment-panel .form-group label { font-size: 0.78rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
#deployment-panel .form-group label i { margin-right: 4px; }
#deployment-panel .form-group input { width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--panel-border); border-radius: 6px; padding: 7px 10px; color: var(--text-primary); font-size: 0.85rem; }
.deploy-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.deploy-actions .btn-primary { flex: 1; font-size: 0.82rem; }
.panel-divider { border: none; border-top: 1px solid var(--panel-border); margin: 10px 0; }
.deploy-push-group { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.deploy-push-group select { flex: 1; background: rgba(0,0,0,0.25); border: 1px solid var(--panel-border); border-radius: 6px; padding: 7px 8px; color: var(--text-primary); font-size: 0.82rem; }
#deploy-push-all-btn { background: linear-gradient(135deg, #7c3aed, #4f46e5); font-size: 0.82rem; white-space: nowrap; }
.timestamp-small { font-size: 0.73rem; color: var(--text-muted); text-align: right; margin: 0; }

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.project-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.2);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.project-status {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.project-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.project-status.idle {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.project-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: rgba(0, 0, 0, 0.1);
    padding: 16px;
    border-radius: 12px;
}

.project-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.dev-avatars {
    display: flex;
    align-items: center;
}

.dev-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
    margin-left: -8px;
    transition: transform 0.2s;
}

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

.dev-avatar:hover {
    transform: scale(1.1);
    z-index: 10;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Next Refresh column styles */
.refresh-times-container {
    display: flex;
    flex-direction: column;
    gap: 1.5px;
    min-width: 120px;
    font-size: 0.22rem;
}

.agent-refresh-entry {
    background: rgba(255, 255, 255, 0.03);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.22rem;
}

.agent-refresh-entry:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--panel-border);
}

/* Last Seen / Active Dual Display */
.last-seen-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.last-active-primary {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.last-active-primary i {
    color: var(--accent-blue);
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
}

.last-seen-secondary {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 2px;
}

.last-seen-secondary i {
    color: var(--text-muted);
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}


/* Time column enhancements - Horizontal Layout */
.time-spent-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-family);
}

.time-pills {
    display: flex;
    gap: 8px;
    margin-right: 8px;
}

.time-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.time-pill .val {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.time-pill .lab {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.daily-grid {
    display: flex;
    gap: 3px;
}

.day-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.03);
    padding: 3px 6px;
    border-radius: 4px;
    min-width: 24px;
    border: 1px solid rgba(255,255,255,0.02);
    transition: var(--transition);
}

.day-box.today {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.day-box .day-n {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
}

.day-box.today .day-n {
    color: var(--accent-blue);
}

.day-box .day-v {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.day-box.today .day-v {
    color: var(--text-main);
}

.metric-pill {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.metric-pill.bug {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* Team Registry Specific Styles */
.registry-host-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    gap: 6px;
    transition: all 0.2s ease;
}

.registry-host-tag.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    font-weight: 500;
}

.host-online-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
}

.registry-project-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    color: var(--accent-purple);
    font-weight: 600;
}

.registry-hosts-container {
    max-width: 280px;
}

.registry-projects-container {
    max-width: 300px;
}

.registry-credits-group {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
