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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============= SIDEBAR ============= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 72px;
    background: white;
    border-right: 1px solid #e5e7eb;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 16px 0;
}

/* ============= LOGO ============= */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 24px;
    min-height: 80px;
    flex-shrink: 0;
}

.logo-svg {
    width: 48px;
    height: 60px;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-svg:hover .logo-shape {
    stroke-width: 3 !important;
    stroke: #14532d !important;
}

/* ============= NAVIGATION ============= */
.nav-section {
    flex: 1;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.nav-item-wrapper {
    position: relative;
    margin: 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    text-decoration: none;
    flex-direction: column;
}

.nav-label {
    font-size: 11px;
    margin-top: 4px;
    color: #2e7d32;
    user-select: none;
}

.nav-item:hover {
    background: #f3f4f6;
}

.nav-item.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-item.active .nav-icon {
    background: #2e7d32;
    color: white;
}

.nav-item:not(.active) .nav-icon {
    border: 1px solid #2e7d32;
    color: #2e7d32;
}

.nav-item:not(.active):hover .nav-icon {
    background: #f1f8f4;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

/* ============= SECONDARY SIDEBAR (FLYOUT) ============= */
.secondary-sidebar {
    position: fixed;
    left: 72px;
    top: 0;
    height: 100vh;
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px 16px;
    z-index: 45;
    overflow-y: auto;
}

.secondary-sidebar.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.nav-item-wrapper:hover .secondary-sidebar {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.flyout-header {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 8px 12px;
    margin-bottom: 4px;
}

.flyout-item {
    display: block;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    color: #374151;
}

.flyout-item:hover {
    background: #f3f4f6;
}

.flyout-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.flyout-item:hover .flyout-title {
    color: #2e7d32;
}

.flyout-desc {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.flyout-nested {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 2px solid #f3f4f6;
    margin-top: 4px;
}

.flyout-nested .flyout-item {
    padding: 8px 12px;
}

.flyout-nested .flyout-title {
    font-size: 13px;
}

.flyout-nested .flyout-desc {
    font-size: 11px;
}

/* ============= BOTTOM ACTIONS ============= */
.bottom-actions {
    padding: 8px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

/* ============= MAIN CONTENT ============= */
.main-content {
    margin-left: 72px;
    min-height: 100vh;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px 32px;
}

/* ============= MODAL ============= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #2e7d32;
    color: white;
}

.btn-primary:hover {
    background: #1b5e20;
}

/* ============= CHAT CONTAINER ============= */
.chat-container {
    width: 100%;
    max-width: 900px;
    margin-top: 60px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-height: 500px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.message {
    display: flex;
    gap: 16px;
    animation: messageSlideIn 0.4s ease-out;
    align-items: flex-start;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 16px;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
}

.message.user .message-avatar {
    background: #e5e7eb;
    color: #374151;
}

.message-content {
    flex: 1;
    padding-top: 4px;
    line-height: 1.7;
    font-size: 15px;
    color: #1f2937;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state-message {
    font-size: 16px;
    color: #9ca3af;
}

.chat-input-container {
    padding: 20px;
    background: transparent;
}

.chat-input-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 28px;
    padding: 8px 8px 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-input-wrapper:focus-within {
    border-color: #2e7d32;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.12);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 20px;
    padding: 6px 0;
    font-family: inherit;
    color: #1f2937;
    line-height: 1.4;
}

.chat-input::placeholder {
    color: #9ca3af;
}

.chat-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.chat-action-btn svg {
    width: 20px;
    height: 20px;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: #1b5e20;
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* ============= MOBILE HEADER ============= */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    z-index: 60;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #2e7d32;
}

.mobile-header-actions {
    display: none;
    gap: 8px;
    align-items: center;
}

.mobile-header-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #2e7d32;
}

.mobile-header-btn:hover {
    background: #f3f4f6;
}

.mobile-header-btn svg {
    width: 20px;
    height: 20px;
}

.hamburger {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: #2e7d32;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ============= MOBILE RESPONSIVE ============= */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .mobile-header-actions {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 50;
        overflow-y: scroll;
        overflow-x: hidden;
    }

    .sidebar::-webkit-scrollbar {
        width: 12px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: #f9fafb;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #2e7d32;
        border-radius: 6px;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: #1b5e20;
    }

    .sidebar.mobile-active {
        transform: translateX(0);
    }

    .sidebar-content {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 16px 0;
    }

    .logo-container {
        display: none;
    }

    .nav-section {
        flex: 0;
        padding: 0;
        gap: 0;
    }

    .nav-item-wrapper {
        width: 100%;
        align-items: stretch;
    }

    .nav-item {
        width: 100%;
        padding: 12px 16px;
        flex-direction: row;
        justify-content: flex-start;
        border-radius: 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .nav-label {
        margin-top: 0;
        margin-left: 12px;
        font-size: 14px;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .bottom-actions {
        display: none;
    }

    .secondary-sidebar {
        position: static;
        left: auto;
        top: auto;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: #f9fafb;
        border: none;
        padding: 0;
        margin: 0;
        transition: max-height 0.3s ease;
        z-index: 40;
    }

    .secondary-sidebar.mobile-visible {
        max-height: 1000px;
        padding: 12px 16px;
    }

    .nav-item-wrapper:hover .secondary-sidebar {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .flyout-header {
        font-size: 10px;
        padding: 8px 12px 12px;
        margin-bottom: 4px;
    }

    .flyout-item {
        padding: 10px 12px;
        margin: 2px 0;
    }

    .flyout-title {
        font-size: 13px;
    }

    .flyout-desc {
        font-size: 11px;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 32px;
    }

    .chat-container {
        margin-top: 20px;
    }

    .chat-messages {
        max-height: 400px;
        padding: 20px 12px;
    }

    .message-content {
        font-size: 14px;
    }

    .empty-state {
        padding: 60px 20px;
    }

    .empty-state-message {
        font-size: 14px;
    }

    .mobile-logo svg {
        display: block;
    }
}