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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 24px;
    color: #2c3e50;
}

main {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    padding: 16px;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.todo-item:hover {
    background-color: #f0f0f0;
}

.todo-item h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.todo-item p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Navigation styles */
.main-nav {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.nav-btn {
    padding: 8px 16px;
    border: 1px solid #3498db;
    background-color: white;
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: #ecf0f1;
}

.nav-btn.active {
    background-color: #3498db;
    color: white;
}

/* Email inbox styles */
.email-inbox h2 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.email-count {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 16px;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-item {
    padding: 16px;
    background-color: #f9f9f9;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.email-item:hover {
    background-color: #f0f0f0;
    transform: translateX(2px);
}

.email-item.processed {
    border-left-color: #27ae60;
    opacity: 0.8;
}

.email-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.email-from {
    font-weight: 600;
    color: #2c3e50;
}

.email-date {
    font-size: 12px;
    color: #95a5a6;
}

.email-subject {
    font-size: 15px;
    color: #34495e;
    margin-bottom: 4px;
}

.email-snippet {
    font-size: 13px;
    color: #7f8c8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
}

.email-badges {
    display: flex;
    gap: 8px;
}

.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge.pending {
    background-color: #f39c12;
    color: white;
}

.badge.processed {
    background-color: #27ae60;
    color: white;
}

.badge.attachment {
    background-color: #9b59b6;
    color: white;
}

.loading, .error, .empty-state {
    padding: 40px;
    text-align: center;
    color: #7f8c8d;
}

.error {
    color: #e74c3c;
}

/* Todo container styles */
.todo-container h2 {
    margin-bottom: 16px;
    color: #2c3e50;
}

.todo-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.todo-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.todo-form input:focus {
    outline: none;
    border-color: #3498db;
}

.todo-form button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.todo-form button:hover {
    background-color: #2980b9;
}

.todo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.todo-count {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    color: #7f8c8d;
    font-size: 13px;
}

.sort-btn {
    padding: 4px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sort-btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.sort-btn.active {
    background-color: #3498db;
    border-color: #3498db;
    color: #fff;
}

.show-completed-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #7f8c8d;
    cursor: pointer;
}

.show-completed-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* Todo table styles */
.todo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.todo-table thead {
    background-color: #f9f9f9;
    border-bottom: 2px solid #ecf0f1;
}

.todo-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

.todo-table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #ecf0f1;
}

.todo-table tbody tr:hover {
    background-color: #f9f9f9;
}

.todo-table tbody tr.completed {
    opacity: 0.7;
    background-color: #f5f5f5;
}

.todo-table .col-done {
    width: 50px;
    text-align: center;
}

.todo-table .col-title {
    min-width: 200px;
}

.todo-table .col-due {
    width: 150px;
    white-space: nowrap;
}

.todo-table .col-link {
    width: 80px;
    text-align: center;
}

.todo-table .col-actions {
    width: 80px;
    text-align: center;
}

.todo-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.todo-table .strikethrough {
    text-decoration: line-through;
    color: #95a5a6;
}

.todo-table .todo-description {
    color: #7f8c8d;
    font-size: 13px;
}

.todo-table .category-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    color: white;
    margin-left: 8px;
}

.todo-table .source-badge {
    font-size: 10px;
    padding: 2px 6px;
    background-color: #3498db;
    color: white;
    border-radius: 10px;
    margin-left: 8px;
}

.todo-table .empty-cell {
    color: #bdc3c7;
}

.todo-table .col-link a {
    color: #3498db;
    text-decoration: none;
}

.todo-table .col-link a:hover {
    text-decoration: underline;
}

.todo-item.completed {
    opacity: 0.7;
    border-left-color: #27ae60;
}

.todo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.todo-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.todo-header h3 {
    margin: 0;
    font-size: 16px;
}

.todo-header h3.strikethrough {
    text-decoration: line-through;
    color: #95a5a6;
}

.todo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.category-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    color: white;
}

.delete-btn {
    padding: 4px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* Category manager styles */
.category-manager h2 {
    margin-bottom: 16px;
    color: #2c3e50;
}

.add-category {
    margin-bottom: 20px;
}

.add-category form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-category input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.add-category input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

.add-category input[type="color"] {
    width: 40px;
    height: 38px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.add-category button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.add-category button:hover {
    background-color: #2980b9;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.category-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.category-name {
    flex: 1;
    font-size: 14px;
    color: #2c3e50;
}

/* Navigation badge for pending count */
.nav-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}

/* Source badge for agent-created todos */
.source-badge {
    font-size: 11px;
    padding: 2px 8px;
    background-color: #3498db;
    color: white;
    border-radius: 12px;
    margin-right: 8px;
}

/* Decision Inbox styles */
.decision-inbox h2 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.inbox-header {
    margin-bottom: 16px;
}

.decision-count {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 16px;
}

.batch-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: 8px 16px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-secondary:hover {
    background-color: #d5dbdb;
}

.btn-approve {
    padding: 8px 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-approve:hover {
    background-color: #219a52;
}

.btn-reject {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-reject:hover {
    background-color: #c0392b;
}

.decision-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.decision-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    transition: all 0.2s;
}

.decision-item:hover {
    background-color: #f0f0f0;
}

.decision-item.selected {
    background-color: #e8f4fd;
    border-left-color: #2980b9;
}

.decision-item.high {
    border-left-color: #27ae60;
}

.decision-item.medium {
    border-left-color: #f39c12;
}

.decision-item.low {
    border-left-color: #e74c3c;
}

.decision-select {
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
}

.decision-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.decision-content {
    flex: 1;
    cursor: pointer;
}

.decision-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.decision-source {
    font-size: 12px;
    padding: 2px 8px;
    background-color: #ecf0f1;
    color: #7f8c8d;
    border-radius: 4px;
    text-transform: uppercase;
}

.confidence-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
}

.confidence-badge.high {
    background-color: #d4edda;
    color: #155724;
}

.confidence-badge.medium {
    background-color: #fff3cd;
    color: #856404;
}

.confidence-badge.low {
    background-color: #f8d7da;
    color: #721c24;
}

.decision-time {
    font-size: 12px;
    color: #95a5a6;
}

.decision-email-info {
    margin-bottom: 8px;
}

.decision-email-info .email-from {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 8px;
}

.decision-email-info .email-subject {
    color: #7f8c8d;
}

.decision-proposed {
    margin-bottom: 8px;
}

.proposed-label {
    font-weight: 600;
    color: #2c3e50;
}

.proposed-action {
    color: #3498db;
    font-weight: 500;
}

.proposed-title {
    color: #7f8c8d;
}

.decision-reasoning {
    font-size: 13px;
    color: #7f8c8d;
}

.decision-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 4px 8px;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #ecf0f1;
}

/* Decision detail view */
.decision-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    padding-bottom: 16px;
    border-bottom: 1px solid #ecf0f1;
}

.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-section h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section p {
    color: #7f8c8d;
    margin-bottom: 4px;
    font-size: 14px;
}

.detail-section strong {
    color: #2c3e50;
}

.reasoning-text {
    line-height: 1.5;
}

.reasoning-details {
    background-color: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    overflow-x: auto;
    color: #7f8c8d;
}

.confidence.high {
    color: #27ae60;
}

.confidence.medium {
    color: #f39c12;
}

.confidence.low {
    color: #e74c3c;
}

/* Decision Log styles */
.decision-log h2 {
    margin-bottom: 16px;
    color: #2c3e50;
}

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

.stat-card {
    background-color: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #bdc3c7;
}

.stat-card.pending {
    border-left-color: #f39c12;
}

.stat-card.approved {
    border-left-color: #27ae60;
}

.stat-card.rejected {
    border-left-color: #e74c3c;
}

.stat-card.auto {
    border-left-color: #3498db;
}

.stat-card.confidence {
    border-left-color: #9b59b6;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 4px;
}

.log-filter {
    margin-bottom: 16px;
}

.log-filter label {
    margin-right: 8px;
    color: #7f8c8d;
}

.log-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-item {
    padding: 12px 16px;
    background-color: #f9f9f9;
    border-left: 4px solid #bdc3c7;
    border-radius: 4px;
}

.log-item.status-pending {
    border-left-color: #f39c12;
}

.log-item.status-approved {
    border-left-color: #27ae60;
}

.log-item.status-rejected {
    border-left-color: #e74c3c;
}

.log-item.status-auto {
    border-left-color: #3498db;
}

.log-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.status-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-badge.status-pending {
    background-color: #fef3cd;
    color: #856404;
}

.status-badge.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.status-auto {
    background-color: #d1ecf1;
    color: #0c5460;
}

.log-type {
    font-weight: 500;
    color: #2c3e50;
}

.log-source {
    font-size: 12px;
    color: #95a5a6;
}

.log-time {
    font-size: 12px;
    color: #95a5a6;
    margin-left: auto;
}

.log-reasoning {
    font-size: 13px;
    color: #7f8c8d;
}

.log-feedback {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 8px;
    font-style: italic;
}

/* ============================================================================
   Chat Widget Styles
   ============================================================================ */

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #3498db;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.chat-icon {
    font-size: 24px;
    color: white;
    font-weight: 600;
}

.chat-widget.open .chat-toggle {
    background-color: #7f8c8d;
}

.chat-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-height: 500px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

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

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #3498db;
    color: white;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.chat-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 300px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-welcome {
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
}

.chat-welcome p {
    margin: 0 0 12px 0;
}

.chat-welcome ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.chat-welcome li {
    padding: 6px 0;
    color: #95a5a6;
    font-size: 12px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-message.user {
    align-self: flex-end;
    background-color: #3498db;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    align-self: flex-start;
    background-color: #f1f3f4;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
}

.message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-intent {
    margin-top: 6px;
}

.intent-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    color: #7f8c8d;
}

.chat-message.user .intent-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-message.typing {
    padding: 12px 18px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #bdc3c7;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-6px);
    }
}

.chat-actions {
    padding: 8px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

.chat-action-btn {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-action-btn:hover {
    background-color: #229954;
    transform: scale(1.02);
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background-color: white;
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input input:focus {
    border-color: #3498db;
}

.chat-input input:disabled {
    background-color: #f9f9f9;
}

.chat-input button {
    padding: 10px 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chat-input button:hover:not(:disabled) {
    background-color: #2980b9;
}

.chat-input button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Responsive adjustments for chat widget */
@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 48px);
        right: -12px;
    }
}

/* ============================================================================
   Calendar View Styles
   ============================================================================ */

.calendar-view h2 {
    margin-bottom: 16px;
    color: #2c3e50;
}

.calendar-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 20px;
    border: 1px solid #3498db;
    background-color: white;
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #ecf0f1;
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
}

.calendar-event-count {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 16px;
}

.calendar-event-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-event-card {
    padding: 16px;
    background-color: #f9f9f9;
    border-left: 4px solid #9b59b6;
    border-radius: 4px;
    transition: all 0.2s;
}

.calendar-event-card:hover {
    background-color: #f0f0f0;
    transform: translateX(2px);
}

.calendar-event-card.all-day {
    border-left-color: #e67e22;
}

.calendar-event-card.recurring {
    border-left-color: #27ae60;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.event-summary {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.event-badges {
    display: flex;
    gap: 6px;
}

.event-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.event-badge.all-day {
    background-color: #e67e22;
    color: white;
}

.event-badge.recurring {
    background-color: #27ae60;
    color: white;
}

.event-time {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #7f8c8d;
}

.event-time-icon {
    color: #3498db;
}

.event-location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.event-location-icon {
    color: #e74c3c;
}

.event-description {
    font-size: 13px;
    color: #95a5a6;
    line-height: 1.4;
    margin-bottom: 8px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-conference {
    margin-top: 8px;
}

.event-conference a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #3498db;
    text-decoration: none;
    padding: 4px 10px;
    background-color: #e8f4fd;
    border-radius: 4px;
    transition: all 0.2s;
}

.event-conference a:hover {
    background-color: #d1e8f8;
    color: #2980b9;
}

.event-organizer {
    margin-top: 8px;
    font-size: 12px;
    color: #95a5a6;
}

.event-organizer strong {
    color: #7f8c8d;
}

/* Date separator for calendar event list */
.calendar-date-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 12px 0;
}

.calendar-date-separator:first-child {
    margin-top: 0;
}

.date-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    white-space: nowrap;
}

.date-line {
    flex: 1;
    height: 1px;
    background-color: #ddd;
}

/* Empty calendar state */
.calendar-empty {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.calendar-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: #bdc3c7;
}

/* Responsive adjustments for calendar */
@media (max-width: 600px) {
    .calendar-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    .event-header {
        flex-direction: column;
        gap: 8px;
    }

    .event-badges {
        align-self: flex-start;
    }
}

/* ============================================================================
   Authentication / Login Styles
   ============================================================================ */

/* Auth loading state */
.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.auth-loading p {
    margin-top: 16px;
    color: #7f8c8d;
    font-size: 16px;
}

.auth-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-header {
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.login-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-button:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #bdc3c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.google-icon {
    flex-shrink: 0;
}

.login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.login-info {
    margin-top: 24px;
    color: #95a5a6;
    font-size: 12px;
}

/* Header updates for authenticated state */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    font-size: 14px;
    color: #7f8c8d;
}

.logout-btn {
    padding: 6px 14px;
    background-color: transparent;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: #ecf0f1;
    color: #2c3e50;
    border-color: #95a5a6;
}

/* ============================================================================
   Account Status (OAuth) Styles
   ============================================================================ */

.account-status-container {
    position: relative;
}

.account-status-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.account-status-btn:hover {
    background-color: #ecf0f1;
    border-color: #bdc3c7;
}

/* Responsive adjustments for login */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .header-top {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }
}

.account-status-icon {
    font-weight: 600;
    color: #3498db;
}

.account-status-count {
    color: #7f8c8d;
}

.account-status-alert {
    background-color: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 600;
}

.account-status-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
}

.account-section {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.account-section:last-child {
    border-bottom: none;
}

.account-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-section-count {
    font-weight: normal;
    font-size: 11px;
}

.account-empty {
    font-size: 12px;
    color: #95a5a6;
    padding: 8px 0;
    font-style: italic;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin: 4px 0;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #bdc3c7;
}

.account-item.status-ok {
    border-left-color: #27ae60;
}

.account-item.status-syncing {
    border-left-color: #f39c12;
}

.account-item.status-auth-required {
    border-left-color: #e74c3c;
    background-color: #fef5f5;
}

.account-item.status-error {
    border-left-color: #e74c3c;
}

.account-item.status-inactive {
    border-left-color: #bdc3c7;
    opacity: 0.6;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.account-email {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-name {
    font-size: 11px;
    color: #95a5a6;
}

.account-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #bdc3c7;
}

.status-dot.status-ok {
    background-color: #27ae60;
}

.status-dot.status-syncing {
    background-color: #f39c12;
    animation: pulse 1.5s infinite;
}

.status-dot.status-auth-required {
    background-color: #e74c3c;
}

.status-dot.status-error {
    background-color: #e74c3c;
}

.status-dot.status-inactive {
    background-color: #bdc3c7;
}

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

.status-text {
    font-size: 11px;
    color: #7f8c8d;
    white-space: nowrap;
}

.account-item.status-auth-required .status-text {
    color: #e74c3c;
    font-weight: 500;
}
