:root {
    --google-blue: #1a73e8;
    --google-red: #ea4335;
    --google-yellow: #fbbc04;
    --google-green: #34a853;
    --theme-primary: var(--google-blue);
    --theme-bg-soft: #e8f0fe;
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --on-surface: #202124;
    --on-surface-variant: #5f6368;
    --header-height: 72px;
    --sidebar-width: 320px;
    --border-color: #dadce0;
}

body.theme-kuba {
    --theme-primary: var(--google-blue);
    --theme-bg-soft: #e8f0fe;
}

body.theme-ania {
    --theme-primary: var(--google-red);
    --theme-bg-soft: #fce8e6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--on-surface);
    font-family: 'Google Sans', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: var(--header-height);
    background-color: var(--surface-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 500;
}

.logo-icon {
    color: var(--theme-primary);
    font-size: 32px !important;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    padding: 0 16px;
    height: 38px;
    border-radius: 19px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
}

.header-btn:hover {
    background: #f8f9fa;
    border-color: #dadce0;
}

.header-btn.primary {
    background: #202124;
    color: white;
    border: none;
}

.header-btn.primary:hover {
    background: #3c4043;
}

.status-pill {
    padding: 0 16px;
    height: 38px;
    border-radius: 19px;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

.app-shell {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 0 24px 24px 0;
    margin-right: 12px;
    position: relative;
    transition: background 0.2s;
}

.item.active {
    background-color: var(--theme-bg-soft);
    color: var(--theme-primary);
}

.item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--theme-primary);
    border-radius: 0 4px 4px 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8eaed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #5f6368;
}

.btn-delete-profile {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.item:hover .btn-delete-profile {
    opacity: 1;
}

.btn-delete-profile:hover {
    background: #fce8e6;
    color: #ea4335;
}


.sync-card {
    margin: 16px 24px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f8f9fa;
    font-size: 11px;
    line-height: 1.4;
}

.keyword-card {
    margin: 16px 24px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f8f9fa;
    font-size: 11px;
    line-height: 1.4;
    max-height: 240px;
    display: flex;
    flex-direction: column;
}

.keyword-list-container {
    flex: 1;
    overflow-y: auto;
    min-height: 40px;
    max-height: 140px;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.keyword-chip button {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.keyword-chip button:hover {
    color: #ea4335;
}


.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.badge-pending {
    background: #fce8e6;
    color: #ea4335;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dadce0;
    transition: background 0.3s;
}

.status-dot.online {
    background: #34a853;
    box-shadow: 0 0 8px rgba(52, 168, 83, 0.4);
}

.badge-active {
    background: #e6f4ea;
    color: #34a853;
}

main {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.report-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.card-body {
    padding: 24px;
    color: #3c4043;
    line-height: 1.6;
}

.risk-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
}

.risk-critical {
    background: #d93025;
    color: white;
    animation: pulse-critical 2s infinite;
}

.risk-high {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #ea4335;
}

.risk-medium {
    background: #fef7e0;
    color: #b06000;
    border: 1px solid #fbbc04;
}

.risk-safe {
    background: #e6f4ea;
    color: #137333;
}

@keyframes pulse-critical {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 0 24px;
    gap: 24px;
}

.tab {
    padding: 12px 0;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--theme-primary);
    border-bottom-color: var(--theme-primary);
}

.tab-content {
    padding: 20px 24px;
    display: none;
    background: white;
    border-top: 1px solid #eee;
}

.tab-content.active {
    display: block;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f1f3f4;
}

.online {
    color: #34a853;
}

.offline {
    color: #ea4335;
}

.btn-pulse {
    background: var(--theme-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pulse:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-pulse:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.blink {
    animation: b 1.5s infinite;
}

@keyframes b {
    50% {
        opacity: 0.4;
    }
}

/* Logger: Fixed the "Black Square" issue */
#gs-logger {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: none;
    width: 320px;
    height: 300px;
    background: rgba(30, 30, 30, 0.9);
    color: #00ff00;
    font-family: 'Roboto Mono', monospace;
    font-size: 9px;
    padding: 8px;
    border-radius: 8px;
    overflow-y: hidden;
    z-index: 2000;
    cursor: pointer;
    transition: height 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#gs-logger:hover {
    height: 200px;
    overflow-y: auto;
}

.log-line {
    border-bottom: 1px solid #333;
    padding: 4px 0;
    opacity: 0.8;
}

/* --- G3 Action Center --- */
.action-center-box {
    background: #f8f9fa;
    border: 1.5px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    margin-top: 12px;
}

.tool-suggestion {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-action {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-color);
    background: white;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brain-terminal-lite {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #333;
    padding: 12px;
    background: #eef1f5;
    border-radius: 8px;
    margin-bottom: 12px;
}

.insight-text {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.safe-note {
    background: #e6f4ea;
    color: #137333;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    border-left: 4px solid #34a853;
}

.presentation-tools {
    position: fixed;
    bottom: 70px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.btn-promo {
    background: #202124;
    color: white;
    padding: 14px 28px;
    border-radius: 32px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* --- AI Brain Panel --- */
.ai-brain-panel {
    background: #1a1a1b;
    color: #e8eaed;
    border-radius: 16px;
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brain-header {
    background: #202124;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #333;
    font-size: 13px;
}

.thinking-active {
    margin-left: auto;
    font-size: 10px;
    color: #34a853;
    background: rgba(52, 168, 83, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.brain-logs {
    height: 120px;
    padding: 16px 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-y: auto;
    color: #8ab4f8;
}

.grounding-box {
    margin-top: 12px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s;
}

.grounding-box.loading {
    opacity: 0.6;
    filter: grayscale(1);
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #202124;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: #34a853;
}

.toast-error {
    background: #ea4335;
}

.toast-info {
    background: #1a73e8;
}

/* --- Delete Button --- */
.btn-delete-report {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete-report:hover {
    background: #fce8e6;
    color: #ea4335;
}