/* EmilyAI Admin Panel - Shared Styles */

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

/* Theme variables */
:root[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-header: #0f172a;
    --bg-card: #ffffff;
    --bg-card-header: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    --border-color: #e2e8f0;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-sidebar: #3b82f6;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-header: #020617;
    --bg-card: #1e293b;
    --bg-card-header: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --border-color: #334155;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-sidebar: #3b82f6;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
}

:root[data-theme="terminal"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-sidebar: #0a0a0a;
    --bg-header: #000000;
    --bg-card: #0a0a0a;
    --bg-card-header: #1a1a1a;
    --text-primary: #00ff00;
    --text-secondary: #00aa00;
    --text-sidebar: #00cc00;
    --text-sidebar-active: #00ff00;
    --border-color: #00aa00;
    --accent-primary: #00ff00;
    --accent-hover: #00cc00;
    --accent-sidebar: #00cc00;
    --shadow: rgba(0, 255, 0, 0.2);
    --shadow-hover: rgba(0, 255, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styles */
.header {
    background-color: var(--bg-header);
    color: white;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    transition: background-color 0.3s ease;
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.header-center {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.time-display {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-sidebar);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.time-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle label {
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-sidebar);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: #475569;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-switch.active {
    background-color: var(--accent-primary);
}

.toggle-switch::before {
    content: '\f185'; /* FontAwesome sun icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.toggle-switch.active::before {
    opacity: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    left: 27px;
}

.toggle-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toggle-switch.active .toggle-icon {
    opacity: 1;
}

.snow-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.snow-toggle label {
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-sidebar);
}

.logout-btn {
    background-color: #ef4444;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background-color: #dc2626;
}

/* Profile Icon */
.profile-icon {
    width: 36px;
    height: 36px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-icon:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

/* Layout Styles */
.layout {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: white;
    padding: 24px 0;
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    box-shadow: 2px 0 8px var(--shadow);
    transition: all 0.3s ease;
    z-index: 900;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-menu a span:not(.menu-icon) {
    display: none;
}

.sidebar.collapsed .sidebar-menu .section-header {
    display: none;
}

.sidebar-toggle {
    position: absolute;
    right: -15px;
    top: 20px;
    width: 30px;
    height: 30px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s ease;
    z-index: 901;
}

.sidebar-toggle:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 4px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-sidebar);
    text-decoration: none;
    padding: 12px 16px;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--text-sidebar-active);
}

.sidebar-menu a.active {
    background-color: var(--accent-sidebar);
    color: var(--text-sidebar-active);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-menu .section-header {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 16px 8px 16px;
    margin-top: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 60px;
}

/* Snow Effect */
#snow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Success and Error Messages */
.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);
    color: #16a34a;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid #22c55e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success::before {
    content: '✓';
    font-size: 20px;
    font-weight: bold;
}

.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #dc2626;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid #ef4444;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error::before {
    content: '⚠';
    font-size: 20px;
    font-weight: bold;
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 16px 32px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

.version-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* Page Title */
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* Config Card Styles */
.config-card {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.config-card-header {
    background: var(--bg-card-header);
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    user-select: none;
}

.config-card-header:hover {
    background: var(--border-color);
}

.config-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-card-icon {
    font-size: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.config-card-icon.open {
    transform: rotate(90deg);
}

.config-card-body {
    padding: 24px;
    display: none;
    border-top: 1px solid var(--border-color);
}

.config-card-body.open {
    display: block;
}

.config-item {
    margin-bottom: 20px;
}

.config-item label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.config-item input[type="text"],
.config-item input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.config-item input[type="text"]:focus,
.config-item input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Monitoring Card Styles */
.monitoring-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 24px;
}

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

.monitoring-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.monitoring-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-card-header);
}

.monitoring-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--bg-card-header);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.monitoring-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.monitoring-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.monitoring-btn.start {
    background: #22c55e;
    color: white;
}

.monitoring-btn.start:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.monitoring-btn.stop {
    background: #ef4444;
    color: white;
}

.monitoring-btn.stop:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.monitoring-btn.log {
    background: var(--accent-primary);
    color: white;
}

.monitoring-btn.log:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.monitoring-btn.restart {
    background: #f59e0b;
    color: white;
}

.monitoring-btn.restart:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    border-left: 4px solid #ef4444;
}

.connectivity-indicator {
    font-size: 24px;
}

.connectivity-message {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.save-btn {
    background: #22c55e;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.save-btn:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-header);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
}

.icon-btn:hover {
    background: var(--border-color);
}

.primary {
    background: var(--accent-primary);
    color: white;
}

.primary:hover {
    background: var(--accent-hover);
}

/* Action Buttons */
.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.btn-edit {
    background: var(--accent-primary);
    color: white;
}

.btn-edit:hover {
    background: var(--accent-hover);
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 120px;
    resize: vertical;
}

.form-section {
    margin-bottom: 32px;
}

select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

/* Section Styles */
.section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 24px;
}

.section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
}

/* Table Styles */
.user-table table,
.jobs-table table,
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.user-table thead,
.jobs-table thead,
table thead {
    background: var(--bg-card-header);
}

.user-table th,
.jobs-table th,
table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-table td,
.jobs-table td,
table td {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

.user-table tr:hover,
.jobs-table tr:hover,
table tbody tr:hover {
    background: var(--bg-card-header);
}

/* Badge Styles */
.role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.role-engineering {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.role-soc {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.role-general {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1) 0%, rgba(71, 85, 105, 0.1) 100%);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.auth-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.auth-local {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.auth-o365 {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1) 0%, rgba(0, 90, 158, 0.1) 100%);
    color: #0078d4;
    border: 1px solid rgba(0, 120, 212, 0.3);
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.status-final {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* Generic Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-secondary {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1) 0%, rgba(71, 85, 105, 0.1) 100%);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Button Size Variants */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.draft {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.approved {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px var(--shadow);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Chat Interface Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 128px);
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-secondary);
}

.composer {
    padding: 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.composer .row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input {
    flex: 1;
}

.input textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.docs-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.docs-toggle-switch {
    width: 40px;
    height: 22px;
    background-color: #475569;
    border-radius: 11px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.docs-toggle-switch.active {
    background-color: var(--accent-primary);
}

.docs-toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.docs-toggle-switch.active::after {
    left: 21px;
}

.docs-toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.helper {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-card-header);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--bg-card-header);
}

/* Documentation Styles */
.doc-nav {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.doc-nav h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.doc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-nav li {
    margin: 8px 0;
}

.doc-nav a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.doc-nav a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.doc-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.doc-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.doc-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.doc-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 16px;
    margin-bottom: 8px;
}

.doc-section p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.doc-section ul,
.doc-section ol {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 16px;
    padding-left: 24px;
}

.doc-section li {
    margin-bottom: 8px;
}

.doc-section pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.doc-section code {
    background: var(--bg-card-header);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
}

.doc-section pre code {
    background: none;
    padding: 0;
}

.info-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-left: 4px solid var(--accent-primary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Test Input Section */
.test-input-section {
    margin-bottom: 24px;
}

.test-json-input {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: vertical;
}

.analyze-btn {
    background: var(--accent-primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.analyze-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Playbook Builder Styles */
.builder-entry {
    background: var(--bg-card-header);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.builder-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Old match-field styles for playbook builder/editor
 * These styles are scoped to .builder-entry to avoid conflicts with the new
 * playbook card display. They are used in the playbook creation/editing forms
 * where match conditions are built interactively with separate input fields.
 * Can be removed when playbook builder is refactored to use the new format.
 */
.builder-entry .match-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.builder-entry .match-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.match-field-name,
.match-field-operator,
.match-field-value {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.agent-target,
.agent-value {
    flex: 1;
}

.agent-value-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-entry-btn {
    background: var(--accent-primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.add-entry-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Action Bar */
.action-bar,
.actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.actions {
    display: flex;
    gap: 8px;
}

.button-group {
    display: flex;
    gap: 8px;
}

/* Editor Styles */
.editor-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.editor-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent-hover);
}

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

/* Alert Styles */
.alert {
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--accent-primary);
    border-left: 4px solid var(--accent-primary);
}

.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);
    color: #16a34a;
    border-left: 4px solid #22c55e;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #d97706;
    border-left: 4px solid #f59e0b;
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

/* Help Text */
.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-card-header);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: help;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Additional Page-Specific Styles */

/* Container for centered content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Page Headers */
.page-header {
    margin-bottom: 32px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.page-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Info Message */
.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--accent-primary);
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #d97706;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #f59e0b;
}

.success-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);
    color: #16a34a;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #22c55e;
}

.warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #d97706;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #f59e0b;
}

/* Playbooks Grid */
.playbooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
    max-width: 100%;
}

/* Limit to 3 cards wide maximum */
@media (min-width: 1200px) {
    .playbooks-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.playbook-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
}

.playbook-card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-2px);
}

.playbook-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.playbook-id {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Match Conditions Styling */
.match-fields {
    margin-top: 12px;
    font-size: 14px;
}

.match-fields strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.match-conditions-text {
    color: var(--text-secondary);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.match-condition-item {
    display: inline-block;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-card-header);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin: 2px 0;
}

.playbook-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

/* Tab Styles */
.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn,
.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.tab-btn.active,
.tab-button.active,
.tab-btn:hover,
.tab-button:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.reports-table {
    width: 100%;
    margin-top: 24px;
}

.report-content {
    margin-top: 24px;
}

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

.stat-card {
    background: var(--bg-card-header);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

/* Section Card */
.section-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Release Notes */
.release-section {
    margin-bottom: 32px;
}

.release-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.release-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
}

.release-section ul {
    list-style: none;
    padding: 0;
}

.release-section li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-primary);
    line-height: 1.6;
}

.release-section li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent-primary);
    font-weight: bold;
}

/* Search Container */
.search-container {
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Remove Entry Button */
.remove-entry-btn {
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-entry-btn:hover {
    background: #dc2626;
}

/* Misc Utility Classes */
.row {
    display: flex;
    gap: 12px;
}

.title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

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

.summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.reason {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.rule-id {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-card-header);
    padding: 2px 6px;
    border-radius: 4px;
}

.score-delta {
    font-weight: 600;
    font-size: 14px;
}

.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* Version Badge */
.version-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

/* Status Indicators for Monitoring Buttons */
.start {
    background: #22c55e;
    color: white;
}

.stop {
    background: #ef4444;
    color: white;
}

.restart {
    background: #f59e0b;
    color: white;
}

.sent {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .playbooks-grid,
    .reports-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-center {
        display: none;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .monitoring-stats,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .playbooks-grid,
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

/* Capacity Gauge Styles */
.capacity-gauge {
    width: 200px;
    height: 120px;
    position: relative;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.capacity-gauge path {
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

/* Shift Handover Report Styles */
.stat-change {
    font-size: 12px;
    margin-top: 5px;
    font-weight: normal;
}

.client-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comparison-info {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Configuration Tabs Styles */
.config-tabs-container {
    margin-bottom: 24px;
}

.config-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.config-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.config-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-header);
}

.config-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

/* Status Indicators for Memory Services */
.service-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.service-status-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--border-color);
    transition: all 0.2s ease;
}

.service-status-card.status-connected {
    border-left-color: #22c55e;
}

.service-status-card.status-disconnected {
    border-left-color: #ef4444;
}

.service-status-card.status-checking {
    border-left-color: #f59e0b;
}

.service-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.service-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.service-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: background-color 0.2s ease;
}

.service-indicator.connected {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.service-indicator.disconnected {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.service-indicator.checking {
    background-color: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.service-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
